- Index
- » Users
- » p.m
- » Profile
Posts
Posts
Hello,
Thanks for your reply. I will try it again.
Thanks for your Response. This is my code as exercise, that I encountered the error.
model Oscillator
Mass mass(L=1, s(start = -0.5));
Spring spring1( s_rel0 = 2, c=10000);
Fixed fixed1( s0 = 1.0);
equation
connect( spring1.flange_b, fixed1.flange_b);
connect( mass1.flange_b, spring1.flange_a);
annotation (uses(Modelica(version="3.2.1")));
end Oscillator;
model Mass
extends Rigid;
parameter Real m= 1; //mass of the hanging mass"
constant Real g= 9.81; //gravitational acceleration"
Real v; // absolute velocity of component"
Real a; //absolute acceleration of component"
equation
v = der(s);
a = der(v);
flange_b.f = m*a - m*g;
annotation (uses(Modelica(version="3.2.1")));
end Mass;
partial model Rigid
// Rigid connection of 2 translational 1D flanges
Real s; // absolute position s of center of component (s = flange_a.s + L/2= flange_b.s - L/2)
parameter Real L = 0; //length L of component from left to right flange ( L = flange_b.s - flange_a.s)
Flange_a flange_a;
Flange_b flange_b;
equation
flange_a.s = s - L/2;
flange_b.s = s + L/2;
annotation (uses(Modelica(version="3.2.1")));
end Rigid;
model Fixed
//fixed flange at housing
parameter Real s0 = 0; //fixed offset position of housing
Flange_b flange_b;
equation
flange_b.s = s0;
annotation (uses(Modelica(version="3.2.1")));
end Fixed;
and this is the error:
Error: declaration window line 14 column 1, syntax error at "model" missing EndOfFile
ERROR: 1 error was found
Hello every one, I am quite new with Modelica and Dymola. I wrote a simple model and I recieved this error. Could you please explain me how to solve ?
Error: declaration window line 12 column 2, syntax error at "partial" missing EndOfFile
- Index
- » Users
- » p.m
- » Profile