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
  • Index
  • » Users
  • » yzh89
  • » Profile

Posts

Posts

May-02-12 19:41:54
Connecting AbsoluteSensor with MIMO input
Category: Programming

Did u change the parameter of MIMO? There is a parameter for number of input arguments and output arguments. I don't see the problem you described above. u also comes with a index when you do the connection.

I used this spring model I don't see the error.

Apr-05-12 00:01:51
how to get the integrator of a variable in a model?

Hi,

Try integrator in Blocks/continuous in MSL if you using a current sensor. Or just create a state Q so that in equation section you also put I= der(Q).

Yuchen

Apr-04-12 23:59:45
Defining extra component frames

Hi Henk,

From my understanding every parts in MultiBody library have at least one frame attached. Refer to The New Modelica MultiBody Library for more detail description.

Say you are using a Bodybox(like a beam) in Parts folder, then you can attach Force/Torque on both ends and the force and torque can described in either frame. If you want to have force not at the ends of the beam but in between ends, you need to attach a fixedtranslation to translate coordinate so that force can act on other positions of the beam.

Yuchen

Mar-28-12 18:02:49
code-sync variables have wrong arraySize subscripts property

After the Modelica code is synchronized using ModelicaML, every variables will have a blank entry in Array Subscript property tag. Whenever I want to make copy of the model and regenerated the code. Extra brackets will be generated which causes syntax error. For example for this model http://www.ida.liu.se/~pelab/modelica/O … aML/temp/. The following type of code will be generated.

//This code is generated from a ModelicaML model.

within ModelicaMLModel.Structure;

class SamplingClock 

    parameter Modelica.SIunits.Time first[]= 0;
    parameter Modelica.SIunits.Time interval[]= 1;
    Boolean clock[];
    Real x[](start = 1);
    equation
        clock = sample(first, interval);
        when clock then
          x = -pre(x);

        end when;
   
end SamplingClock;

The extra brackets will be removed if I delete that blank arraySize entry.


Thanks,
Yuchen

Mar-26-12 09:20:45
ModelicaML failed to regonize code in code-sync folder

It is indeed the Windows problem. I changed the workspace location, and it works great thanks so much.

Yuchen

Mar-23-12 19:55:40
ModelicaML failed to regonize code in code-sync folder

Same result as before it doesn't recognize the model in the folder, which is

Number of loaded classes: 0
Number of loaded components: 0
Number of loaded extends relations: 0




********************   LOG ********************

I tried that project, and whenever I want to refresh it complains about not being able to find the model file.

Mar-21-12 20:18:11
ModelicaML failed to regonize code in code-sync folder

Now I upgrade Eclipse to 3.7.2 and ModleicaML to the newest version with OpenModelica latest night-build. I still cannot synchronize the code. Does anyone else have similar experience?

Yuchen

Mar-05-12 19:59:53
planar loop and free fall
Category: Programming

Is it possible to have a freefall object that has a planar loop structure inside? I know freefall with one single body works well in the bounced ball example. What if I want to simulate a much complicated structure that is falling. I get singularity problem from Dymola. Here's a model and the errors associated.

model Test
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute(phi(fixed=true, start=1.5707963267949),
      w(fixed=true))
    annotation (Placement(transformation(extent={{-56,34},{-36,54}})));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute1
    annotation (Placement(transformation(extent={{28,34},{48,54}})));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute2
    annotation (Placement(transformation(extent={{-52,-52},{-32,-32}})));
  Modelica.Mechanics.MultiBody.Joints.RevolutePlanarLoopConstraint revolute3
    annotation (Placement(transformation(extent={{28,-52},{48,-32}})));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox(r={1,0,0})
    annotation (Placement(transformation(extent={{-20,36},{0,56}})));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox1(r={0.3,0,0}) annotation (
      Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=90,
        origin={50,12})));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox2(r={1,0,0})
    annotation (Placement(transformation(extent={{-18,-56},{2,-36}})));
  Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox3(r={1,0,0}) annotation (
      Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=90,
        origin={-48,4})));
  inner Modelica.Mechanics.MultiBody.World world
    annotation (Placement(transformation(extent={{-84,62},{-64,82}})));
  Modelica.Mechanics.MultiBody.Joints.FreeMotion freeMotion(
    r_rel_a(fixed=true),
    v_rel_a(fixed=true),
    angles_fixed=true,
    w_rel_a_fixed=true)
    annotation (Placement(transformation(extent={{-40,68},{-20,88}})));
