Examples of differential equations: Difference between revisions

Content deleted Content added
Reverted 1 edit by 2600:1700:5500:7E80:28A6:D8D0:B270:E55F (talk): I do (TW)
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags
Line 124:
 
The equation can be also solved in MATLAB symbolic toolbox as
<sourcesyntaxhighlight lang="matlab">
x = dsolve('D2x+c*Dx+k*x=0','x(0)=1','Dx(0)=0')
</syntaxhighlight>
</source>
although the solution looks rather ugly,
<sourcesyntaxhighlight lang="matlab">
x = (c + (c^2 - 4*k)^(1/2))/(2*exp(t*(c/2 - (c^2 - 4*k)^(1/2)/2))*(c^2 - 4*k)^(1/2)) -
(c - (c^2 - 4*k)^(1/2))/(2*exp(t*(c/2 + (c^2 - 4*k)^(1/2)/2))*(c^2 - 4*k)^(1/2))
</syntaxhighlight>
</source>
 
This is a model of a [[Damping|damped oscillator]]. The plot of displacement against time would look like this: