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

Posts

Posts

Mar-23-20 07:43:18
Topic: ERROR
I am trying to solve a nonlinear equation and I came accross an error
Category: Programming

Hello,

I would like to put this problem together, in case someone has had the answer for all these years.

Good luck with containment, wherever you are.

Feb-28-20 07:34:14
Modeling of an anti-fall valve

Hi Carlos !!
Thank you very much for your answer and your analyse. It will help me a lot !

This component is actually part of a system that already contains oil and pressure. I could not share this model for privacy reasons.

Nevertheless, I have a question. WHAT do you mean "extend a component"? I am a beginner on model and I have to learn everything by myself .. Not easy !!

Thank you again for the work done, I will get back to it right away.

Feb-27-20 11:33:30
Modeling of an anti-fall valve

Yes of course !! Here it is :

model Clapet_Anti_Chute_Debit_OK
  OpenHydraulics.Interfaces.FluidPort IN
    annotation (Placement(transformation(extent={{-112,20},{-92,40}}), iconTransformation(extent={{-112,20},{-92,40}})));
  OpenHydraulics.Interfaces.FluidPort OUT(m_flow(start=20))
    annotation (Placement(transformation(extent={{208,20},{228,40}}), iconTransformation(extent={{208,20},{228,40}})));

  parameter Real Tarage = 60
  "Tarage du clapet (L/min)" annotation (Dialog(tab="Sizing"));

    // Si la pression détectée en entrée est inférieure à la valeur du tarage, alors cela veut dire que le fluide peut passer
    // A contrario, si la pression détectée est inférieure à la valeur du tarage, alors le fluide doit être bloqué

  OpenHydraulics_mod.Components.Sensors.FlowSensor flowSensor annotation (Placement(transformation(extent={{-26,24},
            {-6,44}})));
  Modelica.Blocks.Sources.RealExpression realExpression(y=if ((Tarage*(1/60000))
         < (flowSensor.y)) then 0 else 1)
    annotation (Placement(transformation(extent={{-52,-22},{56,-2}})));
  OpenHydraulics.Basic.VariableRestriction variableRestriction
    annotation (Placement(transformation(extent={{82,24},{62,44}})));
equation
  connect(realExpression.y, variableRestriction.control) annotation (Line(
        points={{61.4,-12},{72,-12},{72,26}},         color={0,0,127}));
  connect(variableRestriction.port_b, flowSensor.port_b)
    annotation (Line(points={{62,34},{-6,34}}, color={255,0,0}));
  connect(IN, flowSensor.port_a) annotation (Line(points={{-102,30},{-64,30},{-64,
          34},{-26,34}}, color={255,0,0}));
  connect(variableRestriction.port_a, OUT) annotation (Line(points={{82,34},{148,
          34},{148,30},{218,30}}, color={255,0,0}));
  annotation (
    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{220,
            160}}), graphics={
        Line(points={{-92,30},{-20,30},{-2,30}}, color={0,0,0}),
        Ellipse(extent={{-2,52},{44,6}}, lineColor={0,0,0}),
        Line(points={{44,30},{60,50},{60,10},{78,50},{78,8},{96,50},{96,10},{118,50}}, color={0,0,0}),
        Line(points={{98,70},{138,30}}, color={0,0,0}),
        Line(points={{138,30},{98,-10}}, color={0,0,0}),
        Line(points={{138,30},{216,30}}, color={0,0,0}),
        Text(
          extent={{-134,74},{-68,38}},
          lineColor={0,0,0},
          lineThickness=0.5,
          textString="IN"),
        Text(
          extent={{186,78},{252,42}},
          lineColor={0,0,0},
          lineThickness=0.5,
          textString="OUT")}),
    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
            220,160}}), graphics={Text(
          extent={{-92,156},{210,114}},
          lineColor={28,108,200},
          textString="CLAPET ANTI-CHUTE
Je recherche ici a utiliser le VariableFlow comme un Go/No Go
Si le flux mesuré auflowSensor est inférieur à la valeur du tarage du clapet, le flux passe librement.
Si le flux mesuré au flowSensor est supérieur à la valeur du tarage du clapet, le flux est bloqué."),
                                                                                     Text(
          extent={{-58,-24},{212,-98}},
          lineColor={238,46,47},
          textStyle={TextStyle.Bold},
          textString="if ((Tarage*(1/60000)) < (flowSensor.y)) then 0 else 1")}),
    uses(OpenHydraulics(version="1.0"),
      OpenHydraulics_mod(version="1.0"),
      Modelica(version="3.2.2")));
end Clapet_Anti_Chute_Debit_OK;

Feb-27-20 09:46:20
Modeling of an anti-fall valve

Unfortunately I can't, I can't download anything from my work computer (security).
Doesn't my problem mean anything to you? The component seems so simple to model ...

Feb-27-20 07:26:49
Modeling of an anti-fall valve

Good morning all !
The objective of my modeling is to model an anti-fall valve which, when it has a too high input flow (adjustable), closes.

So here is what I modeled :

So I put two ports (one input and one output). In between, a FlowSensor followed by a Variable Restriction. As a signal of this restriction, I put the following equation:

if ((Tarage*(1/60000)) < (flowSensor.y)) then 0 else 1



The value of my flow entering my system is 60 l / min. When I adjust my valve below this value, I have this following message:
Model error - differentiated if-then-else was not continuous:
(if clapet_Anti_Chute_Debit_OK.Tarage*1.6666666666666667E-05 < clapet_Anti_Chute_Debit_OK.flowSensor.y then thenExpression0_ else elseExpression1_)
Value jumped from 1 to 0.

Do you have an idea to help me? I've been blocking for days ...

Thank you !!



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