List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Re: Laplace Transforms
| [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:
|
[View Complete Thread]
Previous by date: [MUG] Re: Plot and Graphic Sizes, Theodore Kolokolnikov
Next by date: [MUG] Re: Maple and mechanics of deformable bodies, Maple Group
Previous thread: [MUG] Integration bug, i think, Halvor Mehlum
Next thread: [MUG] Maple and mechanics of deformable bodies, Guy Gendron
|