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

Posts

Posts

Jul-20-20 07:08:44
I am trying to store in a vector a sum of 12 RealInput scalars values (after each 12 step of the...
Category: Programming

Hello,

I am new in OpenModelica.
I want to store a sum of 12 values in an array while simulating my model.
Those values in the sum come from a RealInput (GsPPV) so that the programme cumulate them in my new array.
And I want to plot this new array at the end of the simulation. Nothing works!

Thanks !

You can find my model code below :

model PowerPPV

  parameter Real surf = 78;
  // Surface totale des panneaux

  parameter Real R = 0.17;
  // Rendement des modules

  Modelica.Blocks.Interfaces.RealInput  GsPPV"Global Solar PPV"annotation(
    Placement(visible = true, transformation(origin = {-92, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-50, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

  Modelica.Blocks.Interfaces.RealOutput Pelec"Puissance électrique" annotation(
    Placement(visible = true, transformation(origin = {80, -4}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {52, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 
  equation
    Pelec = GsPPV*surf*R;
   
   
  annotation(
    experiment(StartTime = 0, StopTime = 86400, Tolerance = 1e-06, Interval = 300),
    Diagram,
    Icon(coordinateSystem(initialScale = 0.1), graphics = {Rectangle(origin = {-16, 2}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-44, 26}, {76, -34}}), Text(origin = {0, -1}, extent = {{-28, -11}, {28, 11}}, textString = "PowerPPV")}),
    __OpenModelica_simulationFlags(lv = "LOG_STATS", maxIntegrationOrder = "4", s = "dassl"));

end PowerPPV;


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