List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Laplace Transforms
| [MUG] Laplace Transforms |
|
Author: Chuck Baker
Posted: 23/11/2000 21:56:58 GMT
|
>> From: Chuck Baker
Hello all,
I have the following linear set of first order differential equations which I
have
solved by coupling Laplace transforms with linear algebra.
y' = 2y - 4z, y(0) = 3
z' = y - 3z, z(0) = 0
I derived solutions by hand by first taking the Laplace transforms of the
differential equations,
then, I solved the simultaneous equations for Y(s) and Z(s).
Finally, I determined the inverse transforms to develop the solution
expressions y(t) and z(t).
I computed the solutions to be:
Y(t) = 4e^t - e^-2t
Z(t) = e^t - e^-2t
How can this process be written in Maple?
Thanks,
Chuck
|
| [MUG] Re: Laplace Transforms |
|
Author: Maple Group
Posted: 27/11/2000 22:11:15 GMT
|
>> From: Maple Group
| >> From: Chuck Baker
| I have the following linear set of first order differential equations which
| I have solved by coupling Laplace transforms with linear algebra.
| y' = 2y - 4z, y(0) = 3
| z' = y - 3z, z(0) = 0
| ...
| How can this process be written in Maple?
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Fri, 24 Nov 2000 08:50:52 -0800
From: Allan Wittkopf
To:
Subject: Laplace Transforms
You could do:
> eqns:={diff(y(t),t)=2*y(t)-4*z(t), y(0)=3,
> diff(z(t),t)=y(t)-3*z(t),z(0)=0};
eqns :=
d d
{-- y(t) = 2 y(t) - 4 z(t), y(0) = 3, -- z(t) = y(t) - 3 z(t), z(0) = 0}
dt dt
> dsolve(eqns,{y(t),z(t)},method=laplace);
bytes used=1070064, alloc=982860, time=0.23
{y(t) = -exp(-2 t) + 4 exp(t), z(t) = -exp(-2 t) + exp(t)}
>
Allan Wittkopf
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Edgardo S. Cheb-Terrab"
To:
Subject: Laplace Transforms
Date: Fri, 24 Nov 2000 09:36:40 -0800
As follows,
Your ODEs:
> sys := diff(y(t),t)=2*y(t)-4*z(t), diff(z(t),t)=y(t)-3*z(t);
sys := y' = 2 y - 4 z, z' = y - 3 z
Your initial conditions:
> ics := y(0) = 3, z(0) = 0;
ics := y(0) = 3, z(0) = 0
Call directly the ODE (exact) solver:
> sol := dsolve({sys,ics});
sol := {y = 4 exp(t) - exp(-2 t), z = exp(t) - exp(-2 t)}
That's it. It is interesting to have in mind that you can test these solutions;
e.g. as follows
> odetest(sol,[sys]); # the solution cancels the ODE system
[0, 0]
> map(limit,sol,t=0); # and satisfy the given initial conditions
{y(0) = 3, z(0) = 0}
Hope this is of use,
Edgardo
___________________________________________________________________________
Edgardo S. Cheb-Terrab http://lie.uwaterloo.ca/ecterrab
Centre for Experimental and Constructive Mathematics SFU, Canada
Theoretical Physics Department UERJ,Brazil
___________________________________________________________________________
-- "Whoever has the most fun wins" --
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 27 Nov 2000 15:17:41 -0500
From: "Douglas B. Meade"
To:
Subject: Laplace Transforms
Dear MUG and George,
Here is my solution in Maple 6.01. In earlier versions is might be
necessary to explicitly load the transform package. This can be done
with the command:
> with( transform );
immediately after the restart command.
> restart;
>
> sys := { diff( y(t), t ) = 2*y(t) - 4*z(t),
> diff( z(t), t ) = y(t) - 3*z(t) };
d d
sys := {-- y(t) = 2 y(t) - 4 z(t), -- z(t) = y(t) - 3 z(t)}
dt dt
> ic := { y(0)=3, z(0)=0 };
ic := {y(0) = 3, z(0) = 0}
>
> soln := dsolve( sys union ic, {y(t),z(t)}, method=laplace );
soln := {y(t) = -exp(-2 t) + 4 exp(t), z(t) = -exp(-2 t) + exp(t)}
Note that the solution is a set of equations for the two components.
Several recent MUG postings have talked about working with sets. The
following commands provide two illustrations of the basic techniques for
working with Maple sets.
The individual components of this solution can be plotted as follows.
> plot( subs( soln, [y(t),z(t)] ), t=0..2 );
The two components of the solution can be obtained as Maple functions.
> Y := unapply( subs( soln, y(t) ), t );
Y := t -> -exp(-2 t) + 4 exp(t)
> Z := unapply( subs( soln, z(t) ), t );
Z := t -> -exp(-2 t) + exp(t)
I hope this answers your question and is of use to you.
Doug
-----------------------------------------------------------------------
Douglas B. Meade Phone: (803) 777-6183 FAX: (803) 777-6527
Department of Mathematics URL: http://www.math.sc.edu/~meade/
USC, Columbia, SC 29208 E-mail:
|
| [MUG] Re: Laplace Transforms |
|
Author: Robert Israel
Posted: 30/11/2000 22:50:49 GMT
|
>> From: Robert Israel
> des:= {diff(y(t),t) = 2*y(t)-4*z(t),diff(z(t),t)=y(t)-3*z(t)};
ics:= {y(0)=3,z(0)=0};
Then you can solve it in one step:
> dsolve(des union ics, {y(t),z(t)});
Or if you want to follow your steps using the Laplace transform:
> with(inttrans):
laplace(des,t,s);
subs(ics,%);
solve(%,{laplace(y(t),t,s),laplace(z(t),t,s)});
invlaplace(%,s,t);
{z(t) = exp(t) - exp(-2 t), y(t) = -exp(-2 t) + 4 exp(t)}
Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
On Thu, 23 Nov 2000, Chuck Baker wrote:
| I derived solutions by hand by first taking the Laplace transforms of
| the differential equations, then, I solved the simultaneous equations
| for Y(s) and Z(s). Finally, I determined the inverse transforms to
| develop the solution expressions y(t) and z(t).
|
| How can this process be written in Maple?
|
Previous by date: [MUG] Fourier series, Chuck Baker
Next by date: [MUG] Re: Numerical integration of functions with singularity, Robert Israel
Previous thread: [MUG] Is there a way to display x bar?, Larry Fasnacht
Next thread: [MUG] Numerical integration of functions with singularity, Arvind Raman
|