Section 5.1 Systems-Introduction, coupled springs. Tom Linton

> map(with,{DEtools,plots,plottools}):

Warning, new definition for translate
Warning, new definition for translate
The coupled spring system: x1 is the displacement (from equilibrium) of the first mass, with "left" being positive, so x1(0) = 1 means that mass 1 is moved 1 unit left of its resting position. x3 is the displacement of the second mass from its resting position.

> odesys:=diff(x1(t),t)=x2(t),
diff(x2(t),t) =-40/3*x1(t)+10/3*x3(t),
diff(x3(t),t)=x4(t),
diff(x4(t),t) =40/3*x1(t)-40/3*x3(t);

[Maple Math]

The DEplot command, and the scene option can be used to graph the x-components (one at a time). To plot several x-components together, name each; use a command ending colon in the naming command, then immediately display the plot (to see what it looks like and make sure Maple plotted something and that your stepsize is reasonable, etc.), and finally (below a bit this first time) combine two or more plots inside a display command (which requires the plotting package plots).

One thing to notice is that the "other" range (i.e. the one that isn't denoting time), must use one of the solution function names (x1, x2, x3 or x4 in the example below). It shouldn't matter which one, but, for example, you cannot use y = a .. b here.

> x1plot:=DEplot({odesys},{x1(t),x2(t),x3(t),x4(t)},
t=0..15,[[x1(0)=1,x2(0)=0,x3(0)=2,x4(0)=0]],
x1=-2.5..2.5,scene=[t,x1],
stepsize=0.05,linecolor=red):

x1plot;

[Maple Plot]

> x3plot:=DEplot({odesys},{x1(t),x2(t),x3(t),x4(t)},
t=0..15,[[x1(0)=1,x2(0)=0,x3(0)=2,x4(0)=0]],
x1=-2.5..2.5,scene=[t,x3],
stepsize=0.05,linecolor=blue):

x3plot;

[Maple Plot]

Together:

> display([x1plot, x3plot]);

[Maple Plot]

Those spring-masses are said to be "in-phase" as they return to their respective equilibrium positions and then leave again "at the same times" and "in the same directions".

>

Here, we turn dsolve loose to find formulas for the springs' displacement. Many times with systems, we'd need to use the numeric option with dsolve.

> dsolve({odesys,x1(0)=1,x2(0)=0,x3(0)=2,x4(0)=0},
{x1(t),x2(t),x3(t),x4(t)});

[Maple Math]

Copy the functions giving locations and force numeric values with evalf:

> y1:=t->evalf(cos(2/3*sqrt(15)*t));
y3:=t->evalf(2*cos(2/3*sqrt(15)*t));

[Maple Math]

[Maple Math]

And make a movie to illustrate what "in phase" looks like with pictorial springs and masses.

> tvals:=[seq(.1*k,k=0..97)]:

> frames:=[seq(display([
rectangle([3.-y1(t)-.15,.5],[3.-y1(t)+.15,-.5],color=red),
rectangle([6.-y3(t)-.15,.5],[6.-y3(t)+.15,-.5],color=blue),
line([3,-1],[3,1],color=red,linestyle=2),
line([6,-1],[6,1],color=blue,linestyle=2),
line([0,0],[6-y3(t)-.15,0],color=green,thickness=3)],
axes=FRAME,view=[0..9,-1..1]),
t=tvals)]:

> display(frames,insequence=true);

[Maple Plot]

Click on the plot above and press the play button (it looks like a right pointing triangle, next to the square).

Click here to move on to out of phase springs.