       Re: Some problems with DSolve and NDSolve

• To: mathgroup at smc.vnet.net
• Subject: [mg19770] Re: Some problems with DSolve and NDSolve
• From: Eckhard Hennig <hennig at itwm.uni-kl.de>
• Date: Fri, 17 Sep 1999 01:36:33 -0400
• Organization: ITWM
• References: <7rnjb1\$ejs@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

>Hi MathGroupers,
>
>I was somewhat surprised that DSolve is unable to solve the following
>relatively innocuous system of 1st-order ODEs:
>
>DSolve[{2 i1[t] + 2 (i1'[t] - i2'[t]) == 80 t E^(-2t), 4 i2[t] + 2 (i2'[t]
>- i1'[t]) == 0, i1 == 0, i2 == 0}, {i1[t],i2[t]}, t]
>
>The normally reliable NDSolve also falls down on the following:
>
>NDSolve[{2 i1[t] + 2(i1'[t] - i2'[t]) == 80 t E^(-2t), 4 i2[t] + 2(i2'[t] -
>i1'[t]) == 0, i1 == 0, i2 == 0}, {i1[t], i2[t]}, {t, 0, 1}]
>
>What is wrong?

The problem is that NDSolve can handle only explicit systems of differential
equations, i.e. ODE's of the form

(x1', x2', ..., xn') == f(x1, x2, ..., xn),

but your equations are given in implicit form:

f(x1, x2, ..., xn, x1', x2', ..., xn') == 0

To solve your equations, you either have to rewrite them in explicit form or
use a solver for differential-algebraic equations (DAE's). You may want to
check out the function NDAESolve, which is included in the circuit analysis
toolbox Analog Insydes (a free evaluation version is available on the web;
see my signature).

In:=

In:=
sol = NDAESolve[{{2 i1[t] + 2(i1'[t] - i2'[t]) == 80 t E^(-2t),
4 i2[t] + 2(i2'[t] - i1'[t]) == 0}, {i1[t], i2[t]}},
{t, 0, 1},InitialSolution->{i1->0,i2->0}]
Out=
{{i1->InterpolatingFunction[{{0,1.00137}},"<>"],
i2->InterpolatingFunction[{{0,1.00137}},"<>"]}}

In:=
TransientPlot[sol,{i1[t],i2[t]},{t,0,1}]

-- Eckhard

-----------------------------------------------------------
Dipl.-Ing. Eckhard Hennig      mailto:hennig at itwm.uni-kl.de
Institut fuer Techno- und Wirtschaftsmathematik e.V. (ITWM)
Erwin-Schroedinger-Strasse,  67663 Kaiserslautern,  Germany
Voice: +49-(0)631-205-3126    Fax: +49-(0)631-205-4139
http://www.itwm.uni-kl.de/as/employees/hennig.html

ITWM - Makers of Analog Insydes for Mathematica
http://www.itwm.uni-kl.de/as/products/ai
-----------------------------------------------------------

• Prev by Date: Re: simple Simplify[] question
• Next by Date: AxesLabel touches the y-Axis
• Previous by thread: Re: Some problems with DSolve and NDSolve
• Next by thread: Re: Some problems with DSolve and NDSolve