       Re: system of differential equations mathematica help

• To: mathgroup at smc.vnet.net
• Subject: [mg129375] Re: system of differential equations mathematica help
• From: Oliver Ruebenkoenig <ruebenko at wolfram.com>
• Date: Tue, 8 Jan 2013 23:39:45 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20130108040741.0BBB568CC@smc.vnet.net>

```
On Mon, 7 Jan 2013, 01af wrote:

> Before anyone starts to type: I have read the top post on a similar matter, but the reply makes no sense to me so if anyone can give my issue a read through I would be grateful. Thanks.
>
> ok I am modelling airflow in the upper airway for application i obstructive sleep apnoea, but I have hit a brick wall with mathematica. I have a system of 3 differential equations with boundary conditions, and I need to solve to find 3 unknown functions numerically so that they may be plotted in various graphs.
>
> The equations are as follows:
>
> D[a[x]*u[x], x] == 0,
> u[x] u'[x] == -p'[x],
> p[x] - 1 == 2 (1 - ((a[x])^(-3/2))) - 50 (a''[x]).
>
> with boundary conditions:
>
> u == 0.1, a == 1, a == 1, p == 1.
>
> so initially I tried to use NDSolve like so..
>
> Code:
>
> NDSolve[{D[a[x]*u[x], x] == 0, u[x] u'[x] == -p'[x],
>  p[x] - 1 == 2 (1 - ((a[x])^(-3/2))) - 50 (a''[x]), u == 0.1,
>  a == 1, a == 1, p == 1}, {a}, {x, 0, 10}]
>
> but mathematica does this:
>
> Code:
>
> Power::infy: "Infinite expression 1/0.^(3/2) encountered. "
> Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>
> Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered. >>
> General::stop: Further output of Infinity::indet will be suppressed during this calculation. >>
> NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.`. >>
>
> which is super annoying, any pointers as to where I'm going wrong would be great. I'm not even sure if I should be using NDSolve so let me know what you think.
> a.
>
>

Hi 01af,

to be quite honest I did not see what the issue was and had to resort
asking colleagues myself. What you can do is:

NDSolve[{D[a[x]*u[x], x] == 0, u[x] u'[x] == -p'[x],
p[x] - 1 == 2 (1 - ((a[x])^(-3/2))) - 50 (a''[x]), u == 0.1,
a == 1, a == 1, p == 1}, {a}, {x, 0, 10},
Method -> {"BoundaryValues" -> {"Shooting",
"StartingInitialConditions" -> {a == 1, a' == 0, p == 0,
u == .1}}}]

The issue is that the default starting conditions produce singularities -
so I filed this as a suggestion for future improvement that in such a case
other starting conditions are attempted.

Hope this helps,

Oliver

```

• Prev by Date: Re: Cursor position on images