Solution of Differential Equations


REF: (1) Dorf, Modern Control System, chapter 2; (2) Heck, Intro to Maple, Springer-Verlag
(Uses Maple V): diff, Heaviside, dsolve, laplace, simplify, plot3d

Spring-Mass-Damper System

In Maple we can easily produce the explicit analytic solution of differential equations by invoking the Laplace Transform. As an illustration consider a Spring-Mass-Damper system. Use a 2nd Order Ordinary Differential Equation. The current 2nd ODE is expressed in terms of the damping coefficients and natural frequency. These two quantities is readily obtainable from the original ODE of the form,

M y'' + B y' + K y = U
where:
  M=mass, B=viscous damping, K=spring constant
  U=input
  y=mass displacement
Maple code,
#ax9.m  or ax9.txt
> ODE:=diff(y(t),t$2)+ 2* rho*omega*diff(y(t),t)+omega^2*y(t)=Heaviside(t);
> IC:=y(0)=0, D(y)(0)=0:
> solution:=dsolve( {ODE,IC}, y(t) , 'laplace');
# No damping coefficient
> rho:=0: simplify(solution);
# Fixed damping & varying frequencies
> rho:=1/6:simplify(solution);
> plot3d(rhs("),omega=2/3..4/3,t=0..20,style=hidden,orientation=[-30,45],axes=BOXED);
# Fixed frequency & varying damping coefficient  
> rho:='rho': omega:=1:
> plot3d( rhs(solution),rho=1/5..2,t=0..20,style=hidden,orientation=[-10,45],axes=BOXED);
> 

When executed it gave the following analytic solution and 3d graphics,


Mountain Bike Suspension System.
(Uses Maple V): plots package, diff, dsolve, odeplot

This sample with photo & time responses is available in MATLAB section. Maple V code for Small Bump response is given below. Code uses system of three Ordinary Differential Equations with known initial conditions.

> #bike.txt
> #Moutain Bike Front Suspension System
> restart;
> with(plots):
> b:=2:
> sys := diff(x1(t),t)=x2(t),diff(x2(t),t)=-3*x1(t)+2*x3(t)+1,diff(x3(t),t)=2/b*x1(t)-2/b*x3(t): 
> fcns:={x1(t),x2(t),x3(t)}:
> p:= dsolve({sys,x1(0)=0,x2(0)=0,x3(0)=0},fcns,type=numeric):
> odeplot(p, [t,x1(t)], 0..16, numpoints=100,axes=BOXED,color=red);

Execution result,