equation

  connect(revolute.frame_b, bodyBox.frame_a) annotation (Line(
      points={{-36,44},{-28,44},{-28,46},{-20,46}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(bodyBox.frame_b, revolute1.frame_a) annotation (Line(
      points={{0,46},{14,46},{14,44},{28,44}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(revolute1.frame_b, bodyBox1.frame_b) annotation (Line(
      points={{48,44},{50,44},{50,22}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(bodyBox1.frame_a, revolute3.frame_b) annotation (Line(
      points={{50,2},{50,-42},{48,-42}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(revolute3.frame_a, bodyBox2.frame_b) annotation (Line(
      points={{28,-42},{14,-42},{14,-46},{2,-46}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(bodyBox2.frame_a, revolute2.frame_b) annotation (Line(
      points={{-18,-46},{-26,-46},{-26,-42},{-32,-42}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(revolute2.frame_a, bodyBox3.frame_a) annotation (Line(
      points={{-52,-42},{-50,-42},{-50,-6},{-48,-6}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(bodyBox3.frame_b, revolute.frame_a) annotation (Line(
      points={{-48,14},{-48,28},{-56,28},{-56,44}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(freeMotion.frame_b, bodyBox.frame_a) annotation (Line(
      points={{-20,78},{-20,46}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  connect(freeMotion.frame_a, world.frame_b) annotation (Line(
      points={{-40,78},{-52,78},{-52,72},{-64,72}},
      color={95,95,95},
      thickness=0.5,
      smooth=Smooth.None));
  annotation (Diagram(graphics));
end Test;


ERROR: Failed to solve non-linear system using Newton solver.To get more information: Turn on Simulation/Setup/Debug/Nonlinear solver diagnostics/DetailsSolution to systems of equations not found at time = 0   Nonlinear system of equations number = 2   Infinity-norm of residue = 0.147649   Iteration is not making good progress.   Accumulated number of residue       calc.: 65   Accumulated number of symbolic Jacobian calc.: 6   Last values of solution vector:revolute2.phi = 0.755891
revolute1.phi = -0.788992
   Last values of residual vector:{ -0.113699, -0.0339503 }
Trying to solve non-linear system using global homotopy-method.
ERROR: Failed to solve non-linear system using Newton solver.To get more information: Turn on Simulation/Setup/Debug/Nonlinear solver diagnostics/DetailsSolution to systems of equations not found at time = 0   Nonlinear system of equations number = 2   Infinity-norm of residue = 0.000933738   Iteration is not making good progress.   Accumulated number of residue       calc.: 176   Accumulated number of symbolic Jacobian calc.: 20   Last values of solution vector:revolute2.phi = 0.329567
revolute1.phi = -0.785398
   Last values of residual vector:{ -0.000447414, -0.000486324 }
Error: Failed to start model.

Feb-23-12 17:40:26
ModelicaML failed to regonize code in code-sync folder

Its Eclipse 3.7.1 and ModelicaML 1.8.5.201202201920

Feb-22-12 22:49:02
ModelicaML failed to regonize code in code-sync folder

I tried the newest night build. Same problem. I think an example model file would help.

Yuchen

Feb-22-12 00:08:43
ModelicaML failed to regonize code in code-sync folder

Hi Wladimir,


I was using 1.8.1 r10984. I wish that's not the problem.
Can you upload the example in the start up tutorial for code-sync model, so I can refer to as what it should look like?
I tried very simple model like the following,

package testModel
 
class SamplingClock
  parameter Modelica.SIunits.Time first = 0;
  parameter Modelica.SIunits.Time interval = 1;
  Boolean clock;
  Real x(start=1);
equation
  clock = sample(first,interval);
  when clock then
    x=-pre(x);
  end when;
end SamplingClock;

end testModel;


Thank you,
Yuchen

Feb-20-12 22:56:15
ModelicaML failed to regonize code in code-sync folder

Hi,

I am following the ModelicaML: Getting Started pdf to build ModelicaML model based on existing .mo file. So I put .mo files under code-sync, somehow it doesn't pick up the model. I also tried the two tank model code, which is auto generated, but still nothing being pick up. The following is the proxy synchronization report.
Number of loaded classes: 0
Number of loaded components: 0
Number of loaded extends relations: 0




********************   LOG ********************

Is there particular steps, I have to do before putting models under code-sync folder? Is there any constraint on the code structure?

Thanks,
Yuchen

  • Index
  • » Users
  • » yzh89
  • » Profile
You are here: