Hi Ali,

try fixed=true, this means the start value is not only a guess value.

partial class PneumoOneTerm
  Fitting fitting;
  Real p(fixed=true), G;
equation
  p = fitting.p;
  G = fitting.G;
end PneumoOneTerm;

"time","volume.p",
0,100000.0014330081,
0.002,101612.6989615345,
0.004,103225.4216372393,
0.006,104838.1579805062,
0.008,106450.8726136756,

Mit freundlichen Grüßen,
Kind regards,


Jens Frenkel

_________________________________________________________________


Dipl.-Ing.
Jens Frenkel

*****************************************************************
Technische Universität Dresden
Institut für Verarbeitungsmaschinen und Mobile Arbeitsmaschinen
D-01062 Dresden

Tel: 0351 463-39278
Fax: 0351 463-37731
E-Mail: [email protected]

Internet: http://tu-dresden.de/bft

Wissensportal: www.baumaschine.de
*****************************************************************


*****************************************************************
Dresden University of Technology
Institute of Processing Machines and Mobile Machinery
D-01062 Dresden
Germany

Tel: +49 351 463-39278
Fax: +49 351 463-37731
E-Mail: [email protected]

Internet: http://tu-dresden.de/bft
*****************************************************************


Am 28.01.2012 17:26, schrieb Adrian Pop:

Hi all,

Forwarding email from Ali.
Ali, i now added you to OpenModelicaInterest as something
went wrong with your subscription email.

Cheers,
Adrian Pop/

From: Ali Tlisov <[email protected]>
Date: Sat, 28 Jan 2012 18:43:58 +0400
Subject: setting of initial values for variables have no effect
To: [email protected]

Hi!
I'm new to modelica and openmodelica in particular but being impressed
about it's capabilities and about physical modeling concept decided to
try it. So maybe my question is stupid one anyway all suggestions are
highly appreciated!
I've tried to build simple model of Volume being filled by Gas through
an Orifice. I try to set initial value of pressure in Volume (p.start
= 1e5) but after simulating I see that it starts from zero in spite of
my directions.
Thank you for any help in advance!

My code is as follows:

connector Fitting
  flow Real G "Mass Flow";
  Real p "Pressure";
end Fitting;

partial class PneumoTwoTerm
  Fitting fin, fout;
  Real G;
equation
  0 = fin.G + fout.G;
  G = fin.G;
end PneumoTwoTerm;

partial class PneumoOneTerm
  Fitting fitting;
  Real p, G;
equation
  p = fitting.p;
  G = fitting.G;
end PneumoOneTerm;

model PneumoSource
  extends PneumoOneTerm;
end PneumoSource;

model Orifice
  extends PneumoTwoTerm;
  input Real size;
  constant Real M = 29e-3;
  constant Real k = 1.4;
  constant Real R = 8.31441;
  parameter Real T = 273;
algorithm
  G := fin.p * size * sqrt(M / (R * T)) * (2 / (k + 1)) ^ (1 / (k-1))
* sqrt(2 * k / (k + 1));
end Orifice;

model VariableVolume
  extends PneumoOneTerm;
  input Real dV "Volume change";
  Real Q "Energy given to system with incoming Gas";
  Real L "Work of Gas";
  Real U "Inner Energy of Gas";
  Real V "Volume";
  Real thetta "Amount of substance in Volume";
  Real T(start = 273) "Temperature of Gas in volume";
  parameter Real T_in = 273 "Temperature of incoming Gas";
  constant Real c_V = 717, c_p = 1006;
  constant Real M = 29e-3 "Molar Mass of air";
  constant Real k = 1.4 "Adiabate characteristic";
  constant Real R = 8.31441 "Gas constant";
equation
  der(Q) = der(U) + der(L);
  der(L) = p * der(V);
  der(U) = c_V * der(thetta * T);
  der(Q) = c_p * T_in * der(thetta);
  der(V) = dV;
  der(thetta) * M = G;
  thetta * T = p * V / R; // Ideal Gas equation
end VariableVolume;

model Actuator
  PneumoSource source;
  Orifice orifice;
  VariableVolume volume(p.start = 1e5, V.start = 1e-2);
equation
  connect(source.fitting, orifice.fin);
  connect(orifice.fout, volume.fitting);
  volume.dV = 0;
  orifice.size = 1e-4;
  source.p = 3e5;
end Actuator;

Reply via email to