Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/src/API/problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ code for a variety of such numerical problems.

```@docs
SciMLBase.ODEFunction
SciMLBase.ODEProblem
SciMLBase.ODEProblem(::System, ::Any, ::Any)
SciMLBase.DAEFunction
SciMLBase.DAEProblem
SciMLBase.DAEProblem(::System, ::Any, ::Any)
SciMLBase.SDEFunction
SciMLBase.SDEProblem
SciMLBase.SDEProblem(::System, ::Any, ::Any)
SciMLBase.DDEFunction
SciMLBase.DDEProblem
SciMLBase.DDEProblem(::System, ::Any, ::Any)
SciMLBase.SDDEFunction
SciMLBase.SDDEProblem
JumpProcesses.JumpProblem
SciMLBase.BVProblem
JumpProcesses.JumpProblem(::System, ::Any, ::Any)
SciMLBase.BVProblem(::System, ::Any, ::Any)
SciMLBase.DiscreteProblem
SciMLBase.ImplicitDiscreteProblem
```
Expand All @@ -33,22 +33,22 @@ SciMLBase.ImplicitDiscreteProblem

```@docs
SciMLBase.NonlinearFunction
SciMLBase.NonlinearProblem
SciMLBase.NonlinearProblem(::System, ::Any)
SciMLBase.SCCNonlinearProblem
SciMLBase.NonlinearLeastSquaresProblem
SciMLBase.SteadyStateProblem
DiffEqBase.SteadyStateProblem(::System, ::Any)
SciMLBase.IntervalNonlinearFunction
SciMLBase.IntervalNonlinearProblem
ModelingToolkit.HomotopyContinuationProblem
SciMLBase.HomotopyNonlinearFunction
SciMLBase.LinearProblem
SciMLBase.LinearProblem(::System, ::Any)
```

## Optimization and optimal control

