Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8190
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: NDSolve and DAEs |
| Date | 2012-01-26 08:34 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jfr36s$nkt$1@smc.vnet.net> (permalink) |
| References | <201201251204.HAA05991@smc.vnet.net> |
eqns = {
x1'[t] == x2[t],
x2'[t] == -x3[t] - x2[t],
x3'[t] == x2[t] x4[t],
x4'[t] == -x3[t] x2[t]};
ics = {x1[0] == 0.5, x2[0] == 0,
x3[0] == Sin[0.5], x4[0] == Cos[0.5]};
sol = NDSolve[Join[eqns, ics], {x1, x2, x3, x4}, {t, 0, 16}][[1]];
x3[0] x3[0] + x4[0] x4[0] == 1 /. sol
True
Plot[Evaluate[{
Tooltip[x1[t], "x1"],
Tooltip[x2[t], "x2"],
Tooltip[x3[t], "x3"],
Tooltip[x4[t], "x4"]} /. sol],
{t, 0, 16}]
Bob Hanlon
2012/1/25 J. Jes=FAs Rico Melgoza <jerico@umich.mx>:
> Hi everybody!
>
> I have the following DAE system:
>
> eqns = {x1'[t] == x2[t], x2'[t] == -x3[t] - x2[t],
>
x3'[t] == x2[t] x4[t],
>
x4'[t] == -x3[t] x2[t]}
> with initial conditions
>
> ics = {x1[0] == 0.5, x2[0] == 0, x3[0] == Sin[0.5],
>
x4[0] == Cos[0.5]}
> that must satisfy the following constraint
>
> x3[0]x3[0]+x4[0]x4[0]=1
> The interval of time is {t,0,16}.
>
> I do not know how to do it with NDSolve.
> Can this be done? in some part of the documentation there is an example
> where the enqs are linear but the same procedure applied to my problem
> (nonlinear) wouldn't work.
>
> I will appreciate any help.
> Thanks in advance.
>
> Best regards
> Jesus Rico-Melgoza
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: NDSolve and DAEs Bob Hanlon <hanlonr357@gmail.com> - 2012-01-26 08:34 +0000
csiph-web