Sample Problem:
This problem contains all the Maple statements that are needed to do the first homework problem. It involves solving the equations for constant acceleration for motion in one dimension, where the parameters of motion change in regions along the x axis.
The problem is Venkataraman and Thomas 4-34 which is worked out in the text for your reference. An automobile travels from points A to D as shown on page 91 of the text. There are three regions defined by points A and B, B and C and C and D. The distance from A to B is 220 ft, and in this segment the car uniformly accelerates form a velocity of 33 ft/s at A to a velocity of 44 ft./s at B with an accelation a1.
The distance between B and C is unknown but the care continues to accelerate at the same rate as in the first region and achieves a velocity of 71.5 ft/s at point C. Finally in the region from C to D, a distnce of
1820 ft, the car decelerates at the rate a2.
We use Maple to solve the problem and plot the results. We cover the three regions A to B, B to C and
C to D and write the equations of motion in a form that will be useful for calculation. For example, the equation x = 0.5 *a1 *t^2 for AB is expressed as eq1 = 0.5*a1*tb^2-xb. It will be set equation to zero.
We solve the problem by first establishing the given information, then writing the equations of motion for the three regions:
> xb:=220:va:=33:vb:=44:vc:=71.5:xd:=xc+1820:vd:=0.0: eq1:= va*tb+0.5*a1*tb^2-xb; eq2:=a1*tb-(vb-va); eq3:=vb*(tc-tb)+0.5*a1*(tc-tb)^2-(xc-xb); eq4:=a1*(tc-tb)-(vc-vb); eq5:=vc*(td-tc)+0.5*a2*(td-tc)^2-((xc+1820)-xc); eq6:=a2*(td-tc)-(vd-vc); eq1 := 33 tb
+
.5 a1 tb
2 −
220 eq2 := a1 tb
−
11 eq3 := 44 tc
−
44 tb
+
.5 a1 ( eq4 := a1 ( tc
)
−
− tb ) tc
− tb 27.5
2 xc 220 eq5 := 71.5 td
− eq6
71.5 tc
:= a2 (
+
.5 a2 (
− td
− tc td tc )
+
71.5
)
2 −
1820
The six equations have six unknows, and they can be solved simultaneously. The simultaneous solution is now accomplished by the statement:
> fsolve({eq1=0,eq2=0,eq3=0,eq4=0,eq5=0,eq6=0},{a1,a2,tb,tc,td,xc});
{ a2
=
-1.404464286
tc
=
20.}
, td
=
70.90909091
, tb
=
5.714285714
, a1
=
1.925000000
, xc
=
1045.000000
,
The problem is done, and you should refer to the text to verify the answers. We now want plots, but the fact that the solutions are in three regions must be taken into account. We first record the results from the simultaneous equations, then define x, v and a as functions of time for the three regions:
> tc:=20.0:a2:=-1.404:td:=70.9:tb:=5.714:a1:=1.925:xc:=1045.0: x:=proc(t) if t<=tb then va*t+0.5*a1*t^2 else if t>tb and t< tc then vb*(t-tb)+0.5*a1*(t-tb)^2+xb else if t>=tc then vc*(t-tc)+0.5*a2*(t-tc)^2+xc fi fi fi end: v:=proc(t) if t<=tb then a1*t+va else if t>tb and t< tc then vb+a1*(t-tb) else if t>=tc then vc+a2*(t-tc)fi fi fi end: a:=proc(t) if t<=tb then a1 else if t> tb and t< tc then a1 else if t>=tc then a2 fi fi fi end:
Page 1
> plot('a(t)',t=0..td);plot('v(t)',t=0..td);plot('x(t)',t=0..td);
The problem is done, and the three plots a, v and x as functions of time for the three regions are shown beow:
>
Page 2