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

Please correct my model

Please correct my model

Pls correct my model i am getting lot of errors and i want to know whether i need to declare two time one for model and one for equation.the error also i am attaching

Check of Unnamed1:

Resolve error: No match for overloaded binary operator '/'
in the equation
v_t = Q0/C*2.718281828459045^( -t/(R2*C))+V0-I*R1-I*R2*(1-2.718281828459045^( -t /(R2*C)));

Missing declarations.

Check aborted.

ERRORS have been issued.


model Unnamed1
  Modelica.Electrical.Analog.Basic.Resistor R1(R=0.015)
    annotation (Placement(transformation(extent={{-58,26},{-38,46}})));
  Modelica.Electrical.Analog.Basic.Resistor R2(R=0.005)
    annotation (Placement(transformation(extent={{-18,26},{2,46}})));
  Modelica.Electrical.Analog.Basic.Capacitor C(C=5.7)
    annotation (Placement(transformation(extent={{-16,0},{4,20}})));
  Modelica.Electrical.Analog.Sources.SignalVoltage V0
   annotation (Placement(
        transformation(
        extent={{-10,-10},{10,10}},
        rotation=90,
        origin={-76,-14})));
  Modelica.Electrical.Analog.Interfaces.PositivePin n1
                "Negative pin"
    annotation (Placement(transformation(extent={{66,26},{86,46}})));
  Modelica.Electrical.Analog.Interfaces.NegativePin p1
    annotation (Placement(transformation(extent={{-44,-56},{-24,-36}})));
  Modelica.Blocks.Routing.RealPassThrough realPassThrough
    annotation (Placement(transformation(extent={{-130,-24},{-110,-4}})));
  Modelica.Electrical.Analog.Basic.Ground ground
    annotation (Placement(transformation(extent={{-86,-64},{-66,-44}})));
  Modelica.Blocks.Interfaces.RealInput u
    annotation (Placement(transformation(extent={{-188,-34},{-148,6}})));


  parameter Real Q0=2600 "Nominal Capacity";
  Real t "time";
  Real I "current";
  Real v_t "time dependent cell voltage";

equation
  v_t=Q0/C*(Modelica.Constants.e^(-t/(R2*C)))+V0-I*R1-I*R2*(1-Modelica.Constants.e^(-t/(R2*C)));

    connect(V0.n, R1.p)
    annotation (Line(points={{-76,-4},{-76,36},{-58,36}}, color={0,0,255}));
  connect(R1.n, R2.p)
    annotation (Line(points={{-38,36},{-18,36}}, color={0,0,255}));
  connect(C.p, R2.p) annotation (Line(points={{-16,10},{-28,10},{-28,36},{-18,36}},
        color={0,0,255}));
  connect(V0.p, p1) annotation (Line(points={{-76,-24},{-76,-44},{-34,-44},{-34,
          -46}}, color={0,0,255}));
  connect(R2.n, n1) annotation (Line(points={{2,36},{76,36}}, color={0,0,255}));
  connect(C.n, n1)
    annotation (Line(points={{4,10},{8,10},{8,36},{76,36}}, color={0,0,255}));
  connect(realPassThrough.y, V0.v)
    annotation (Line(points={{-109,-14},{-83,-14}}, color={0,0,127}));
  connect(V0.p, ground.p)
    annotation (Line(points={{-76,-24},{-76,-44}}, color={0,0,255}));
  connect(realPassThrough.u, u)
    annotation (Line(points={{-132,-14},{-168,-14}}, color={0,0,127}));
  annotation (uses(Modelica(version="3.2.2"), ElectricalEnergyStorage(version=
            "3.2.2"),
      Battery(version="2.1")),
    Diagram(coordinateSystem(extent={{-180,-100},{100,100}})),
    Icon(coordinateSystem(extent={{-180,-100},{100,100}})));
end Unnamed1;

There are 0 guests and 0 other users also viewing this topic
You are here: