Springs with large displacements

SM212 project, written by Brad Winston Hoff.

The idea behind this project is to use a generalized form of the spring equation to evaluate the spring's behavior for different spring constants and initial conditions.

The equation given is something to the effect of:

mx'' + Bx' + kx + Ex3 = 0
In this equation, m is the mass on the spring, k is the spring constant, B is the damping constant, and E is Duffing's constant.

The MAPLE commands are given without output so save space. Just copy and paste each line into MAPLE to see the output. The first step is to input the equation we're using and load the plotting package:

> ode:=m*(diff(x(t), t$2))+B*(diff(x(t), t$1))+k*(x(t))+E((x(t))^3)=d;
> with(DEtools);

Now put in the conditions for part one.... (I'm using the letter d to represent the driving force of the function. For the first part of the project, d is equal to 0).

> m:=1; k:=1; B:=1; E:= -.5; d:=0;

Put in the initial conditions....

> ic:=x(0)=0, D(x)(0)=0;

Now graph the equation with the first set of conditions:

> DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);

Now, since the projects asks for a graph of all three E values for each B value, change the E value and the re-graph the function.

> E:=0;
> DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> E:=.5;
> DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);

Now change the B value and cycle through the E values again.

> B:=2; E:=-0.5;
> DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> E:=0; DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> E:=.5; DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> B:=3; E:=-.5;
> DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> E:=0; DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);
> E:=.5; DEplot(ode, x(t), 0..20, [[ic]], stepsize=.1);

For part 2 of the project, an external driving force will be added. Rather than completely re-typing the equation, just change the d value to the driving equation:

> d:=f*(cos(j*t));

In this driving equation, f is the amplitude of the driving force (F0), and j represents gamma, the angular frequency of the driving equation.

Now put in the initial values and initial conditions:

> m:=1; k:=1; f:=1; E:=5; B:=.25; j:=1;
> ic:=x(0)=0, D(x)(0)=-5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);

Since this part requires different initial conditions for each value of j, cycle through these much like in part one...

> ic:=x(0)=0, D(x)(0)=0;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> ic:=x(0)=0, D(x)(0)=5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> j:=2.5; ic:=x(0)=0, D(x)(0)=-5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> ic:=x(0)=0, D(x)(0)=0;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> ic:=x(0)=0, D(x)(0)=5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> j:=4; ic:=x(0)=0, D(x)(0)=-5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> ic:=x(0)=0, D(x)(0)=0;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);
> ic:=x(0)=0, D(x)(0)=5;
> DEplot(ode, x(t), 0..50, [[ic]], stepsize=.1);

Now for the last graphing part, re-define the constants as stated by the problem:

> m:=1; k:=1; f:=1; B:=.25; E:=5; j:=2.5;

Now put in the first set of initial conditions:

> ic:=x(0)=.86, D(x)(0)=0;
> DEplot(ode, x(t), 20..30, [[ic]], stepsize=.1);
> ic:=x(0)=.87, D(x)(0)=0;
> DEplot(ode, x(t), 20..30, [[ic]], stepsize=.1);


Put into html by wdj on 5-15-97. Updated 5-30-2003