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

Error in defining a time-varying variable

Error in defining a time-varying variable

Hello All,

I have a model that simulate the behavior of a battery. It is composed by different DAEs. Now it works using a constant current but I am trying to get some results using a time-varing current. I noticed that in Modelica -> Electrical -> Analog -> Sources there is a huge quantity of different current inputs that I could use to define the variable (Real) current in my model.

Is there a way to introduce in a model a already-existing block?

For instance, I am trying to give as input in my model the stepCurrent (contained in Source library) but I am getting back an error.

This is the way I coded:

model battery

//definition of variables and parameters

// II1C is the current

import Modelica.Electrical.Analog.Sources.PulseCurrent;
Real II1C = PulseCurrent(I = 10, period = 500, width = 50,offset=0);

equation

// DAE system which is also function of II1C.

end battery;


This is the error message I got:


[1] 19:22:01 Translation Error
[BatteryModelDischarging: 15:1-15:68]: Looking for a function .Modelica.Electrical.Analog.Sources.PulseCurrent but found a model.

[2] 19:22:01 Translation Error
Error occurred while flattening model BatteryModelDischarging


Is there a way to make this work?

Thank you so much in advance,

Kindest regards, Gabri

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