Laplace Transformation


This web site provides an introduction to the mathematical program Maple. It originated from a commercial "Matrix Laboratory" package and is well adapted to numerical experiment. Matlab program and script files always have filenames ending with ".m"; the programming language is exceptionally straightforward since it has much in common with popular programming language C. Matlab prompt always starts with a double arrow (>>). To get help, simply type:
>> help
[a long list of help topics follows]

and for specific commands:
>> help fft
[a help message on the fft function follows].

By typing semicolomn (;) at the end of your command, Matlab surpresses windows output; otherwise, the output is sent to the screen. To quit Matlab session, simply type quit or exit on Matlab prompt, or click at the end red button of windows right upper corner.

This tutorial is made solely for the purpose of education, and intended for students taking APMA 0330 course at Brown University. The tutorial has links to the MATLAB “m” files that are posted on the APMA 0330 website. You, as the user, are free to use the m files to your needs for learning how to use the Matlab program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Maple tutorial for the first course APMA0330
Return to Maple tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340



5.1. Laplace Tranform


 

Laplace transforms in Maple is really straightforward and doesn’t require any complicated loops like the numerical methods.

For example, let’s take the equation t^2+sin(t)=y(t) as our equation. The syntax for finding the laplace transform of this equation requires the simple syntax below:

> with(inttrans):
> laplace (t^2+sin(t)=y(t),t,s) ;

Yes, that is all. Easy, right? The syntax for the command is (equation, dependent value, independent value).

 

Laplace transforms and Inverse Laplace Transforms

Laplace transforms in Maple is really straightforward and doesn’t require any complicated loops like the numerical methods.

For example, let’s take the equation t^2+sin(t)=y(t) as our equation. The syntax for finding the laplace transform of this equation requires the simple syntax below:

> with(inttrans):
> laplace (t^2+sin(t)=y(t),t,s) ;

Yes, that is all. Easy, right? The syntax for the command is (equation, dependent value, independent value).

Finding the inverse Laplace transform requires a similar syntax. Just take the result we have from the Laplace transform above and apply it here:

> with(inttrans):
> invlaplace ((2/s^3)+(1/s^2+1),s,t);

Very easy indeed. The syntax for the inverse Laplace transform is reversed compared to the Laplace transform for some reason. The syntax is (equation, independent value, dependent value).

Solving equations with periodic piecewise continuous functions

> with(plots):
> with(inttrans):
> E:=1; a:=2;
> yh :=t->invlaplace((x+5+2)/(x^2+5*x+6), x, t);
> p := x^2+5*x+6;
> yp1 := t->invlaplace(E/(a*x^2*(x^2+5x+6)),x,t)
> yp2 := t->invlaplace(E*exp(-a*x)/(x*p*(1-exp(-a*x))), x, t)
> y := t-> yp1(t)-piecewise(a < t, yp2(t-a), 2*a < t, yp2(t-2*a), 3*a < t, yp2(t-3*a))
> plot(y(t), t = 0 .. 4*a);
> y2 := t->y(t)+yh(t)
> plot(y2(t), t = 0 .. 4*a);

 

 

 

3.2. Heaviside Function

I. How to define functions


To define a function, just type in the formula. We need to use a special form for the left hand side, which includes an underscore after the name of the variable, and a special "colon-equals" sign for the function definition:

 

 

 

 

3.3. Laplace Transform of Discontinuous Functions

I. How to define functions


 

 

 

 

 

3.4. Inverse Laplace Transform

I. How to define functions


Laplace transforms in Maple is really straightforward and doesn’t require any complicated loops like the numerical methods.

For example, let’s take the equation t^2+sin(t)=y(t) as our equation. The syntax for finding the laplace transform of this equation requires the simple syntax below:

> with(inttrans):
> laplace (t^2+sin(t)=y(t),t,s) ;

Yes, that is all. Easy, right? The syntax for the command is (equation, dependent value, independent value).

Finding the inverse Laplace transform requires a similar syntax. Just take the result we have from the Laplace transform above and apply it here:

> with(inttrans):
> invlaplace ((2/s^3)+(1/s^2+1),s,t);

Very easy indeed. The syntax for the inverse Laplace transform is reversed compared to the Laplace transform for some reason. The syntax is (equation, independent value, dependent value).

Solving equations with periodic piecewise continuous functions

> with(plots):
> with(inttrans):
> E:=1; a:=2;
> yh :=t->invlaplace((x+5+2)/(x^2+5*x+6), x, t);
> p := x^2+5*x+6;
> yp1 := t->invlaplace(E/(a*x^2*(x^2+5x+6)),x,t)
> yp2 := t->invlaplace(E*exp(-a*x)/(x*p*(1-exp(-a*x))), x, t)
> y := t-> yp1(t)-piecewise(a < t, yp2(t-a), 2*a < t, yp2(t-2*a), 3*a < t, yp2(t-3*a))
> plot(y(t), t = 0 .. 4*a);
> y2 := t->y(t)+yh(t)
> plot(y2(t), t = 0 .. 4*a);

 

 

 

 

3.5. Differential Equations

I. How to define functions


 

 

 

 

 

 

1.6.6. Mechanical Applications


 

 

 

1.6.7. Electrical Applications