nelson.ode.ODEResults
Result object returned by solve on an ode object.
📝Syntax
result = solve(problem, tfinal)
result = solve(problem, t0, tfinal)
result = nelson.ode.ODEResults(sol)
📄Description

nelson.ode.ODEResults stores the outcome of an integration performed with the ode object workflow. Calling solve on an ode object returns an instance of this class.

Property Content
Time Row vector of the time points of the integration.
Solution Matrix of solution values, one row per component and one column per time point.
Sensitivity Sensitivity values when sensitivity analysis is requested, empty otherwise.
EventTime Times at which events were detected, empty when no event function is set.
EventSolution Solution values at the detected events.
EventIndex Indices of the event functions that triggered.
EventSensitivity Sensitivity values at the detected events, empty otherwise.
AdjointGradient Gradient computed by adjoint sensitivity analysis, empty otherwise.

The class also carries the hidden properties RawSolution (the underlying solution structure, usable with deval and odextend), SolutionValues (the transpose of Solution, one row per time point), and Stats (solver statistics when available).

The constructor nelson.ode.ODEResults(sol) builds a result object from a solution structure with at least the fields x and y, such as the structure returned by the solver functions. The event and sensitivity properties are filled from the optional fields xe, ye, ie, sensitivity, eventSensitivity, and adjointGradient. Called without argument, the constructor returns an object with all properties empty.

💡Examples
Solve a problem and inspect the result object.
problem = ode('ODEFcn', @(t,y) -y, 'InitialValue', 1);
result = solve(problem, 0, 2);
class(result)
result.Time(end)
result.Solution(:, end)
🔗See Also
odedeval
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub