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

Posts

Posts

I'm having a problem when trying to solve the algorithm present in the image. I tried to solve by many ways, but results were not satisfactory... The latest try is described in the code, but the following error arises:

KanoModel_02nls.c: In function 'initializeStaticNLSData17':
KanoModel_02nls.c:146: error: 'INTEGER_ATTRIBUTE' has no member named 'nominal'
KanoModel_02nls.c:150: error: 'INTEGER_ATTRIBUTE' has no member named 'nominal'
\MinGW\bin\mingw32-make: *** [KanoModel_02nls.o] Error 1
\MinGW\bin\mingw32-make: *** Waiting for unfinished jobs....
Compilation process failed. Exited with code 2.

Could someone help me solve this problem?


Code:


model KanoModel "Kano stiction model"
  Real S = 0.1, J = 0.02;
  Real y, u;
  Real du(start = 0, fixed = true), us(start=0.5), du_old(start=0);
  Integer stp(start = 0, fixed=true), d(start = 1, fixed = true);

algorithm
  u := 0.3 * sin(5 * time) + 0.5;
  du := u - pre(u);
  du_old := pre(du);
 
// Check if valve stops or changes direction
  if (du * du_old) <= 0 and pre(stp) == 0 then
    us := pre(u);
    stp := 1;
  else
    us := pre(us);
    stp := pre(stp);
  end if;
// Assign the valve position
  if stp == 0 then

    d := pre(d);
    y := u - pre(d) * (S - J) / 2;
  elseif (-pre(d) * (u - us)) > S then
    stp := 0;
    d := -pre(d);
    y := u - pre(d) * (S - J) / 2;
  elseif pre(d) * (u - pre(us)) > J then
    stp := 0;
    y := u - pre(d) * (S - J) / 2;
  else
    y := pre(y);
  end if;

end KanoModel;

https://drive.google.com/file/d/0BztDYlm6Ig55ZWppb1NONnhaekU/view?usp=sharing

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