Content deleted Content added
Repairing links to disambiguation pages - You can help! |
→A more complicated model: Added syntax that doesn't make the newer MATLAB throw up with warnings |
||
Line 117:
: <math>m\lambda^2 + c \lambda + k = 0. </math>
This is a [[quadratic equation]] which we can solve. If <math>c^2<4km</math> there are two complex conjugate
: <math>x(t) = e^{at} \left(\cos bt - \frac{a}{b} \sin bt \right) </math>
Line 126:
<syntaxhighlight lang="matlab">
x = dsolve('D2x+c*Dx+k*x=0','x(0)=1','Dx(0)=0')
% or equivalently
syms x(t) c k
Dx = diff(x, t);
x = dsolve(diff(x,t,2) + c*Dx + k*x == 0, x(0) == 1, Dx(0) == 0)
</syntaxhighlight>
although the solution looks rather ugly,
|