Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Model linearization

Model linearization

Hi,

I'm trying to linearize a fairly simple Modelica model using OpenModelica 1.9.1Beta4. The model contains a point mass whose motion is constrained through a prismatic constraint with a spring-damper connected to the prismatic joint. Upon model linearization (at t = 1sec.) the simulation returns 0 for all elements in the state-space matrices.

The output of the end of the OMEdit log is:

  parameter Integer n = 2; // states
  parameter Integer k = 0; // top-level inputs
  parameter Integer l = 0; // top-level outputs
  parameter Real x0[2] = {0,0};
  parameter Real u0[0] = {i for i in 1:0};
  parameter Real A[2,2] = [0,0;0,0];
  parameter Real B[2,0] = zeros(2,0);
  parameter Real C[0,2] = zeros(0,2);
  parameter Real D[0,0] = zeros(0,0);
  Real x[2](start=x0);
  input Real u[0];
  output Real y[0];

  Real x_Pprismatic1Ps = x[1];
  Real x_Pprismatic1Pv = x[2];
     
equation
  der(x) = A * x + B * u;
  y = C * x + D * u;
end linear_springmass1;

Any insight into this issue would be welcome. The model is attached.

Thanks.

Re: Model linearization

Hi,

how did you do it?
Did you used the the compiler flag: "+generateSymbolicLinearization"

so long.
Willi

Re: Model linearization

This was done in OMEdit by setting specifying the Linearization time in the simulation flags settings at time 0.


I'm also trying this in OMNotebook, first loading the Modelica library, which should include the Modelica_Linear_Systems2 2.3.2 libraries. In OmNotebook,
When I use the set command to linearize: setCommandLineOptions({"+d=linearization"}), I get the following error message:

{false}
OMC-ERROR:
"Error: Unknown debug flag linearization."


I'm using the latest nightly build, downloaded today.

Not sure why it's not recognizing the d flag, this comes right out of the OMNotebook example: E411tanksystem.onb. Maybe I don't have things pointed
to the correct folders.

Any help would be welcome.



Thanks.

Edited by: awright - Oct-24-14 21:54:25

Re: Model linearization


Yes, there is no debug flag any more that is called "lineraize".

It's now a config option and can be set with:
setCommandLineOptions({"+generateSymbolicLinearization"})

Or if you are using OMNotebook or OMShell you can also use
the linearize api call.
( see also https://build.openmodelica.org/Document … rize.html)

There are 0 guests and 0 other users also viewing this topic