Re: 2nd order differential equation help
- To: mathgroup at smc.vnet.net
- Subject: [mg31525] Re: 2nd order differential equation help
- From: BobHanlon at aol.com
- Date: Fri, 9 Nov 2001 06:13:28 -0500 (EST)
- Approved: Steven M. Christensen <steve@smc.vnet.net>, Moderator
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/11/7 7:48:34 AM, peterangelo at mindspring.com writes:
>actly how do I get this into a form Mathamatica will accept? It has
>been a number of years since enrolling in diffeq, however I think I am
>close to correct but would appreciate help.
>
>the problem;
>
>Solve the differential equation:
>
>g''(t) + 0.1 g'(t) + g(t) = 0
>
>where the previous equation uses conventional mathematical notation.
>You must transfrom the equation and initial conditions into
>Mathematica syntax.
>
>for t between 0 and 10 Pi
>
>subject to the initial conditions
> g(0) = 0,
> g'(0) = 1
>
>Plot your results.
>
>My attempt is as follows:
>
>
>Clear[g]
>
>Clear[eqn]
>
>eqn[t_] = g''[t] + 0.1g'[t] + g[t] == 0
>
>
>Clear[eqn1]
>
>eqn1[t_] = g'[t] + 0.1g[t] + ?g[t] == 0
>
>solution = DSolve[{eqn[t], eqn1[t]}, g'[0] == 1,
>g[0] == 0, g[t], {t, 0, 10\[Pi]}]
>
>DSolve::dsvar: g[0]==0 cannot be used as a variable.
>
>what am I dont doing right? any suggestions helpful
>
Clear[g];
g[t] /. DSolve[{g''[t]+g'[t]/10+g[t]==0,
g[0] == 0, g'[0] == 1},
g[t], t][[1]]
(10*I*(E^((1/20)*(-1 - I*Sqrt[399])*
t) - E^((1/20)*(-1 +
I*Sqrt[399])*t)))/Sqrt[399]
ExpToTrig [%]
(10*I*Cosh[(1/20)*(-1 -
I*Sqrt[399])*t])/Sqrt[399] -
(10*I*Cosh[(1/20)*(-1 +
I*Sqrt[399])*t])/Sqrt[399] +
(10*I*Sinh[(1/20)*(-1 -
I*Sqrt[399])*t])/Sqrt[399] -
(10*I*Sinh[(1/20)*(-1 +
I*Sqrt[399])*t])/Sqrt[399]
FullSimplify[%]
(20*Sin[(Sqrt[399]*t)/20])/
(E^(t/20)*Sqrt[399])
Consolidating these steps into a definition for g[t]
g[t_] :=
Evaluate[FullSimplify[
ExpToTrig[g[t] /.
DSolve[{g''[t]+g'[t]/10+g[t]==0,
g[0] == 0, g'[0] == 1},
g[t], t][[1]]]]];
Checking
g''[t]+g'[t]/10+g[t] == 0 // Simplify
True
Plot[g[t], {t, 0, 10Pi}];
Bob Hanlon
Chantilly, VA USA