BVP Problems
SciMLBase.BVProblem — TypeDefines an BVP problem. Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/bvp_types/
Mathematical Specification of a BVP Problem
To define a BVP Problem, you simply need to give the function $f$ and the initial condition $u_0$ which define an ODE:
\[\frac{du}{dt} = f(u,p,t)\]
along with an implicit function bc which defines the residual equation, where
\[bc(u,p,t) = 0\]
is the manifold on which the solution must live. A common form for this is the two-point BVProblem where the manifold defines the solution at two points:
\[u(t_0) = a u(t_f) = b\]
Problem Type
Constructors
TwoPointBVProblem{isinplace}(f, bc, u0, tspan, p=NullParameters(); kwargs...)
BVProblem{isinplace}(f, bc, u0, tspan, p=NullParameters(); kwargs...)or if we have an initial guess function initialGuess(p, t) for the given BVP, we can pass the initial guess to the problem constructors:
TwoPointBVProblem{isinplace}(f, bc, initialGuess, tspan, p=NullParameters(); kwargs...)
BVProblem{isinplace}(f, bc, initialGuess, tspan, p=NullParameters(); kwargs...)For any BVP problem type, bc must be inplace if f is inplace. Otherwise it must be out-of-place.
If the bvp is a StandardBVProblem (also known as a Multi-Point BV Problem) it must define either of the following functions
bc!(residual, u, p, t)
residual = bc(u, p, t)where residual computed from the current u. u is an array of solution values where u[i] is at time t[i], while p are the parameters. For a TwoPointBVProblem, t = tspan. For the more general BVProblem, u can be all of the internal time points, and for shooting type methods u=sol the ODE solution. Note that all features of the ODESolution are present in this form. In both cases, the size of the residual matches the size of the initial condition.
If the bvp is a TwoPointBVProblem then bc must be a Tuple (bca, bcb) and each of them must define either of the following functions:
begin
bca!(resid_a, u_a, p)
bcb!(resid_b, u_b, p)
end
begin
resid_a = bca(u_a, p)
resid_b = bcb(u_b, p)
endwhere resid_a and resid_b are the residuals at the two endpoints, u_a and u_b are the solution values at the two endpoints, and p are the parameters.
Parameters are optional, and if not given, then a NullParameters() singleton will be used which will throw nice errors if you try to index non-existent parameters. Any extra keyword arguments are passed on to the solvers. For example, if you set a callback in the problem, then that callback will be added in every solve call.
Fields
f: The function for the ODE.bc: The boundary condition function.u0: The initial condition. Either the initial condition for the ODE as an initial value problem, or aVectorof values for $u(t_i)$ for collocation methods.tspan: The timespan for the problem.p: The parameters for the problem. Defaults toNullParameterskwargs: The keyword arguments passed onto the solves.
Special Keyword Arguments
nlls: Specify that the BVP is a nonlinear least squares problem. UseVal(true)orVal(false)for type stability. By default this is automatically inferred based on the size of the input and outputs, however this is type unstable for any array type that doesn't store array size as part of type information. If we can't reliably infer this, we set it toNothing. Downstreams solvers must be setup to deal with this case.
SciMLBase.SecondOrderBVProblem — TypeDefines a second order BVP problem. Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/bvp_types/
Mathematical Specification of a second order BVP Problem
To define a second order BVP Problem, you simply need to give the function $f$ and the initial condition $u_0$ which define an ODE:
\[\frac{ddu}{dt} = f(du,u,p,t)\]
along with an implicit function bc which defines the residual equation, where
\[bc(du,u,p,t) = 0\]
is the manifold on which the solution must live. A common form for this is the two-point SecondOrderBVProblem where the manifold defines the solution at two points:
\[g(u(t_0),u'(t_0)) = 0 g(u(t_f),u'(t_f)) = 0\]
Problem Type
Constructors
TwoPointSecondOrderBVProblem{isinplace}(f, bc, u0, tspan, p=NullParameters(); kwargs...)
SecondOrderBVProblem{isinplace}(f, bc, u0, tspan, p=NullParameters(); kwargs...)or if we have an initial guess function initialGuess(p, t) for the given BVP, we can pass the initial guess to the problem constructors:
TwoPointSecondOrderBVProblem{isinplace}(f, bc, initialGuess, tspan, p=NullParameters(); kwargs...)
SecondOrderBVProblem{isinplace}(f, bc, initialGuess, tspan, p=NullParameters(); kwargs...)For any BVP problem type, bc must be inplace if f is inplace. Otherwise it must be out-of-place.
If the bvp is a StandardSecondOrderBVProblem (also known as a Multi-Point BV Problem) it must define either of the following functions
bc!(residual, du, u, p, t)
residual = bc(du, u, p, t)where residual computed from the current u. u is an array of solution values where u[i] is at time t[i], while p are the parameters. For a TwoPointBVProblem, t = tspan. For the more general BVProblem, u can be all of the internal time points, and for shooting type methods u=sol the ODE solution. Note that all features of the ODESolution are present in this form. In both cases, the size of the residual matches the size of the initial condition.
If the bvp is a TwoPointSecondOrderBVProblem then bc must be a Tuple (bca, bcb) and each of them must define either of the following functions:
begin
bca!(resid_a, du_a, u_a, p)
bcb!(resid_b, du_b, u_b, p)
end
begin
resid_a = bca(du_a, u_a, p)
resid_b = bcb(du_b, u_b, p)
endwhere resid_a and resid_b are the residuals at the two endpoints, u_a and u_b are the solution values at the two endpoints, du_a and du_b are the derivative of solution values at the two endpoints, and p are the parameters.
Parameters are optional, and if not given, then a NullParameters() singleton will be used which will throw nice errors if you try to index non-existent parameters. Any extra keyword arguments are passed on to the solvers. For example, if you set a callback in the problem, then that callback will be added in every solve call.
Fields
f: The function for the ODE.bc: The boundary condition function.u0: The initial condition. Either the initial condition for the ODE as an initial value problem, or aVectorof values for $u(t_i)$ for collocation methods.tspan: The timespan for the problem.p: The parameters for the problem. Defaults toNullParameterskwargs: The keyword arguments passed onto the solves.
SciMLBase.BVPFunction — TypeDocStringExtensions.TypeDefinition()
A representation of a BVP function f, defined by:
\[\frac{du}{dt} = f(u, p, t)\]
and the constraints:
\[g(u, p, t) = 0\]
If the size of g(u, p, t) is different from the size of u, then the constraints are interpreted as a least squares problem, i.e. the objective function is:
\[\min_{u} \| g_i(u, p, t) \|^2\]
and all of its related functions, such as the Jacobian of f, its gradient with respect to time, and more. For all cases, u0 is the initial condition, p are the parameters, and t is the independent variable.
BVPFunction{iip, specialize}(f, bc;
cost = __has_cost(f) ? f.cost : nothing,
equality = __has_equality(f) ? f.equality : nothing,
inequality = __has_inequality(f) ? f.inequality : nothing,
f_prototype = __has_f_prototype(f) ? f.f_prototype : nothing,
mass_matrix = __has_mass_matrix(f) ? f.mass_matrix : I,
analytic = __has_analytic(f) ? f.analytic : nothing,
tgrad= __has_tgrad(f) ? f.tgrad : nothing,
jac = __has_jac(f) ? f.jac : nothing,
bcjac = __has_jac(bc) ? bc.jac : nothing,
jvp = __has_jvp(f) ? f.jvp : nothing,
vjp = __has_vjp(f) ? f.vjp : nothing,
jac_prototype = __has_jac_prototype(f) ? f.jac_prototype : nothing,
bcjac_prototype = __has_jac_prototype(bc) ? bc.jac_prototype : nothing,
sparsity = __has_sparsity(f) ? f.sparsity : jac_prototype,
paramjac = __has_paramjac(f) ? f.paramjac : nothing,
syms = nothing,
indepsym= nothing,
paramsyms = nothing,
colorvec = __has_colorvec(f) ? f.colorvec : nothing,
bccolorvec = __has_colorvec(f) ? bc.colorvec : nothing,
sys = __has_sys(f) ? f.sys : nothing,
twopoint::Union{Val, Bool} = Val(false))Note that both the function f and boundary condition bc are required. f should be given as f(du,u,p,t) or out = f(u,p,t). bc should be given as bc(res, u, p, t). See the section on iip for more details on in-place vs out-of-place handling.
All of the remaining functions are optional for improving or accelerating the usage of f and bc. These include:
cost(u, p): the target to be minimized, similar with thecostfunction inOptimizationFunction. This is used to define the objective function of the BVP, which can be minimized by optimization solvers.equality(res, u, t): equality constraints functions for the BVP.inequality(res, u, t): inequality constraints functions for the BVP.f_prototype: a prototype matrix matching the type of the ODE/DAE variables in an optimal control problem. For example, in the ODE/DAE that describe the dynamics of the optiml control problem,f_prototypeshould match the type and size of the ODE/DAE variables inf.mass_matrix: the mass matrixMrepresented in the BVP function. Can be used to determine that the equation is actually a BVP for differential algebraic equation (DAE) ifMis singular.analytic(u0,p,t): used to pass an analytical solution function for the analytical solution of the BVP. Generally only used for testing and development of the solvers.tgrad(dT,u,h,p,t)or dT=tgrad(u,p,t): returns $\frac{\partial f(u,p,t)}{\partial t}$jac(J,du,u,p,gamma,t)orJ=jac(du,u,p,gamma,t): returns $\frac{df}{du}$bcjac(J,du,u,p,gamma,t)orJ=jac(du,u,p,gamma,t): returns $\frac{dbc}{du}$jvp(Jv,v,du,u,p,gamma,t)orJv=jvp(v,du,u,p,gamma,t): returns the directional derivative $\frac{df}{du} v$vjp(Jv,v,du,u,p,gamma,t)orJv=vjp(v,du,u,p,gamma,t): returns the adjoint derivative $\frac{df}{du}^\ast v$jac_prototype: a prototype matrix matching the type that matches the Jacobian. For example, if the Jacobian is tridiagonal, then an appropriately sizedTridiagonalmatrix can be used as the prototype and integrators will specialize on this structure where possible. Non-structured sparsity patterns should use aSparseMatrixCSCwith a correct sparsity pattern for the Jacobian. The default isnothing, which means a dense Jacobian.bcjac_prototype: a prototype matrix matching the type that matches the Jacobian. For example, if the Jacobian is tridiagonal, then an appropriately sizedTridiagonalmatrix can be used as the prototype and integrators will specialize on this structure where possible. Non-structured sparsity patterns should use aSparseMatrixCSCwith a correct sparsity pattern for the Jacobian. The default isnothing, which means a dense Jacobian.paramjac(pJ,u,p,t): returns the parameter Jacobian $\frac{df}{dp}$.colorvec: a color vector according to the SparseDiffTools.jl definition for the sparsity pattern of thejac_prototype. This specializes the Jacobian construction when using finite differences and automatic differentiation to be computed in an accelerated manner based on the sparsity pattern. Defaults tonothing, which means a color vector will be internally computed on demand when required. The cost of this operation is highly dependent on the sparsity pattern.bccolorvec: a color vector according to the SparseDiffTools.jl definition for the sparsity pattern of thebcjac_prototype. This specializes the Jacobian construction when using finite differences and automatic differentiation to be computed in an accelerated manner based on the sparsity pattern. Defaults tonothing, which means a color vector will be internally computed on demand when required. The cost of this operation is highly dependent on the sparsity pattern.
Additional Options:
twopoint: Specify that the BVP is a two-point boundary value problem. UseVal(true)orVal(false)for type stability.
iip: In-Place vs Out-Of-Place
For more details on this argument, see the ODEFunction documentation.
specialize: Controlling Compilation and Specialization
For more details on this argument, see the ODEFunction documentation.
Fields
The fields of the BVPFunction type directly match the names of the inputs.
Solution Type
BVProblem solutions return an ODESolution. For more information, see the ODE problem definition page for the ODESolution docstring.
Alias Specifier
SciMLBase.BVPAliasSpecifier — TypeBVPAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = nothing, alias_du0 = nothing, alias_tstops = nothing, alias = nothing)Holds information on what variables to alias when solving an BVP. Conforms to the AbstractAliasSpecifier interface.
When a keyword argument is nothing, the default behaviour of the solver is used.
Keywords
alias_p::Union{Bool, Nothing}alias_f::Union{Bool, Nothing}alias_u0::Union{Bool, Nothing}: alias the u0 array. Defaults to false .alias_du0::Union{Bool, Nothing}: alias the du0 array for DAEs. Defaults to false.alias_tstops::Union{Bool, Nothing}: alias the tstops arrayalias::Union{Bool, Nothing}: sets all fields of theBVPAliasSpecifiertoalias
Example Problems
Example problems can be found in DiffEqProblemLibrary.jl.
To use a sample problem, such as prob_bvp_linear_1, you can do something like:
#] add DiffEqProblemLibrary
import DiffEqProblemLibrary.BVProblemLibrary
import BoundaryValueDiffEq as BVP
# load problems
prob = BVProblemLibrary.prob_bvp_linear_1
sol = solve(prob, BVP.MIRK4(), dt = 0.05)Linear BVPs
BVProblemLibrary.prob_bvp_linear_1 — Constantprob_bvp_linear_1Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=0\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \frac{\exp(-t/\sqrt{\lambda}) - \exp((t-2)/\sqrt{\lambda})}{1-\exp(-2/\sqrt{\lambda})}\]
\[y_2(t)=y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_2 — Constantprob_bvp_linear_2Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}y_2\]
with boundary condition
\[y_1(0)=1, y_1(1)=0\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \frac{1-\exp((t-1)/\lambda)}{1-\exp(-1/\lambda)}\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_3 — Constantprob_bvp_linear_3Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2)\]
where
\[f(t, y_1, y_2) = -(2+\cos(\pi t))y_2 + y_1 -(1+\lambda \pi^2)\cos(\pi t) - (2+\cos(\pi t))\pi\sin(\pi t)\]
with boundary condition
\[y_1(-1)=-1, y_1(1)=-1\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_4 — Constantprob_bvp_linear_4Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y2+(1+\lambda)y1\]
with boundary condition
\[y_1(-1)=1+\exp(-2), y_1(1)=1+\exp(-2(1+\lambda))\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \exp(t-1)+\exp(-(1+\lambda)(1+t)/\lambda)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_5 — Constantprob_bvp_linear_5Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2)\]
where
\[f(t, y_1, y_2)=ty_2+y_1-(1+\lambda\pi^2)\cos(\pi t)+\pi t\sin(\pi t)\]
with boundary condition
\[y_1(-1)=-1, y_1(1)=-1\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_6 — Constantprob_bvp_linear_6Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_2)\]
where
\[f(t, y_2)=ty_2 - \lambda\pi^2\cos(\pi t)-\pi t\sin(\pi t)\]
with boundary condition
\[y_1(-1)=-2, y_1(1)=0\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t) + \erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda})\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_7 — Constantprob_bvp_linear_7Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1, y_2)\]
where
\[f(t, y_1, y_2)=ty_2+y_1-(1+\lambda\pi^2)\cos(\pi t)+\pi t\sin(\pi t)\]
with boundary condition
\[y_1(-1)=-1, y_1(1)=1\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t) + t + \frac{t\erf(t/\sqrt{2\lambda}) + \sqrt{2\lambda/\pi}\exp(-t^2/2\lambda)}{}\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_8 — Constantprob_bvp_linear_8Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2\]
with boundary condition
\[y_1(0)=1, y_1(1)=2\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = (2-\exp(-1/\lambda)-\exp(-t/\lambda))/(1-\exp(-1/\lambda))\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_9 — Constantprob_bvp_linear_9Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda+t^2}f(t, y_1, y_2)\]
where
\[f(t, y_1, y_2)=-4ty_2 - 2y_1\]
with boundary condition
\[y_1(-1)=1/(1+\lambda), y_1(1)=1/(1+\lambda)\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = 1/(\lambda+t^2)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_10 — Constantprob_bvp_linear_10Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_2)\]
where
\[f(t, y_2)=-ty_2\]
with boundary condition
\[y_1(-1)=0, y_1(1)=2\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = 1+\erf(t/\sqrt{2\lambda})/\erf(1/\sqrt{2\lambda})\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_11 — Constantprob_bvp_linear_11Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1)\]
where
\[f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t)\]
with boundary condition
\[y_1(-1)=0, y_1(1)=2\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_12 — Constantprob_bvp_linear_12Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1)\]
where
\[f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t)\]
with boundary condition
\[y_1(-1)=-1, y_1(1)=0\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)+\frac{\exp((t+1)/\sqrt{\lambda})-\exp((-t-1))/\sqrt{\lambda}}{\exp(2/\sqrt{\lambda})-\exp(-2/\sqrt{\lambda})}\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_13 — Constantprob_bvp_linear_13Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1)\]
where
\[f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t)\]
with boundary condition
\[y_1(-1)=0, y_1(1)=-1\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)+\exp(-(t+1)/\sqrt{\lambda})\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_14 — Constantprob_bvp_linear_14Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1)\]
where
\[f(t, y_1)=y_1-(1+\lambda\pi^2)\cos(\pi t)\]
with boundary condition
\[y_1(-1)=\exp(-2/\sqrt{\lambda}, y_1(1)=\exp(-2/\sqrt{\lambda})\]
Solution
The analytical solution for $t \in [-1, 1]$ is
\[y_1(t) = \cos(\pi t)+\exp((t-1)/\sqrt{\lambda})+\exp(-(t+1)/\sqrt{\lambda})\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_15 — Constantprob_bvp_linear_15Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(t, y_1)\]
where
\[f(t, y_1)=ty_1\]
with boundary condition
\[y_1(-1)=1, y_1(1)=1\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_linear_16 — Constantprob_bvp_linear_16Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda^2}f(y_1)\]
where
\[f(t, y_1)=-π^2y_1/4\]
with boundary condition
\[y_1(0)=0, y_1(1)=\sin(\pi/(2*\lambda))\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \sin(\pi t/2\lambda) when 1/\lambda is odd\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_17 — Constantprob_bvp_linear_17Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = f(y_1)\]
where
\[f(t, y_1)=-3\lambda y_1/(\lambda+t^2)^2\]
with boundary condition
\[y_1(-0.1)=-0.1/\sqrt{\lambda+0.01}, y_1(0.1)=0.1/\sqrt{\lambda+0.01}\]
Solution
The analytical solution for $t \in [-0.1, 0.1]$ is
\[y_1(t) = t/\sqrt{\lambda+t^2}\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_linear_18 — Constantprob_bvp_linear_18Linear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2\]
where
\[f(y_2)=-y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01}\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \exp(-t/\lambda)\]
\[y_2(t) = y_1'(t)\]
References
Nonlinear BVPs
BVProblemLibrary.prob_bvp_nonlinear_1 — Constantprob_bvp_nonlinear_1Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}y_2\]
where
\[f(y_2)=-y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=0.1/\sqrt{\lambda+0.01}\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \exp(-t/\lambda)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_nonlinear_2 — Constantprob_bvp_nonlinear_2Nonlinear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_2)\]
where
\[f(y_2)=--y_2^2+1\]
with boundary condition
\[y_1(0)=1+\lambda\ln\cosh(-0.745/\lambda), y_1(1)=1+\lambda\ln\cosh(0.255/\lambda)\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = 1+\lambda\ln\cosh((t-0.745)/\lambda)\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_nonlinear_3 — Constantprob_bvp_nonlinear_3Nonlinear boundary value problem with analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y, y_1)\]
where
\[f(y_1)=y_1+y_1^2-\exp(-2t/\sqrt{\lambda})\]
with boundary condition
\[y_1(0)=1, y_1(1)=\exp(-1/\sqrt{\lambda})\]
Solution
The analytical solution for $t \in [0, 1]$ is
\[y_1(t) = \exp(-t/\sqrt{\lambda})\]
\[y_2(t) = y_1'(t)\]
References
BVProblemLibrary.prob_bvp_nonlinear_4 — Constantprob_bvp_nonlinear_4Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_2-y_1^2\]
with boundary condition
\[y_1(0)=0, y_1(1)=1/2\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_5 — Constantprob_bvp_nonlinear_5Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1)\]
where
\[f(y_1)=\lambda\sinh(\lambda z)\]
with boundary condition
\[y_1(0)=0, y_1(1)=1\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_6 — Constantprob_bvp_nonlinear_6This problem describes a shock wave in a one dimension nozzle flow.
The steady state Navier-Stokes equations generate a second order differential equations which can be reduced to a first order system described by nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = -\frac{1}{\lambda}f(y_1)\]
where
\[f(t, y_1, y_2)=(\frac{1+\gamma}{2}-\lambda A'(t))y_1y_2-\frac{y_2}{y_1}-\frac{A'(t)}{A(t)}(1-(\frac{\gamma-1}{2})y_1^2)\]
with boundary condition
\[y_1(0)=0.9129, y_1(1)=0.375\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_7 — Constantprob_bvp_nonlinear_7Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=-1/3, y_1(1)=1/3\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_8 — Constantprob_bvp_nonlinear_8Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=-1/3\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_9 — Constantprob_bvp_nonlinear_9Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=1/3\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_10 — Constantprob_bvp_nonlinear_10Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=1, y_1(1)=3/2\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_11 — Constantprob_bvp_nonlinear_11Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=0, y_1(1)=3/2\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_12 — Constantprob_bvp_nonlinear_12Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}f(y_1, y_2)\]
where
\[f(y_1, y_2)=-y_1y_2+y_1\]
with boundary condition
\[y_1(0)=-7/6, y_1(1)=3/2\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_13 — Constantprob_bvp_nonlinear_13Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = \sin(y_2)\]
\[\frac{dy_2}{dt} = y_3\]
\[\frac{dy_3}{dt} = -y_4/\lambda\]
\[\frac{dy_4}{dt} = f(y_1, y_2, y_3, y_4)\]
where
\[f(z, \theta, M, Q)=\frac{1}{\lambda}((z-1)\cos\theta-M\sec\theta)+\lambda Q\tan\theta\]
with boundary condition
\[y_1(0)=0, y_3(0)=0, y_1(1)=0, y_3(1)=0\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_14 — Constantprob_bvp_nonlinear_14This problem arises from fluid injection through one side of a long vertical channel
Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = y_3\]
\[\frac{dy_3}{dt} = y_4\]
\[\frac{dy_4}{dt} = f(y_1, y_2, y_3, y_4)\]
where
\[f(y_1, y_2, y_3, y_4)=\lambda(y_2y_3-y_1y_4)\]
with boundary condition
\[y_1(0)=0, y_2(0)=0, y_1(1)=1, y_2(1)=0\]
Solution
No analytical solution
References
BVProblemLibrary.prob_bvp_nonlinear_15 — Constantprob_bvp_nonlinear_15This problem arises from fluid injection through one side of a long vertical channel
Nonlinear boundary value problem with no analytical solution, given by
\[\frac{dy_1}{dt} = y_2\]
\[\frac{dy_2}{dt} = \frac{1}{\lambda}y_1y_4-y_3y_2\]
\[\frac{dy_3}{dt} = y_4\]
\[\frac{dy_4}{dt} = y_5\]
\[\frac{dy_5}{dt} = y_6\]
\[\frac{dy_6}{dt} = \frac{1}{\lambda}(-y_3y_6-y_1y_2)\]
with boundary condition
\[y_1(0)=-1, y_3(0)=0, y_4(0)=0, y_1(1)=1, y_3(1)=0, y_4(1)=0\]
Solution
No analytical solution
References
Regular Nonlinear BVPs
BVProblemLibrary.flat_moon — Constantflat_moonThis test problem is about the optimal-time launching of a satellite into orbit from flat moon without atmospheric drag.
Given by
\[\frac{dz_1}{dt}=z_3t_f\]
\[\frac{dz_2}{dt}=z_4t_f\]
\[\frac{dz_3}{dt}=A\cos(z_5)t_f\]
\[\frac{dz_4}{dt}=(A\sin(z_5)-g)t_f\]
\[\frac{dz_5}{dt}=-z_6\cos(z_5)t_F\]
\[\frac{dz_6}{dt}=z_6^2\sin(z_5)t_f\]
\[\frac{dz_7}{dt}=0\]
with boundary condition
\[z_1(0)=0\]
\[z_2(0)=0\]
\[z_3(0)=0\]
\[z_4(0)=0\]
\[z_5(1)=h\]
\[z_6(1)=V_c\]
\[z_7(1)=0\]
Solution
No analytical solution
References
BVProblemLibrary.flat_earth — Constantflat_earthLaunch of a satellite into circular orbit from a flat Earth where we assume a uniform gravitational field $g$.
Given by
\[\frac{dz_1}{dt}=z_3\frac{V_c}{h}\]
\[\frac{dz_2}{dt}=z_4\frac{V_c}{h}\]
\[\frac{dz_3}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}}\]
\[\frac{dz_4}{dt}=acc\frac{1}{|V_c|\sqrt{1+z_6^2}}-frac{g}{V_c}\]
\[\frac{dz_5}{dt}=0\]
\[\frac{dz_6}{dt}=-z_5\frac{V_c}{h}\]
\[\frac{dz_7}{dt}=0\]
with boundary condition
\[z_1(0)=0\]
\[z_2(0)=0\]
\[z_3(0)=0\]
\[z_4(0)=0\]
\[z_5(1)=h\]
\[z_6(1)=V_c\]
\[z_7(1)=0\]
Solution
No analytical solution
References
BVProblemLibrary.flat_earth_drag — Constantflat_earth_dragLaunch into circular orbit from a flat Earth including athmosferic drag.
Given by
\[\frac{dz_1}{dt}=z_3\frac{V_c}{h}\]
\[\frac{dz_2}{dt}=z_4\frac{V_c}{h}\]
\[\frac{dz_3}{dt}=\frac{f}{V_c}(-\frac{z_6}{z_6^2+z_7^2}-V_c\eta\exp(-z_2\beta)z_3\sqrt{z_3^3+z_4^2})/m\]
\[\frac{dz_4}{dt}=\frac{f}{V_c}(-\frac{z_7}{z_6^2+z_7^2}-V_c\eta\exp(-z_2\beta)z_4\sqrt{z_3^3+z_4^2})/m - g_{accel}/V_c\]
\[\frac{dz_5}{dt}=-\eta\beta\exp(-z_2\beta)(z_6z_3+z_7z_4)\sqrt{z_3^3+z_4^2}\frac{V_c}{m}\]
\[\frac{dz_6}{dt}=\eta\exp(-z_2\beta)(z_6(2z_3^2+z_4^2)+z_7z_3z_4)V_c/\sqrt{z_3^2+z_4^2}/m\]
\[\frac{dz_7}{dt}=\eta\exp(-z_2\beta)(z_7(z_3^2+2z_4^2)+z_6z_3z_4)V_c/\sqrt{z_3^2+z_4^2}/m\]
with boundary condition
\[z_1(0)=0\]
\[z_2(0)=0\]
\[z_3(0)=0\]
\[z_4(0)=0\]
\[z_5(1)=h\]
\[z_6(1)=V_c\]
\[z_7(1)=0\]
Solution
No analytical solution
References
BVProblemLibrary.measles — ConstantmeaslesThis is an epidemiology model, about the spread of diseases.
Given by
\[\frac{dy_1}{dt}=\mu-\beta(t)y_1y_3\]
\[\frac{dy_2}{dt}=\beta(t)y_1y_3-y_2/\lambda\]
\[\frac{dy_3}{dt}=y_2/\lambda-y_3/\eta\]
with boundary condition
\[y(0)=y(1)\]
Solution
No analytical solution
References