# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentialequation.ode.ivp.problem

## Class ODE1stOrder

• java.lang.Object
• com.numericalmethod.suanshu.analysis.differentialequation.ode.ivp.problem.ODE1stOrder
• Direct Known Subclasses:
ODE1stOrderWith2ndDerivative

public class ODE1stOrder
extends Object
A first order ordinary differential equation (ODE) initial value problem (IVP) takes the following form. $y' = f(x, y) \\ y(x_0) = y_0$ where y0 is known, and the solution of the problem is y(x) for the integrating interval [x0, x1].
Wikipedia: Ordinary differential equation
• ### Constructor Summary

Constructors
Constructor and Description
ODE1stOrder(DerivativeFunction dy, Vector y0, double x0, double x1)
Constructs a first order ODE with the given vector-valued function and its initial values.
ODE1stOrder(ODE ode)
Reduces a high order ODE to a system of first order ODEs.
ODE1stOrder(RealScalarFunction[] Y, double[] y0, double x0, double x1)
Constructs a system of first order ODEs {Yi} with their initial values {yi0}.
ODE1stOrder(RealVectorFunction F, Vector y0, double x0, double x1)
Constructs a first order ODE with the given vector-valued function and its initial values.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static DerivativeFunction convertToDerivativeFunction(RealVectorFunction F, int dimension)
Converts the given vector function to a first order derivative function.
int dimension()
Gets the dimension of y.
DerivativeFunction dy()
Gets the first order derivative function.
double x0()
Gets the start point of the integrating interval [x0, x1].
double x1()
Gets the end point of the integrating interval [x0, x1].
Vector y0()
Gets the initial value of y, that is, y0.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### ODE1stOrder

public ODE1stOrder(DerivativeFunction dy,
Vector y0,
double x0,
double x1)
Constructs a first order ODE with the given vector-valued function and its initial values.
Parameters:
dy - the first order derivative function y' = F(x, y)
y0 - y0
x0 - the start point of the integrating interval [x0, x1]
x1 - the end point of the integrating interval [x0, x1]
• #### ODE1stOrder

public ODE1stOrder(RealScalarFunction[] Y,
double[] y0,
double x0,
double x1)
Constructs a system of first order ODEs {Yi} with their initial values {yi0}. $y_1' = Y_1(x, y_1, y_2, y_3, ...), y_1(0) = y_{10}\\ y_2' = Y_2(x, y_1, y_2, y_3, ...), y_2(0) = y_{20}\\ y_3' = Y_3(x, y_1, y_2, y_3, ...), y_3(0) = y_{30}\\ ...$
Parameters:
Y - the differentials, {Yi}
y0 - the initial values, {yi(0)}
x0 - the start point of the integrating interval [x0, x1]
x1 - the end point of the integrating interval [x0, x1]
• #### ODE1stOrder

public ODE1stOrder(RealVectorFunction F,
Vector y0,
double x0,
double x1)
Constructs a first order ODE with the given vector-valued function and its initial values.
Parameters:
F - F(x, y) = y'
y0 - y0
x0 - the start point of the integrating interval [x0, x1]
x1 - the end point of the integrating interval [x0, x1]
• #### ODE1stOrder

public ODE1stOrder(ODE ode)
Reduces a high order ODE to a system of first order ODEs.
Parameters:
ode - the high order ODE
Wikipedia: Reduction to a first order system
• ### Method Detail

• #### convertToDerivativeFunction

public static DerivativeFunction convertToDerivativeFunction(RealVectorFunction F,
int dimension)
Converts the given vector function to a first order derivative function.
Parameters:
F - the vector-valued function F(x, y1, ..., yn)
dimension - the dimension of the derivative function
Returns:
the converted first order derivative function
• #### dy

public DerivativeFunction dy()
Gets the first order derivative function.
Returns:
the first order derivative function
• #### dimension

public int dimension()
Gets the dimension of y.
Returns:
the dimension of y
• #### y0

public Vector y0()
Gets the initial value of y, that is, y0.
Returns:
y0
• #### x0

public double x0()
Gets the start point of the integrating interval [x0, x1].
Returns:
x0
• #### x1

public double x1()
Gets the end point of the integrating interval [x0, x1].
Returns:
x1