- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » EndOfFile error
EndOfFile error
Re: EndOfFile error
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
Re: EndOfFile error
Hi,
sorry for the late Response. I guess that you used the components out of the Standard library?
I created the model you have described (mass, spring, fixed), but I don't get an error message. I am using OpenModelica OMEdit with Windows 7.
Sorry that I can't help you.
Regards, Zwieback
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » EndOfFile error