```@docs
SciMLBase.OptimizationFunction
SciMLBase.OptimizationProblem
SciMLBase.OptimizationProblem(::System, ::Any)
SciMLBase.ODEInputFunction
ModelingToolkit.JuMPDynamicOptProblem
ModelingToolkit.InfiniteOptDynamicOptProblem
Expand Down
28 changes: 28 additions & 0 deletions src/problems/bvproblem.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
"""
BVProblem(sys::System, op, tspan; kwargs...)

Construct a `BVProblem` from a ModelingToolkit `System` for boundary value problems.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (with boundary conditions)
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem

## Keywords
- `check_compatibility=true`: Whether to check system compatibility
- `cse=true`: Whether to perform common subexpression elimination
- `checkbounds=false`: Whether to enable bounds checking
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `expression=Val{false}`: Expression evaluation mode
- `guesses=Dict()`: Initial guesses for boundary value problem
- `callback=nothing`: Callback functions (note: BVP solvers do not support callbacks)
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.BVProblem{iip, spec}(
sys::System, op, tspan;
check_compatibility = true, cse = true,
Expand Down
26 changes: 26 additions & 0 deletions src/problems/daeproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,32 @@
return maybe_codegen_scimlfn(expression, DAEFunction{iip, spec}, args; kwargs...)
end

"""
DAEProblem(sys::System, op, tspan; kwargs...)

Construct a `DAEProblem` from a ModelingToolkit `System` for differential-algebraic equations.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (differential-algebraic system)
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem

## Keywords
- `callback=nothing`: Callback functions for the solver
- `check_length=true`: Whether to check length compatibility
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `check_compatibility=true`: Whether to check system compatibility
- `expression=Val{false}`: Expression evaluation mode
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.DAEProblem{iip, spec}(
sys::System, op, tspan;
callback = nothing, check_length = true, eval_expression = false,
Expand Down
29 changes: 29 additions & 0 deletions src/problems/ddeproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@
return maybe_codegen_scimlfn(expression, DDEFunction{iip, spec}, args; kwargs...)
end

"""
DDEProblem(sys::System, op, tspan; kwargs...)

Construct a `DDEProblem` from a ModelingToolkit `System` for delay differential equations.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (must contain delay equations)
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem

## Keywords
- `callback=nothing`: Callback functions for the solver
- `check_length=true`: Whether to check length compatibility
- `cse=true`: Whether to perform common subexpression elimination
- `checkbounds=false`: Whether to enable bounds checking
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `check_compatibility=true`: Whether to check system compatibility
- `u0_constructor=identity`: Constructor for initial conditions
- `expression=Val{false}`: Expression evaluation mode
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.DDEProblem{iip, spec}(
sys::System, op, tspan;
callback = nothing, check_length = true, cse = true, checkbounds = false,
Expand Down
28 changes: 28 additions & 0 deletions src/problems/jumpproblem.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
"""
JumpProblem(sys::System, op, tspan; kwargs...)

Construct a `JumpProblem` from a ModelingToolkit `System` for jump processes.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (must contain jump processes)
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem (can be a tuple or nothing)

## Keywords
- `check_compatibility=true`: Whether to check system compatibility
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `checkbounds=false`: Whether to enable bounds checking
- `cse=true`: Whether to perform common subexpression elimination
- `aggregator=JumpProcesses.NullAggregator()`: Aggregator for jump processes
- `callback=nothing`: Callback functions for the solver
- `rng=nothing`: Random number generator
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function JumpProcesses.JumpProblem{iip, spec}(
sys::System, op, tspan::Union{Tuple, Nothing};
check_compatibility = true, eval_expression = false, eval_module = @__MODULE__,
Expand Down
29 changes: 29 additions & 0 deletions src/problems/linearproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@ function SciMLBase.LinearProblem(sys::System, op::StaticArray; kwargs...)
SciMLBase.LinearProblem{false}(sys, op; kwargs...)
end

"""
LinearProblem(sys::System, op; kwargs...)

Construct a `LinearProblem` from a ModelingToolkit `System` for linear systems.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the LinearSolve.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [LinearSolve.jl documentation](https://docs.sciml.ai/LinearSolve/stable/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (linear system)
- `op`: Operating point/initial conditions

## Keywords
- `check_length=true`: Whether to check length compatibility
- `expression=Val{false}`: Expression evaluation mode
- `check_compatibility=true`: Whether to check system compatibility
- `sparse=false`: Whether to use sparse arrays
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `checkbounds=false`: Whether to enable bounds checking
- `cse=true`: Whether to perform common subexpression elimination
- `u0_constructor=identity`: Constructor for initial conditions
- `u0_eltype=nothing`: Element type for initial conditions
- `kwargs...`: Additional keyword arguments passed to the solver
"""
function SciMLBase.LinearProblem{iip}(
sys::System, op; check_length = true, expression = Val{false},
check_compatibility = true, sparse = false, eval_expression = false,
Expand Down
22 changes: 22 additions & 0 deletions src/problems/nonlinearproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@
return maybe_codegen_scimlfn(expression, NonlinearFunction{iip, spec}, args; kwargs...)
end

"""
NonlinearProblem(sys::System, op; kwargs...)

Construct a `NonlinearProblem` from a ModelingToolkit `System` for nonlinear equations.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the NonlinearSolve.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [NonlinearSolve.jl documentation](https://docs.sciml.ai/NonlinearSolve/stable/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (nonlinear system)
- `op`: Operating point/initial guess

## Keywords
- `expression=Val{false}`: Expression evaluation mode
- `check_length=true`: Whether to check length compatibility
- `check_compatibility=true`: Whether to check system compatibility
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.NonlinearProblem{iip, spec}(
sys::System, op; expression = Val{false},
check_length = true, check_compatibility = true, kwargs...) where {iip, spec}
Expand Down
26 changes: 26 additions & 0 deletions src/problems/odeproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,32 @@
maybe_codegen_scimlfn(expression, ODEFunction{iip, spec}, args; kwargs...)
end

"""
ODEProblem(sys::System, op, tspan; kwargs...)

Construct an `ODEProblem` from a ModelingToolkit `System`.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem

## Keywords
- `callback=nothing`: Callback functions for the solver
- `check_length=true`: Whether to check length compatibility
- `eval_expression=false`: Whether to evaluate expressions
- `expression=Val{false}`: Expression evaluation mode
- `eval_module=@__MODULE__`: Module for expression evaluation
- `check_compatibility=true`: Whether to check system compatibility
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.ODEProblem{iip, spec}(
sys::System, op, tspan;
callback = nothing, check_length = true, eval_expression = false,
Expand Down
23 changes: 23 additions & 0 deletions src/problems/optimizationproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ function SciMLBase.OptimizationProblem(sys::System, args...; kwargs...)
return OptimizationProblem{true}(sys, args...; kwargs...)
end

"""
OptimizationProblem(sys::System, op; kwargs...)

Construct an `OptimizationProblem` from a ModelingToolkit `System` for optimization.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the Optimization.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [Optimization.jl documentation](https://docs.sciml.ai/Optimization/stable/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (optimization system with cost and constraints)
- `op`: Operating point/initial guess

## Keywords
- `lb=nothing`: Lower bounds for optimization variables
- `ub=nothing`: Upper bounds for optimization variables
- `check_compatibility=true`: Whether to check system compatibility
- `expression=Val{false}`: Expression evaluation mode
- `kwargs...`: Additional keyword arguments passed to the solver
"""
function SciMLBase.OptimizationProblem{iip}(
sys::System, op; lb = nothing,
ub = nothing, check_compatibility = true, expression = Val{false},
Expand Down
28 changes: 28 additions & 0 deletions src/problems/sdeproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,34 @@
return maybe_codegen_scimlfn(expression, SDEFunction{iip, spec}, args; kwargs...)
end

"""
SDEProblem(sys::System, op, tspan; kwargs...)

Construct an `SDEProblem` from a ModelingToolkit `System` with noise.

## Additional Keyword Arguments

Beyond the arguments listed below, this constructor accepts all keyword arguments
supported by the DifferentialEquations.jl `solve` function. For a complete list
and detailed descriptions, see the [ModelingToolkit.jl problem building documentation](https://docs.sciml.ai/ModelingToolkit/stable/API/problems/)
and the [DifferentialEquations.jl solve documentation](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/).

## Arguments
- `sys::System`: The ModelingToolkit system to convert (must contain noise equations)
- `op`: Operating point/initial conditions
- `tspan`: Time span for the problem

## Keywords
- `callback=nothing`: Callback functions for the solver
- `check_length=true`: Whether to check length compatibility
- `eval_expression=false`: Whether to evaluate expressions
- `eval_module=@__MODULE__`: Module for expression evaluation
- `check_compatibility=true`: Whether to check system compatibility
- `sparse=false`: Whether to use sparse arrays
- `sparsenoise=sparse`: Whether to use sparse noise representation
- `expression=Val{false}`: Expression evaluation mode
- `kwargs...`: Additional keyword arguments passed to the solver
"""
@fallback_iip_specialize function SciMLBase.SDEProblem{iip, spec}(
sys::System, op, tspan;
callback = nothing, check_length = true, eval_expression = false,
Expand Down
Loading