Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Compute consistent initial conditions for `ode15i`

```
[y0_new,yp0_new]
= decic(odefun,t0,y0,fixed_y0,yp0,fixed_yp0)
```

```
[y0_new,yp0_new]
= decic(odefun,t0,y0,fixed_y0,yp0,fixed_yp0,options)
```

```
[y0_new,yp0_new,resnrm]
= decic(___)
```

`[`

uses `y0_new`

,`yp0_new`

]
= decic(`odefun`

,`t0`

,`y0`

,`fixed_y0`

,`yp0`

,`fixed_yp0`

)`y0`

and `yp0`

as
guesses for the initial conditions of the fully implicit function `odefun`

,
holds the components specified by `fixed_y0`

and `fixed_yp0`

as
fixed, then computes values for the nonfixed components. The result
is a complete set of consistent initial conditions. The new values `yo_new`

and `yp0_new`

satisfy ```
odefun(t0,y0_new,yp0_new)
= 0
```

and are suitable to be used as initial conditions with `ode15i`

.

The

`ihb1dae`

and`iburgersode`

example files use`decic`

to compute consistent initial conditions before solving with`ode15i`

. Type`edit ihb1dae`

or`edit iburgersode`

to view the code.You can additionally use

`decic`

to compute consistent initial conditions for DAEs solved by`ode15s`

or`ode23t`

. To do this, follow these steps.Rewrite the system of equations in fully implicit form

`f(t,y,y') = 0`

.Call

`decic`

to compute consistent initial conditions for the equations.Specify

`y0_new`

as the initial condition in the call to the solver, and specify`yp_new`

as the value of the`InitialSlope`

option of`odeset`

.

Was this topic helpful?