Skip to contents

Constructors of the solution types of SciMLBase. DAESolution() and RODESolution() build a solution from saved times and states like ODESolution() (interpolated linearly); a RODESolution also carries the noise path W (a list with the times t and the matrix W). NonlinearSolution(), SteadyStateSolution() and OptimizationSolution() hold the solution u of a nonlinear, steady state or optimization problem with its return code, residual and statistics (and the objective value); LinearSolution() the solution of a linear system (as build_linear_solution()). PDETimeSeriesSolution(sol, metadata) and PDENoTimeSolution(sol, metadata) wrap the solution of a discretized PDE with the discretization metadata, time dependent or not; the wrapped solution stays in original_sol.

Usage

DAESolution(t, u, prob, alg = list(name = "DAESolution"), retcode = "Success")

RODESolution(
  t,
  u,
  prob,
  alg = list(name = "RODESolution"),
  W = NULL,
  retcode = "Success"
)

NonlinearSolution(
  prob,
  alg,
  u,
  retcode = "Success",
  resid = NULL,
  stats = list()
)

SteadyStateSolution(
  prob,
  alg,
  u,
  retcode = "Success",
  resid = NULL,
  stats = list()
)

OptimizationSolution(
  prob,
  alg,
  u,
  objective,
  retcode = "Success",
  stats = list(),
  original = NULL
)

LinearSolution(
  u,
  resid = NULL,
  alg = list(name = "LinearSolution"),
  retcode = "Success",
  stats = list()
)

PDETimeSeriesSolution(sol, metadata)

PDENoTimeSolution(sol, metadata)

Arguments

t, u

Saved times and states, or the solution value.

prob

The problem.

alg

The algorithm (any object with a name).

retcode

The return code, see ReturnCode.

W

The noise path of a random or stochastic solution.

resid

The residual.

stats

Solver statistics.

objective

The objective value.

original

The result of the underlying optimizer.

sol

A solution.

metadata

The discretization metadata.

Value

A solution object of the named class.

Examples

prob <- ODEProblem(function(u, p, t) -u, 1, c(0, 1))
sol <- RODESolution(c(0, 0.5, 1), rbind(1, 0.6, 0.37), prob,
  W = list(t = c(0, 0.5, 1), W = rbind(0, 0.1, 0.3)))
sol(0.25)
#> [1] 0.8
NonlinearSolution(NonlinearProblem(function(u, p) u^2 - 2, 1), list(name = "manual"), sqrt(2))$u
#> [1] 1.414214