Maxima linear system of 6 differential equations question
Subject: Maxima linear system of 6 differential equations question
From: Robert Dodier
Date: Sat, 3 Nov 2007 10:17:39 -0700
On 11/3/07, wuko at onet.eu <wuko at onet.eu> wrote:
> First I define known variables:
> h[1] : 15;
> h[2] : 310;
> r : 2.15;
> J[b] : 45;
> Q[1] : 208;
> Q[2] : 100;
> T[m] : 335;
> J[m] : 20;
> l : 12.9;
> g : 9.8665;
> d : 3.80;
> E : 90;
> q : 120;
>
> Then I put separately each of the differential functions:
> f1 : -((E*%pi*d^2*r^2*g)/((h[2]+h[1])*4*(Q[1]+q*l)*r^2))*(fi[1]-fi[3])-((Q[1]+q*(h[2]+h[1]-r*fi[1]))*r*g)/((Q[1]+q*l)*r^2);
> f2 : -((E*%pi*d^2*r^2*g)/(h[1]*4*(Q[2]+q*l)*r^2))*(fi[2]-fi[3])+((Q[2]+q*(h[1]-r*fi[2]))*r*g)/((Q[2]+q*l)*r^2);
> f3 : -((E*%pi*d^2)/((h[2]+h[1])*4*(J[m]+J[b])))*r^2*(fi[3]-fi[1])-((E*%pi*d^2)/(h[1]*4*(J[m]+J[b])))*r^2*(fi[3]-fi[2])+T[m]/(J[m]+J[b]);
> f4 : Omega[1];
> f5 : Omega[2];
> f6 : Omega[3];
>
> Now, I load the dynamics package:
> load("dynamics");
>
> And then I can go with Runge Kutta method rk:
> lnr: rk([f1,f2,f3,f4,f5,f6],[Omega[1],Omega[2],Omega[3],fi[1],fi[2],fi[3]],[0,0,0,0,0,0],[t,1,2,0.1]);
Damian, with the above inputs I get the following output from rk:
[[1, 0, 0, 0, 0, 0, 0], [1.1, - 10.25768128321815,
.5284368316503477, .5114890215126114, - .5126041155682962,
.02643791192921309, .02567184092243067],
[1.2, - 20.58266158721448, 1.053003885962255, .9998154834327209,
- 2.05377893808893, .1055584445306002, .1015245565775437],
[1.3, - 31.04268609989585, 1.569780865934235, 1.44264868446843,
- 4.633636044706833, .2367792263424359, 0.224115077069886],
[1.4, - 41.7063952052816, 2.074750487062469, 1.819274991442454,
- 8.269102528253173, .4191213648706525, .3878419087406761],
[1.5, - 52.64377907073568, 2.563759596744382, 2.111295530870044,
- 12.9840331877079, .6511977260045584, .5851426242855927],
[1.6, - 63.92664069492918, 3.032491199843688, 2.303197686715856,
- 18.80936857624975, .9311978460235488, .8067551018338791],
[1.7, - 75.62907035813829, 3.476450020346394, 2.382769227990298,
- 25.78333989929484, 1.256870704273858, 1.042028270162264],
[1.8, - 87.82793451904995, 3.890963439217891, 2.341332446548934,
- 33.95172205401095, 1.625506809217628, 1.279265415242462],
[1.9, - 100.6033823287885, 4.271198746413626, 2.173785463825491,
- 43.36813641234232, 2.033921190190098, 1.506081322313518],
[2.0, - 114.0393730825058, 4.612196680261468, 1.878448328782824,
- 54.0944052739444, 2.478438933058267, 1.7097537634093]]
which seems to be OK. Plotting something like
plot2d ([discrete, makelist ([x[1], x[k]], x, foo)]), k=<whatever>;
where foo is the rk output and k is from 2 to 7 inclusive,
makes some nice pictures. (I don't know how to call plot2d to
get all the curves in one plot.)
If you get reasonable results for some initial conditions and strange
results for some others, well, unfortunately that is not surprising when
you solve differential equations numerically. What are the initial
conditions for which you get strange results?
best
Robert Dodier