odeΒΆ

ode computes the solution of ordinary differential equation of the first order.

rvX = ode(f, x_0, t_out)

Return Value

rvX is the solution vector.

Parameters

f

f is a function provided by the user (see example).

x_0

x_0 is a column vector with the start conditions.

t_out

t_out is a vector with data points for which the solution of the differential equation is computed.

Example

def y_dot (y, t)
{
    return sin(t) .* sin(t) - 3 * y;
}
y = ode(y_dot, 0, t = linspace(0,3,30)');
plot(t, y)

id-1565148