# Which numerical procedure to use

1. Mar 28, 2014

### aaaa202

I have a system of linear differential equations with known boundary conditions. First of all what is the general solution to such a system? I know it is exponentials with the eigenvalues, but I couldn't find any place where the exact full solution was stated.
Second of all, I want to write a program in matlab that solves this set of linear differential equations. In general how am I better off:
- Simulate the solutions numerically starting from scratch i.e. dy1 dy2, dt and everything are numerical quantities
- Find eigenvalues to the coefficient matrix numerically, plug into the analytical solution (which is the one I am not completely sure off, but I think you can write up a general formula) and solve for the unknown constants by applying boundary conditions.

2. Mar 28, 2014

### Simon Bridge

That's because the description is too general for there to be a systematic way of finding the solution.
i.e. the system may not have a solution.

http://tutorial.math.lamar.edu/Classes/DE/SolutionsToSystems.aspx
... this sort of thing is the closest you'll get to a general approach to a solution.

To do this in matlab, you'd construct the matrix A (see link) and then use Matlab's matrix tools to analyse it. i.e. eigs() will find the eigenvalues and vectors.

3. Mar 29, 2014

### aaaa202

But as far as I can see from the link you provided isn't the most general solution simply:

x(vector) = c1 * eigenvector_1 * exp(eigenvalue_1 * t) + c2 * eigenvector_2 * exp(eigenvalue_2 * t) + ...

So it is all about fitting that solution to the boundary conditions? Or am I wrong?

4. Mar 29, 2014

### Simon Bridge

That's right.
It's a bit like solving systems of linear equations... i.e. there may not be a unique solution, and so on.

Looks like matlab has a symbolic differential equation solver that also does systems of equations.
http://www.mathworks.com/help/symbolic/dsolve.html