# how to To specify initial conditions for a system of ode?

I have the following system of ode: a = {{-3, 1}, {-1, -5}}; eqns = Thread[{y1'[x], y2'[x]} == a.{y1[x], y2[x]} + {1, 1}]; I solved the general solution for a system of ode. However, I cannot specify the initial conditions for y(0)=(0,0)? this is what I tried:

DSolve[{{y1[x] == y[x], y2[x] == y[x]}, {{y1, y2[x]} == {0, 0}}}, {y1[x], y2[x]}, x]

and how to plot the solution? Thank you so much!

• a={{-3,1},{-1,-5}}; eqns=Thread[{y1'[x],y2'[x]}==a.{y1[x],y2[x]}+{1,1}]; ic Thread[{y1,y2}=={0,0}]; f={y1[x],y2[x]} /. DSolve[{eqns,ic},{y1[x],y2[x]},x][]; Plot[f,{x,-1,1}] – Bill Oct 22 '17 at 15:41
• @Bill Thank you! when I type f={y1[x],y2[x]} /. DSolve[{eqns,ic},{y1[x],y2[x]},x][]; it gives the following two errors: DSolve::deqn: Equation or list of equations expected instead of ic in the first argument {{(y1^[Prime])[x]==1-3 y1[x]+y2[x],(y2^[Prime])[x]==1-y1[x]-5 y2[x]},ic}. and ReplaceAll::rmix: Elements of {{(y1^[Prime])[x]==1-3 y1[x]+y2[x],(y2^[Prime])[x]==1-y1[x]-5 y2[x]},ic} are a mixture of lists and nonlists. – Omar Kan Oct 22 '17 at 15:56
• Sorry, scrape-n-paste somehow "ate" the = between ic and Thread So a={{-3,1},{-1,-5}}; eqns=Thread[{y1'[x],y2'[x]}==a.{y1[x],y2[x]}+{1,1}]; ic=Thread[{y1,y2}=={0,0}]; f={y1[x], y2[x]}/.DSolve[{eqns,ic}, {y1[x],y2[x]}, x][]; Plot[f, {x,-1,1}] I SHOULD have scrape-n-pasted it back into MMA to verify it before trusting it. Again, sorry for my mistake. – Bill Oct 22 '17 at 18:21