| Spis treści | Szukaj | << | >> |
Rozwiążmy równanie różniczkowe: x'(t) = x(t)
> eq := diff( x(t), t ) = x(t);
d
eq := -- x(t) = x(t)
dt
> dsolve( eq, x(t) );
x(t) = _C1 exp(t)
Wynik jest oczywisty: x(t) = C exp(t)
Aby wyznaczyć rozwiązanie naszego równania z
warunkiem początkowym, np. x(0) = 1, wystarczy podać te
informacje w pierwszym argumencie dsolve:
> dsolve( {eq, x(0) = 1}, x(t) );
x(t) = exp(t)
> plot( rhs(%), t = -1..1 );
+ A
+ AA
2.5 + AA
+ A
+ AAA
+ AAA
2 + AAA
+ AAA
+ AA
+ AAA
1.5 + AAA
+ AAA
+ AAAA
+ AAAA
+AAAAA
AA1A*A
AAAAAA +
AAAAAAA +
AAAAAAAA +
AAAAAAAAAA 0.5 +
******++-++-++-++-++-++-++-++-++-++-+++-++-++-++-++-++-++-++-++-++-++-++-++
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8
Funkcja |
x'(t) = y(t)
y'(t) = -x(t)
> eq := {diff(x(t),t)=y(t) , diff(y(t), t) = -x(t)};
d d
eq := {-- x(t) = y(t), -- y(t) = -x(t)}
dt dt
> dsolve( eq, {x(t),y(t)} );
{x(t) = _C1 sin(t) + _C2 cos(t), y(t) = _C1 cos(t) - _C2 sin(t)}
Z warunkiem początkowych wygląda to tak:
> ini := {x(0) = 0, y(0) = 1};
ini := {x(0) = 0, y(0) = 1}
> dsolve( eq union ini, {x(t),y(t)} );
{x(t) = sin(t), y(t) = cos(t)}