nlsrk (version 1.1)

dfdt: Right Side of a first order ODE

Description

Gives the value of the right side of a first order Ordinary Differential Equation Used in frunge (Numeric resolution using Runge-Kutta 4 metthod)

Usage

dfdt(t, y, param)

Arguments

t

time, independent variable

y

values of the unknown function at t

param

numeric vector : the set of parameters defining the function

Value

a single float numeric value : the derivative of the unknown function at time t.

Details

the unique expression composing the body of dfdt is intended as the right side of the first order differential equation :

$$ \frac{dy}{dt} = dfdt(t,y,param)$$

The function body has to be written by the user. param must take the form c(param1,param2,param3). if the initial value (y0) is used as a parameter (for model fitting for instance), it must be the last in the list and not used in dfdt.

References

Any textbook in mathematics

See Also

frunge, nls

Examples

Run this code
## Solves and draws the logistic function using default dfdt as provided in the package	

	frunge(t=10, param=c(r=0.1,k=100), y0=3, Dfdt = dfdt, dt = 0.01, graph = TRUE)

Run the code above in your browser using DataCamp Workspace