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
  • » Latkova
  • » Profile

Posts

Posts

I use OM 1.8.1 and here is my code:

model Hysteretic_curve
    parameter Real N = 1;
    parameter Real l = 0.816;
    parameter Real Ms = -1500000;
    parameter Real a = 350;
    parameter Real alpha = 0.0007;
    parameter Real c = 0.001;
    parameter Real k = 265;
    Real deridt,i,delta,B,derH,derMan;
    Real H(start = 0),Man(start = 0),M(start = 1e-005);
equation
    i = 2000 * sin(314 * time);
    deridt = 2000 * 314 * cos(314 * time);
    derH = (N * deridt) / l;
    der(H) = derH;
    derMan = Ms * ((derH + alpha * der(M)) / (a * (sinh((H + alpha * M) / a)) ^ 2) + a / (H + alpha * M) ^ 2 * (derH + alpha * der(M)));
    der(Man) = derMan;
    if der(H) > 0 then
        delta = 1;
    else
        delta = -1;
    end if;
    der(M) = ((1 - c) * der(H) * (Man - M)) / ((1 - c) * delta * k - alpha * (Man - M)) + c * der(Man);
    B = 0.000001256* (H + M);
end Hysteretic_curve;

It´s worked now, but results aren´t good. Problem is still with Man. I´ve tried to make it in Simulink and it works fine , but I need it in Modelica ....

Thank you! Now there are not errors, but the current is no more sunisoidal and all results are  wrong. Have you an idea, what´s wrong now?

Hello,
I am new in Modelica and Ihave problem with Jiles Atherton hysteretic model. Here is my code:

model Hysteretic_curve
  parameter Real N = 1;
  parameter Real l = 0.816;
  parameter Real Ms = 1500000.0;
  parameter Real a = 350;
  parameter Real alpha = 0.0007;
  parameter Real c = 0.001;
  parameter Real k = 265;
  constant Real pi = 3.14;
  discrete Real i(start = 0),H(start = 0),delta(start = 0),Man(start = 0),M(start = 0),B(start=0);
equation
  i = sqrt(2) * 2000 * sin(314 * time);
  H = N * i / l;
  Man = Ms * (1 / tanh((H + alpha * M) / a) - a / (H + alpha * M));
  if der(H) > 0 then
    delta = 1;
  else
    delta = -1;
  end if;
  der(M) = ((1 - c) * der(H) * (Man - M)) / ((1 - c) * k - alpha * (Man - M)) + c * der(Man);
  B=1.2566e-6*(H+M);
end Hysteretic_curve;

It´s writen out 4 errors :

Translation    17:41:43        0:0-0:0    Internal error Transformation Module failed!
Translation    17:41:43        0:0-0:0    Internal error sorting equations(strongComponents failed)
Translation    17:41:43        0:0-0:0    Internal error BackendDAETransform.analyseStrongComponentBlock failed
Translation    17:41:43        0:0-0:0    Internal error Sorry - Support for Discrete Equation Systems is not yed implemented

It would be great if somebody could help. Thanks.

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