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

why do I get different plots with the same model?

why do I get different plots with the same model?

On OMNotebook i wrote following.

Code:


cd("/home/elkin/OM")
loadModel(Modelica)
class Masa = Modelica.Mechanics.Translational.Components.Mass;
class Resorte=Modelica.Mechanics.Translational.Components.Spring;
class SoporteFijo= Modelica.Mechanics.Translational.Components.Fixed;

model Oscilador
  Masa     masa1(L = 1, s(start = -0.5));
  Resorte   resorte1(s_rel0 = 2, c = 10000);
  SoporteFijo   soporte1(s0 = 1.0);
equation
  connect(resorte1.flange_b, soporte1.flange);
  connect(masa1.flange_b, resorte1.flange_a);
end Oscilador;   

simulate( Oscilador,stopTime=0.5 )

plot(masa1.s)

The simulation was different at:

Code:


model Oscilador04
  Modelica.Mechanics.Translational.Components.Mass mass1(s(start = -0.5), L(start = 1), m = 1) ;
  Modelica.Mechanics.Translational.Components.Fixed fixed1(s0 = 1) ;
  Modelica.Mechanics.Translational.Components.Spring spring1(c = 10000, s_rel0 = 2);
equation
  connect(spring1.flange_b,fixed1.flange) ;
  connect(mass1.flange_b,spring1.flange_a) ;
end Oscilador04;

simulate( Oscilador04,stopTime=0.5 )

plot(mass1.s)

There are 0 guests and 0 other users also viewing this topic
You are here: