Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ModiaSim/ModiaResult.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ModiaResult

Stable The MIT License

ModiaResult is part of ModiaSim. See also the ModiaResult documentation.

ModiaResult defines an abstract interface for simulation results and provides overloaded methods for:

  • Dictionaries,

  • DataFrame tables,

  • Tables (for example CSV), and

  • ModiaResult.ResultDict (special dictionary with all features of the interface).

Additionally, operations on simulation results are provided, especially to produce line plots in a convenient way based on

  • GLMakie (interactive plots in an OpenGL window),
  • WGLMakie (interactive plots in a browser window),
  • CairoMakie (static plots on file with publication quality),
  • PyPlot (plots with Matplotlib from Python) and
  • NoPlot (= all plot calls are ignored; NoPlot is a module in ModiaResult), or
  • SilentNoPlot (= NoPlot without messages; SilentNoPlot is a module in ModiaResult).

More details:

Installation

All packages are registered and are installed with:

julia> ]add ModiaResult
        add ModiaPlot_GLMakie       # if plotting with GLMakie desired
        add ModiaPlot_WGLMakie      # if plotting with WGLMakie desired
        add ModiaPlot_CairoMakie    # if plotting with CairoMakie desired
        add ModiaPlot_PyPlot        # if plotting with PyPlot desired

If you have trouble installing ModiaPlot_PyPlot, see Installation of PyPlot.jl

Example

Assume that the result data structure is available, then the following commands

import ModiaResult

# Define plotting software globally
ModiaResult.activate("PyPlot") # or ENV["MODIA_PLOT"] = "PyPlot"

# Execute "using ModiaPlot_<globally defined plot package>"
ModiaResult.@usingModiaPlot   # = "using ModiaPlot_PyPlot"

# Generate line plots                     
plot(result, [("sigA", "sigB", "sigC"), "r[2:3]"])

generate the following plot:

SegmentedSignalsPlot

Main developer

Martin Otter, DLR - Institute of System Dynamics and Control

About

Abstract interface and base functions for simulation results

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages