MATLAB How to display all calculation results in Matlab

  • Thread starter Thread starter Ein Krieger
  • Start date Start date
  • Tags Tags
    Calculation Matlab
AI Thread Summary
To display all calculation results in MATLAB when solving ODEs, it's important to understand that solvers like ode45 generate solutions based on interpolation rather than at specified time points. Users can define the time span and initial conditions, but results may only show from certain time intervals if not properly configured. To retrieve results at specific points, the deval function can be used, which evaluates the solution at any desired time points within the computed range. The input vector for deval must fall within the interval defined by the solver's output. Properly utilizing these functions ensures comprehensive access to all calculated results.
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
Views
1K
Replies
5
Views
3K
Replies
5
Views
2K
Replies
3
Views
3K
Replies
12
Views
3K
Back
Top