# Issue with NDSOlve while solving vector differential equation [closed]

I am trying to get solution of a vector differential equation

x'[t]= aa*x[s]


where aa is my 9X9 matrix

aa= {
{0, 0, 0, s, 0, 0, 0, 0, 0},
{0, 0, 0, 0, s, 0, 0, 0, 0},
{0, 0, 0, 0, 0, s, 0, 0, 0},
{-s, 0, 0, 0, 0, 0, 0.3, 0, 0},
{0, -s, 0, 0, 0, 0, 0, 0.3, 0},
{0, 0, -s, 0, 0, 0, 0, 0, 0.3},
{0, 0, 0, -0.3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, -0.3, 0, 0, 0, 0},
{0, 0, 0, 0, 0, -0.3, 0, 0, 0}
}


This code

function1 =
NDSolve[{x'[s] == aa*x[s],
x[0] ==  {{1, 0, 0, 0, 1, 0, 0, 0, 1}}}, {x[s]}, {s, 0, 10}]


is giving me this error:

NDSolve::deqn: "Equation or list of equations expected instead of True in the first argument {True,True}"

-

## closed as off-topic by m_goldberg, Oleksandr R., bobthechemist, Michael E2, ArtesFeb 3 at 1:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Oleksandr R., bobthechemist, Michael E2, Artes
If this question can be reworded to fit the rules in the help center, please edit the question.

Please post a minimal problematic example, with all data and code needed for readers to evaluate, properly formatted (see the help FAQ on how-to). You'll be much more likely to get help. –  rasher Feb 2 at 6:03
Shouldn't you be using a dot . instead of the multiplication asterisk * ? –  Peltio Feb 2 at 6:45

Ok, there seem to be two trivial errors in your code. The use of * instead of . and a set of brackets too much.

Try this

NDSolve[{x'[s] == aa.x[s], x[0] == {1, 0, 0, 0, 1, 0, 0, 0, 1}}, {x[s]}, {s, 0, 10}]


You can extract your solution with

sol[s_] = First[x[s] /. %]


and then plot the functions as in

Table[
Plot[sol[s][[k]], {s, 0, 10}],
{k,1,9}
]


Take note before this post gets closed. :-)

-
Thanks @Peltio for your reply but I am getting the same error again even after doing what you advised me to do. –  user11948 Feb 2 at 8:21
Have you tried in a fresh kernel? Also, add a Clear[x,s,sol] before solving the system. –  Peltio Feb 2 at 8:30
@user11948. I have tested Peltio's answer. It produces valid results. You must be failing to implement it exactly. –  m_goldberg Feb 2 at 14:56