MATLAB fails to solve a system of seventeen ODE in matrix form

1 view (last 30 days)
Hello, I have recently downloaded the trial version of MATLAB with symbolic math toolbox in order to solve a system of seventeen homogeneous linear ODEs.
Since the size of the computation is large (seventeen ODEs!) and that I have the data of the constants in form of a matrix, I have decided to solve this in matrix form as instructed here: http://www.mathworks.com/help/symbolic/solve-a-system-of-differential-equations.html?lang=en#buxuujb
Unfortunately, for some really strange reason, MATLAB seems to be unable to solve the equation and instead gives really strange answers.
After I have made the matrix A (the constants used in the system of ODEs) and vector X (the ODEs), I have typed in the command window:
>> eqn = diff(X) == A*X
and gave me: eqn(t) =
diff(X1(t), t) == a11*X1(t)
diff(X2(t), t) == a22*X2(t)
diff(X3(t), t) == a33*X3(t)
diff(X4(t), t) == a44*X4(t)
diff(X5(t), t) == a55*X5(t)
diff(X6(t), t) == a66*X6(t)
diff(X7(t), t) == a74*X6(t) + a77*X7(t)
and some other equations.
The initial conditions were input as: >> C = [1; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
X1(t) to X6(t) are all isolated and is not included in any other ODEs (meaning the constants on the X1(t) to X6(t) is "0" in other ODEs after X7(t)). So obviously, X1(t) should give me the form of "exp(a11*t)" and X2(t) to X6(t) as "0" However, when I have entered: >> [X1Sol(t) X2Sol(t) X3Sol(t) ...... ] = dsolve(eqn, C)
It took merely 2 seconds but gave me some lengthy equations for the first 10 ODEs, and gave me bunch of zeros for the rest, which was obviously wrong.
Is there a limit to how many ODEs I can command MATLAB to solve? Or is this some sort of bug?
I have tried this at least 5 times, over and over again, made my other two friend do it to make sure it is not an human error, and it gave me the same wrong results. Strangely, when I do system of 3 ODEs using the same method, it seems to work fine...
Could someone please help? Thank you in advance. Hayao

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!