functionplotRootLoci

Plot root loci of nonlinear Modelica model by linearizing the model for variations of one model parameter

Information

Syntax

plotRootLoci(modelName, modelParams, simulationOptions, position, useLegend, grid, markerStyle, markerColorMin, markerColorMax)

Description

This function linearizes Modelica model, calculates its eigenvalues and plots root loci for variants of selected model parameter modelParams[1].parName. Optionally, the model will be simulated before linearization. This is reasonable e.g. if the model is initially not at equilibrium and it contains nonlinearities. The end time of the simulation is simulationOptions.t_linearize. The linearization will be performed for the states of model at that time. Therefore, this process can generally be very time-consuming.

On the contrary, if the linearization time simulationOptions.t_linearize = 0 the linearization is performed at once for various parameter values. This is efficient and sufficient for most cases.

Calling this function with default setup the following root loci plot will be generated.

Inputs

TypeNameDefaultDescription
StringmodelName"Modelica.Mechanics.Rotational.Examples.First"Name of the Modelica model
Modelica_LinearSystems2.Records.ParameterVariation[:]modelParams{Modelica_LinearSystems2.Records.ParameterVariation(Name = "Jload", Min = 1, Max = 6, nPoints = 10)}
Modelica_LinearSystems2.Records.SimulationOptionsForLinearizationsimulationOptionsModelica_LinearSystems2.Records.SimulationOptionsForLinearization(method = "Dassl", tolerance = 0.0001)
Integer[4]position{5, 5, 600, 450}Window Position
BooleanuseLegendtrueUse legend
BooleangridtrueUse grid
MarkerStylemarkerStyleMarkerStyle.SquareStyle of marker
Integer[3]markerColorMin{0, 0, 255}Color of marker for minimum parameter value
Integer[3]markerColorMax{255, 0, 0}Color of marker for maximum parameter value
BooleandeleteResultfalseDelete result files of linearization