How to do it...

Some parameters are included in the following tables; we need to execute them:

  1. Get the function accordingly
  2. Name the following parameters
  3. Execute it
  4. Get the solution
Parameters

func: callable(y, t0, ...). This computes the derivative of y at t0.

y0: Array. The initial condition on y (can be a vector).

t: Array. A sequence of time points for which to solve for y. The initial value point should be the first element of this sequence.

args: Tuple, optional. Extra arguments to pass to the function.

Dfun: callable(y, t0, ...). The gradient (Jacobian) of func.

col_deriv: bool, optional. True if Dfun defines derivatives down columns (faster); otherwise Dfun should define derivatives across rows.

full_output: bool, optional. True if to return a dictionary of optional outputs as the second output

printmessg: bool, optional. It denotes whether to print the convergence message or not.

Returns

y: Array, shape (len(t), len(y0)). An array containing the value of y for each desired time in t, with the initial value y0 in the first row.

infodict: dict; this is returned only if full_output == True.

 

We have some additional information in terms of the output, which is mostly self explanatory. You will love to know about it. Please refer to the following:

Key

Meaning

hu

Vector of step sizes successfully used for each time step.

tcur

Vector with the value of t reached for each time step. Will always be at least as large as the input times.

tolsf

Vector of tolerance scale factors, greater than 1.0, computed when a request for too much accuracy was detected.

tsw

Value of t at the time of the last method switch (given for each time step).

nst

Cumulative number of time steps.

nfe

Cumulative number of function evaluations for each time step.

nje

Cumulative number of Jacobian evaluations for each time step.

nqu

A vector of method orders for each successful step.

imxer

Index of the component of largest magnitude in the weighted local error vector (e / ewt) on an error return; it is -1 otherwise.

lenrw

The length of the double work array required.

leniw

The length of integer work array required.

mused

A vector of method indicators for each successful time step: 1: adams (nonstiff), 2: bdf (stiff).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset