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

Posts

Posts

Sep-19-17 20:52:02
Errors in my code
Category: Programming

I'll try, thank you.

What is the right sintax if I want to put both the logical conditions all together:

if noEvent(extrapointSurface_1==8) or noEvent(extraPointSurface==8)

May it work?

Thanks a lot

Sep-19-17 19:04:55
Need some help

Hello everyone,
someone can help me with this very easy code?
I don't understand what I'm doing wrong

model x
  Boolean Extra1;
  Boolean Extra2;
  Boolean ExtraPointsCondition;
  Real extraPointSurface_1;
  Real extraPointSurface_2;
equation

  if noEvent(extraPointSurface_1=8) or noEvent(extraPointSurface_2=8) then

   ExtraPointsCondition=true;
  end if;
end x;


The error message that I get is the follow

Check of x:

Unknown named argument 'extraPointSurface_1' for function noEvent in (model x).

In call noEvent(extraPointSurface_1=8)

The function is declared as:
function noEvent
end noEvent;

Unknown named argument 'extraPointSurface_2' for function noEvent in (model x).

In call noEvent(extraPointSurface_2=8)

The function is declared as:
function noEvent
end noEvent;

Errors found in: if (noEvent() or noEvent()) then
// No equations
end if;

Modelica Text: line 9

The model contained invalid expressions.

Check aborted.

ERROR: 2 errors were found


Thank you very much in advance

Sep-19-17 18:46:46
Errors in my code
Category: Programming

This is the complete code

model x
  Boolean Extra1;
  Boolean Extra2;
  Boolean ExtraPointsCondition;
  Real extraPointSurface_1;
  Real extraPointSurface_2;
equation
if noEvent(extraPointSurface_1=8) then
     Extra1=true;
   else
     Extra1=false;
   end if;

   if noEvent(extraPointSurface_2=8) then
     Extra2=true;
   else
     Extra2=false;
   end if;

   ExtraPointsCondition=Extra1*Extra2;
end x;

Sep-19-17 18:43:54
Errors in my code
Category: Programming

Hello everyone,
I'm trying to implement a logical loop. It's pretty easy but not sure what I'm doing wrongly

equation
   if noEvent(extraPointSurface_1=8) then
     Extra1=true;
   else
     Extra1=false;
   end if;

   if noEvent(extraPointSurface_2=8) then
     Extra2=true;
   else
     Extra2=false;
   end if;

   ExtraPointsCondition=Extra1*Extra2;


I would use the logical operator OR but I got errors. By the way with this very easy code I got this error message

Unknown named argument 'extraPointSurface_1' for function noEvent in (model RCR_OS.Chassis.Bottoming.Contact.N17_GroundContact_withLateral).

In call noEvent(extraPointSurface_1=8)

The function is declared as:
function noEvent
end noEvent;

Errors found in: if (noEvent()) then
// No equations
end if;

Modelica Text: line 156

Unknown named argument 'extraPointSurface_2' for function noEvent in (model RCR_OS.Chassis.Bottoming.Contact.N17_GroundContact_withLateral).

In call noEvent(extraPointSurface_2=8)

The function is declared as:
function noEvent
end noEvent;

Errors found in: if (noEvent()) then
// No equations
end if;

Modelica Text: line 162

The model contained invalid expressions.

Check aborted.

Anyone can help?
Thank you in advance

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