Maxima-微分方程式
Maxima-微分方程式
amazon kindle版を出版しました。
物理の物体の自由落下に関する問題で,上向きを正とした場合、
(1)$\displaystyle{ \dfrac{d^2 x}{d t^2}=-g }$
・ode2を使う場合
ode2( diff(x(t), t, 2) = -g, x(t), t );
2
g t
x(t) = (- ----) + %k2 t + %k1
2
$\displaystyle{ x\left(t\right)=-{{g\,t^2}\over{2}}+{\it \%k}_{2}\,t+{\it \%k}_{1}}$
${\it \%k}_{2}\,{\it \%k}_{1}$は任意定数
・desolveを使う場合
desolve( diff(x(t), t, 2) = -g, x(t) );
$\displaystyle{x\left(t\right)=t\,\left(\left.{{d}\over{d\,t}}\,x\left(t\right) \right|_{t=0}\right)-{{g\,t^2}\over{2}}+x\left(0\right)}$
$\displaystyle{x'(0)=\left(\left.{{d}\over{d\,t}}\,x\left(t\right) \right|_{t=0}\right)}$のことです。
(2)初期値$t=0$のとき$x=0,x'(0)=0$を入れる場合は、
ic2(% , t=0 , x(0)=0 , diff(x(t),t)=0);
2
g t
x(t) = - ----
2
$\displaystyle{x\left(t\right)=-{{g\,t^2}\over{2}}}$
1階微分方程式では ic1 となります。
(23) $\displaystyle{ \dfrac{dx}{dt} t-2x+t =0 }$、$t=1$のとき$x(t)=2$
ode2( 'diff(x(t),t,1)*t-2*x(t)+t=0 , x(t), t );
1 2
x(t) = (- + %c) t
t
ic1(%,t=1,x(t)=2);
2
x(t) = (x(1) - 1) t + t
$\displaystyle{ x=t^2+t }$
(3)$\displaystyle{ \dfrac{dx}{dt}=\dfrac{5x}{3t} }$
ode2( diff(x(t), t, 1) = 5*x(t)/(3*t), x(t), t );
5 log(t)
--------
3
x(t) = %c %e
radcan(%);・・・logなどの関数を簡単にする。
5/3
x(t) = %c t
連立微分方程式
$\displaystyle{ \dfrac{d x}{dt}+2x-3y-4t=0, \, \dfrac{d y}{dt}+x+2y=0 }$
desolve(['diff(x(t),t,1)=-2*x(t)+3*y(t)+4*t,'diff(y(t),t,1)=-1*x(t)+2*y(t)],[x(t),y(t)]);
t - t
(3 y(0) - x(0) - 4) %e (3 y(0) - 3 x(0) - 12) %e
[x(t) = ----------------------- - ---------------------------- + 8 t - 4,
2 2
t - t
(3 y(0) - x(0) - 4) %e (y(0) - x(0) - 4) %e
y(t) = ----------------------- - ----------------------- + 4 t]
2 2
$\displaystyle{ x={{\left(3\,y\left(0\right)-x\left(0\right)-4 \right)\,e^{t}}\over{2}}-{{\left(3\,y\left(0\right)-3\,x\left(0 \right)-12\right)\,e^ {- t }}\over{2}}+8\,t-4 }$
$\displaystyle{ y={{
\left(3\,y\left(0\right)-x\left(0\right)-4\right)\,e^{t}}\over{2}}- {{\left(y\left(0\right)-x\left(0\right)-4\right)\,e^ {- t }}\over{2 }}+4\,t }$
よって,
$\displaystyle{ x= {\it \%k}_{1}\,e^{t}-3{\it \%k}_{2}\,e^ {- t }+8\,t-4 }$
$\displaystyle{ y= {\it \%k}_{1}\,e^{t}- {\it \%k}_{2}\,e^ {- t }+4\,t }$