1
$\begingroup$

pend1[t_] := m x1''[t] + 2 k x1 [t] - k x2[t] == 0;

pend2[t_] := m x2''[t] + 2 k x2[t] - k x1[t] == 0;

iclist = {x1'[0] == 0, x1[0] == 0, x2'[0] == 0, x2[0] == L};

pendlist[t_] = {pend1[t], pend2[t]};

eqnlist[t_] = Append[iclist, pendlist[t]];

soln = DSolve[eqnlist, x2[t], t]

Forewarning: I'm pretty new to mathematica and coding in general, and for this problem my professor gave us 2 ODE's and wants us to solve them simultaneously but doing so in a way that utilizes lists. When I try to execute the DSolve command I get "DSolve:Equation or list of equations expected instead of eqnlist in the first argument eqnlist." and I'm not really sure what this means or how to go about troubleshooting this. Any help/guidance would be much appreciated, thanks!

$\endgroup$
2

1 Answer 1

1
$\begingroup$

Try

DSolve[{m x1''[t] + 2 k x1[t] - k x2[t] == 0, m x2''[t] + 2 k x2[t] - k x1[t] == 0, x1'[0] == 0, x1[0] == 0, x2'[0] == 0, x2[0] == L}, {x1, x2}, t]
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .