Thank you for promptest response, Jens!
I've tried fixed=true parameter as you suggested but with no success.
Also tried expressions like
VariableVolume volume(p.start = 1e5, p.fixed=true, V.start = 1e-2,
V.fixed=true);
with same results.
Maybe the difference in simulation parameters, method? I run
simulation by the command
simulate(Actuator, startTime = 0, stopTime = 1)
And output is unchanged from previous times:
record SimulationResult
resultFile = "/tmp/OpenModelica/Actuator_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 1.0,
numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl',
fileNamePrefix = 'Actuator', storeInTemp = false, noClean = false,
options = '', outputFormat = 'mat', variableFilter = '.*', measureTime
= false, cflags = ''",
messages = "ERROR: Division by zero in partial equation: (717.0 *
(der(volume.thetta) * volume.T) - der(volume.U)) / (-717.0 *
volume.thetta) because -717.0 * volume.thetta == 0.
DASSL-- AT T (=R1) SOME ELEMENT OF WT
In above message, R1 = .2000000000000E-05
DASSL-- HAS BECOME .LE. 0.0
info | DASRT can't continue. time = 0.002002
info | model terminate | Simulation terminated at time 0.002002
",
timeFrontend = 0.041102293999999984,
timeBackend = 0.014174958000000001,
timeSimCode = 0.016377142,
timeTemplates = 0.009396554000000001,
timeCompile = 0.605056829,
timeSimulation = 0.006068048,
timeTotal = 0.69223269
end SimulationResult;
Besides getting volume.p starting from 0 instead of 1e5 I get a
division by zero on time = 0.002002 no matter of using "fixed"
parameter.
By the way I'm using OpenModelica 1.8.0 r10948 under Ubuntu Linux
10.11 x64 if it's matter.
29.01.2012 00:11, Jens.Frenkel пишет:
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;