Hi,
I was trying to solve a 2nd order ODE with expression like this:
where m and k are constants. I've tried dsolve:
syms x x0 x_0 k m
Dx = diff(x);
ode = diff(x,2) == -k*x/m;
cond1 = x(0) == x0;
cond2 = Dx(0) == x_0;
conds = [cond1 cond2];
dSol(x) = dsolve(ode,conds);
ySol = simplify(ySol)
But that didn't work. Can anyone help me out with this? Thank you so much!
Best Answer