Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.9 KB

plotting.rst

File metadata and controls

68 lines (47 loc) · 1.9 KB

2D Plotting

This chapter covers the 2D plotting available in OpenModelica via OMNotebook, OMShell and command line script. The plotting is based on OMPlot application. See also OMEdit _omedit-2d-plotting.

Example

To create a simple time plot the above model HelloWorld is simulated. To reduce the amount of simulation data in this example the number of intervals is limited with the argument numberOfIntervals=5. The simulation is started with the command below.

When the simulation is finished the file HelloWorld_res.csv contains the simulation data:

Diagrams are now created with the new OMPlot program by using the following plot command:

By re-simulating and saving results at many more points, for example using the default 500 intervals, a much smoother plot can be obtained. Note that the default solver method dassl has more internal points than the output points in the initial plot. The results are identical, except the detailed plot has a smoother curve.

Plot Command Interface

Plot command have a number of optional arguments to further customize the the resulting diagram.