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

EndOfFile error

EndOfFile error

 
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

Re: EndOfFile error

Quite few Information. Please post you code.

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

Re: EndOfFile error

Hello,

Thanks for your reply. I will try it again.

There are 0 guests and 0 other users also viewing this topic