How to display all calculation results in Matlab

  • Context: MATLAB 
  • Thread starter Thread starter Ein Krieger
  • Start date Start date
  • Tags Tags
    Calculation Matlab
Click For Summary

Discussion Overview

The discussion revolves around how to configure MATLAB to display all calculation results when solving a system of ordinary differential equations (ODEs), particularly in the context of large spatial variables and time step distributions.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant inquires about how to ensure MATLAB displays all results from ODE calculations, noting that results only appear starting from a certain time point.
  • Another participant explains that ODE solvers in MATLAB do not evaluate results solely at specified time points, emphasizing the importance of the start point, end point, and the distance between the first two time steps.
  • This participant mentions that the solver uses interpolation to generate solutions, suggesting the use of the ode45 function and the deval function to evaluate solutions at desired points.
  • There is a request for clarification on the terms xint and yint, which are used in the context of evaluating solutions.
  • A later reply provides a definition from the documentation, explaining that deval evaluates the solution at specified entries of the vector XINT, detailing the requirements for XINT in relation to the solution structure returned by the ODE solver.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best method to display all results, and there are multiple viewpoints regarding the behavior of MATLAB's ODE solvers and the interpretation of specific terms.

Contextual Notes

There are limitations regarding the assumptions made about the behavior of ODE solvers and the specific configurations needed to display results, which remain unresolved in the discussion.

Ein Krieger
Messages
32
Reaction score
0
Hi,

How can I set Matlab to display all the calculation results?

I am solving the system of ODEs with large spatial variable and time step distribution. If I set total time to 100 with time step of 1 only the results starting from t=50 are displayed.

How to fix it?:frown:

Thanks.
 
Physics news on Phys.org
The ODE solvers don't necessarily evaluate only at the points you specify. The most important time features that the solver looks at are the start point, end point, and distance between first two time steps.

They solve the whole system via interpolation.

So something like sol = ode45(@odefun,[t0,tf],y0,options) generates a solution and then you evaluate the solution at any point(s) you want with yint = deval(sol,xint)
 
What do xint and yint stand for?
 
kreil said:
The ODE solvers don't necessarily evaluate only at the points you specify. The most important time features that the solver looks at are the start point, end point, and distance between first two time steps.

They solve the whole system via interpolation.

So something like sol = ode45(@odefun,[t0,tf],y0,options) generates a solution and then you evaluate the solution at any point(s) you want with yint = deval(sol,xint)

What do xint and yint stand for?
 
From the doc,

SXINT = deval(SOL,XINT) evaluates the solution of a differential equation problem at all the entries of the vector XINT. SOL is a structure returned by an initial value problem solver (ODE45, ODE23, ODE113, ODE15S, ODE23S, ODE23T, ODE23TB, ODE15I), a boundary value problem solver (BVP4C, BVP5C), or a delay differential equations solver (DDE23, DDESD). The elements of XINT must be in the interval [SOL.x(1) SOL.x(end)]. For each I, SXINT(:,I) is the solution corresponding to XINT(I).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K