Differential Equations with MapleSystems of first order linear differential equationsrestart:with(linalg):with(DEtools):Introduction :Many technical and physical problems can be represented by a system of differential equations. In this sheet we'll examine some of the more basic ones : the linear first order systems.The general form of a linear system is as follows : x1'(t) = a11(t) x1(t) + a12(t) x2(t) + ... + g(t) x2'(t) = a21(t) x1(t) + a22(t) x2(t) + ... + g(t) ............Or, in a shorthand vector notation : x'(t) = P(t) x(t) + g(t)with x(t) a vectorfunction with components NiMtJiUieEc2IyIiIjYjJSJ0Rw== t/m NiMtJiUieEc2IyUibkc2IyUidEc= and P(t) a n x n matrix with elements NiMtJiUiYUc2IyUjaWpHNiMlInRH.If NiMvLSUiZ0c2IyUidEciIiE= we call these systems homogeneous and if NiMwLSUiZ0c2IyUidEciIiE= we call them inhomogeneous.If matrix P(t) does not depend on 't' we call the system a linear system with constant coefficients, often written as : x' = A x + g(t)This sheet will only discuss homogenous linear systems of the form : x' = A x Solutions of these systems all have the general form : x = NiMlI3hpRw==NiMtJSRleHBHNiMqJiUickciIiIlInRHRig= , where r are the eigenvalues and NiMlI3hpRw== the corresponding eigenvectors of the matrix A.Some remarks :- The methods for solving systems of first order linear equations is based on elementary linear algebra principles that won't be repeated here.- Information about Maple commands used here can be found in the online manuals (Help menu).Systems with real eigenvaluesExample)Consider system x'(t)=A x(t) with matrix A defined by :A := matrix(2,2,[[1, 1], [4, 1]]);The computation of eigenvalues and eigenvectors is quite easy in Maple :eigenvals(A);eigenvects(A);Exercise 1)Now give the general solution of the system from the example above. Consult your textbook if necessary.To visualize the direction field in the (x1,x2) plane for the system from above we can use the dfieldplot command :deqns:={diff(x1(t),t)=x1(t)+x2(t), diff(x2(t),t)=4*x1(t)+x2(t)};vars:={x1(t),x2(t)}:dfieldplot(deqns,vars,t=0..1,x1=-1..1,x2=-1..1);The origin in the resulting picture is called a saddlepoint.Exercise 2)Read the online manual for the dfieldplot command and try to alter some values above to make yourself familiar with this command.?dfieldplotExercise 3)Now consider a system where matrix A looks a follows :restart:with(linalg):with(DEtools):A := matrix(2,2,[[3, 1], [1, 1]]);a) Compute the eigenvalues and eigenvectors for this system.b) Replace the question marks below with the corresponding values from A and then plot the direction field. deqns:={diff(x1(t),t)=??*x1(t)+??*x2(t), diff(x2(t),t)=??*x1(t)+??*x2(t)};vars:={x1(t),x2(t)}:dfieldplot(deqns,vars,t=0..1,x1=-1..1,x2=-1..1);c) Consult your textbook if necessary and tell if the origin in the resulting picture is a : - saddlepoint - spiral - node - centerSystems with complex eigenvaluesEven when matrix A has complex eigenvalues we search for real solutions : if matrix A only contains real values complex eigenvalues can only exist as complex conjugated pairs and the corresponding solutions can be split into a real and an imaginary part.Exercise 4)Consider system x'(t)=A x(t) with matrix A defined by :restart:with(linalg):with(DEtools):A := matrix(2,2,[[-1, 1], [-2, -1]]); a) Compute the eigenvalues and eigenvectors of A.b) Give the 2 linear indepent real solutions of the system.c) Replace the question marks below with the corresponding values and then plot the direction field. deqns:={diff(x1(t),t)=??*x1(t)+??*x2(t), diff(x2(t),t)=??*x1(t)+??*x2(t)}:vars:={x1(t),x2(t)}:dfieldplot(deqns,vars,t=0..50,x1=-3..3,x2=-3..3);d) Consult your textbook if necessary and tell if the origin in the resulting picture is a : - saddlepoint - spiral - node - centerA phase-portrait of the system with one or more trajectories can be visualised by using the phaseportrait command. The "inits" macro contains the initial conditions for the trajectory or trajectories we want to plot (in this case 3) :
inits:={[x1(0)=1,x2(0)=0],[x1(0)=-1,x2(0)=0], [x1(0)=-1.2,x2(0)=0.5]}:phaseportrait(deqns,vars,t=0..50,inits,stepsize=.05);Exercise 5)Consider system x'(t)=A x(t) with matrix A defined by :restart:with(linalg):with(DEtools):A := matrix(2,2,[[0, -2], [1, 0]]); a) Compute the eigenvalues and eigenvectors of A.b) Replace the question marks below with the corresponding values and then plot the direction field.
deqns:={diff(x1(t),t)=??*x1(t)+??*x2(t), diff(x2(t),t)=??*x1(t)+??*x2(t)}:vars:={x1(t),x2(t)}:dfieldplot(deqns,vars,t=0..50,x1=-1..1,x2=-1..1);c) Consult your textbook if necessary and tell if the origin in the resulting picture is a :
- saddlepoint
- spiral
- node
- centerversion 1.2, KL, Feb 2006