2 ((face (octave-eval 2398 2554) (default 1906 1942) (book-result 608 624 1302 1355 1542 1626) (maxima-eval-insert 532 584 1239 1293 1488 1533) (dfplot-eval 178 254 2104 2192)) (book-command-arg))
\f
5 Systems of differential equations
19 When you click at a point say [x,y] = [1,2] then you are finding
20 the trajectory through that point.
21 Note in the above plot the special directions corresponding to the
22 eigenvectors of the matrix.
25 We can calculate the eigenvalues by solving the characteristic equation:
27 solve(determinant(matrix([1,1],[4,1]) - r*ident(2))) returns
31 Two useful functions in maxima are:
33 EIGENVALUES(mat) takes a MATRIX
34 as its argument and returns a list of lists the first sublist of
35 which is the list of eigenvalues of the matrix and the other
36 sublist of which is the list of the multiplicities of the
37 eigenvalues in the corresponding order.
40 - Function: EIGENVECTORS (MAT)
41 takes a MATRIX as its argument and returns a list of lists the
42 first sublist of which is the output of the EIGENVALUES command
43 and the other sublists of which are the eigenvectors of the matrix
44 corresponding to those eigenvalues respectively.
46 (load("eigen.mc"),eigenvectors(matrix([1,1],[4,1])))
50 [[[3, - 1], [1, 1]], [1, 2], [1, - 2]]
53 so the eigenvalues are [3,-1] with multiplicities 1 and 1 respectively, and the
54 corresponding eigenvectors are [1,2] and [1,-2].
56 eigenvectors(matrix([2,1,2],[0,2,3],[0,0,4])) returns
58 [[[2, 4], [2, 1]], [1, 0, 0], [1, -, -]]
62 Note in the plot that the direction [1,2] has longer direction arrows than
63 the direction [1,-2] (since 3 is bigger than -1). The arrows in the
64 [1,2] direction go away from the origin since '3' is positive.
68 Comparing two methods of looking at the system
70 D[x,t]= y, D[y,t]= -sin(x) - 0.1* y
72 First we look at the trajectory through the point (x,y) = (0,3).
73 If you follow the trajectory it eventually seems to circle around
76 ode{ D[x,t]= y, D[y,t]= -sin(x) - 0.1* y};set xrange [0,16];
79 If we look at the same equation with the same inital conditions
80 (0,3) (in fortran notation!), then we see the 'line 1' (representing 'x')
81 tending to 13 and the 'line 2' representing 'y' tending to 0.
83 function xdot = pend(x,t)
84 xdot(1) = x(2); xdot(2) = -sin( x(1)) - 0.1*x(2); end
85 sol=lsode( "pend",[0.0, 3.0], t = linspace(0,40, 200));