OpenModelica


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » oki_sir
  • » Profile

Posts

Posts

HI,
I am just install latest nightly build OM 1.9.3-dev1036

I am try overrideFile  with this command. -overrideFile c:/omfiles/a.txt            OMEdit gives error.

assert | debug | <p>simulation_input_xml.cpp: usage error you cannot have both -override and -overrideFile active at the same time. see Model -? for more info!</p>

I also try -override Cell1.SOCini=0.95 , then i got below error.

stdout | warning | <p>each command line option can only be used once: -override</p>

I also try without -override still get error.

How can override file?

Thanks

Jul-02-15 19:29:03
Topic: test.exe

Hi,
At the windows, I create test.mo model  and run Model with OMShell (.mos script)
OM create test.exe file.

I need to know capability of test.exe file.

test.exe -output=variable  is giving me variable value of  simulation stopTime. How can get value at different time?

Thanks

Oki

Hi There,
I do assign boolean  value to variable with when command.
such as below sample.

Code:


  when condition1  then
    x = true;
  end when;

and then i want to re-assign new value with new condition.

Code:


  when condition2  then
    x = false;
  end when;

But OM give me this error.  " Error: Model is structurally singular, error found sorting equations "

How can re-assign  x  value after when condition.

Thanks

Oki

HI There,
I want to override combiTable output with change integer x value. But i got few equation error.   It is looks ok to me.
How can fix this. or is there any suitable  approach for change  prescribedTemperature inputs?

Thanks

Oki

Code:


model cCc
  Integer x(start = 1);
  Modelica.Blocks.Sources.CombiTimeTable Table1(tableOnFile = true, tableName = "tmp", fileName = "C:/om/temperature.txt", columns = 2:5);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature Temp1 ;
equation
  connect(Table1.y[x], Temp1.T);
  annotation(experiment(StopTime = 10));
end cCc;

Jun-22-15 00:28:43
Topic: counter

Hi,
I want to count up real parameter during if condition happen.
But i got simulation crashed.
Please help, Thanks

Code:


Real x (starr=1);
equation
  if out1 then
    x = x+1;
  else
    x=1;
  end if;

Hi,
I have same sewuential comonent. Let's say 24  Battery Cell  named CELL1, CELL2 .... CELL24
I want to connect all those cell with for loop .

Code:


for i in 1:24 loop
    connect(CELL(i).pin_n, CELL(i+1).pin_p);
    ...
  end for;

How can i do that?
Thanks
Oki

Hi There,
I want to compare VoltageSensor vMeter.v with 26.5 volt raference voltage.
If vMeter.v>26.5 then do something else ....

But with this code vMeter.v always act like bigger then 26.5. I know during simulation vMeter goes to below 26.5.

What's wrong?
Do you have any idea?

Oki



Code:


model lab2b
  parameter Real xPnom(start = 1500);
  Real xIdc;
  Modelica.Blocks.Interfaces.RealInput Pneed;
  Modelica.Electrical.Analog.Interfaces.NegativePin pin_n;
  Modelica.Electrical.Analog.Interfaces.PositivePin pin_p;
  Modelica.Electrical.Analog.Sensors.VoltageSensor vMeter;
  Modelica.Blocks.Tables.CombiTable1D Tnd1(tableOnFile = true, tableName = "leff", fileName = "C:/p/deff.txt");
  Modelica.Electrical.Analog.Sources.SignalCurrent SD;
equation
  Tnd1.u[1] = Pneed / xPnom;
  xIdc = Pneed / vMeter.v * Tnd1.y[1];
  if vMeter.v > 26.5 then
    SD.i = 10;
  else
    SD.i = 0;
  end if;
  connect(SD.n, pin_n);
  connect(SD.p, pin_p);
  connect(vMeter.n, pin_n);
  connect(vMeter.p, pin_p);
end lab2b;

Hi There,
I am looking for PowerSystems library.
I want to experience  PowerSystems.Examples.Spot.AC3ph.Transformer example.
But i got equation error. The model has 212 equation(s) and 226 variable(s).

Did anyone simulate this example?

Thanks
Oki

I got it,
Thnaks
Oki

I want to use this png at the web interface

Oki

I also noticed; I was connect linux  via ssh.
When i try to run OMPlot local terminal , i got all plot at the screen.
Still i am looking for solution via ssh save plot to png

Thnaks
Oki

By the  way  i just noticed; linux also have  OMPlot. But when tried with below cmd

OMPlot --filename=.... --plotAll

i got OMPlot cannot connect to X server

actualy i am interesing save to png file. Not plot to screen

oki

Hi,
I am using linux distro.
How can save mi simulation result  plot  to png file?
At Windows there is OMPlot.exe but at linux  i don't know.
Thnaks

Oki


with ubuntu 14.04   I installed openmodelica w/o any error.
Thank you.

Oki

Alright,
I will freshly install Ubuntu 14.04.2 LTS , then i'll try installation procedure again.

Thanks anyway,

Oki

So, for OMC version, i got this,

sudo apt-get install omc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
omc : Depends: sun-java6-jre but it is not installable or
                openjdk-6-jre but it is not going to be installed
       Depends: build-essential but it is not installable
       Depends: gnuplot but it is not installable
       Depends: xsltproc but it is not installable
       Depends: libf2c2-dev but it is not installable
       Depends: libexpat1-dev but it is not installable
       Depends: libsundials-serial-dev but it is not installable
       Depends: liblapack-dev but it is not installable
       Depends: libhdf5-7 but it is not installable
       Depends: libhwloc5 but it is not installable
       Depends: liblapack3 but it is not installable or
                liblapack.so.3 but it is not installable or
                libatlas3-base but it is not installable
       Depends: libomniorb4-1 (>= 4.1.6) but it is not installable
       Depends: libomnithread3c2 (>= 4.0.6) but it is not installable
       Recommends: python-beautifulsoup but it is not installable
       Recommends: omplot but it is not going to be installed
       Recommends: libsaxonb-java but it is not installable
E: Unable to correct problems, you have held broken packages.

Hi Martin,

You're right. I got several  om package.

sudo apt-cache policy | grep openmodelica
500 http://build.openmodelica.org/apt/ raring/release i386 Packages
     release o=openmodelica.org,a=raring,n=raring,l=OpenModelica Repository,c=release
     origin build.openmodelica.org
500 http://build.openmodelica.org/apt/ raring/release amd64 Packages
     release o=openmodelica.org,a=raring,n=raring,l=OpenModelica Repository,c=release
     origin build.openmodelica.org

How can remove others?
Oki

Hi there,
I have ubuntu 13.04. I tried  install openmodleica with given description at below web page.

https://openmodelica.org/download/download-linux

But i didn't success yet.

First:
What this line suppose to do?
for deb in deb deb-src; do echo "$deb http://build.openmodelica.org/apt `lsb_release -cs` stable"; done | sudo tee /etc/apt/sources.list.d/openmodelica.list

I checked fingerprint with: apt-key fingerprint, i got this which i expect.

pub   2048R/64970947 2010-06-22
      Key fingerprint = D229 AF1C E5AE D74E 5F59  DF30 3A59 B536 6497 0947
uid                  OpenModelica Build System <build@openmodelica.org>
sub   2048R/E4012527 2010-06-22

then;
When i tried

sudo apt-get update
sudo apt-get install openmodelica

i got this error:

user@user-Dell:~$ sudo apt-get install openmodelica
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
openmodelica : Depends: omc but it is not going to be installed
                Depends: ompython but it is not going to be installed
                Depends: omplot but it is not going to be installed
                Depends: omshell but it is not going to be installed
                Depends: omshell-terminal but it is not going to be installed
                Depends: omnotebook but it is not going to be installed
                Depends: drmodelica but it is not going to be installed
                Depends: drcontrol but it is not going to be installed
                Depends: omedit but it is not going to be installed
                Depends: omoptim but it is not going to be installed
E: Unable to correct problems, you have held broken packages.



What's wrong ? Can samobody help please?

Oki

Thanks anyway adpro

Oki

Hi adpro,
ModelicaUserGuide 1.9.1 Chapter 5(page 83)

I tried model.exe -interactive -port 10500  (this call server machine)
Then  try to communicate with client machine via socket connection. 

My goal is getting simulation result from  server machine using socket connection

oki

I got it.

According userguide.pdf i can communicate model.exe with socket/port connection, right?
How can i communicate model.exe?

Thanks
oki


Thanks adpro,
with  Model.exe -override stopTime=0.2 -output R1.v      model_res.mat file not effected right?
Only with simulation  model_res.mat file  will change.

Oki

First of all, Thanks for your answer,
My simulation timing: startTime=0, stopTime=1

model.exe -output R1.v     then i get,

time=1, R1.v=.0.234567..

How can i  value of R1.v at  0.2 second?

With override R1.R value we do not need simulation again for new result value  right?

How can plot (R1.v) ?

Thanks

Oki


Hi there,
With  OMShell  simulation("model.mo"), OM creates  model.exe file.

How can i use  model.exe?

How can get specifit value of parameters at specific time?
How can override model.exe?

Thanks

Oki

sure, thanks anyway

current/smile

Because; i want to keep same type of  variables  in one file. For example, i got 8 resistor,capacitance and SOCini.
I want to change dynamically only resistors inside  for loop it is easy to manipulate files. Thats why.

Oki

How can  overrideFile with two files?

I tried this line. I do not got any error, but only a.txt override. b.txt not proceeed.

simulate(allnew,stopTime=6000,simflags="-overrideFile a.txt,b.txt");

Thanks
Oki

Hi,
I can read or write fie OMShell with below syntax w/o error.

readFile("c:/loop/test.txt");
writeFile("c:/loop/test.txt");

But, I want to delete file with below command,

deleteFile("c:/loop/test.txt");

file  does not deleted.

Do you know why?
Thnaks

Oki



I mean i know print only stdout,
When i try to write array to file i got nothing,

Code:

for i in 0:6 loop

arr[i]:= abs(val(TABLO.y[1],i*1000)-val(vMetre.v,i*1000));
end for;
writeFile("c:/loop/log.txt",String(arr[0])+"\n",append=true);

log.txt  is never create w/o any error. But for testing purposes i try;

Code:


for i in 0:6 loop
arr[i]:= abs(val(TABLO.y[1],i*1000)-val(vMetre.v,i*1000));
end for;
writeFile("c:/loop/log.txt",String(11)+"\n",append=true);

log.txt   created and inside data 11.

Code:


arr := fill(0.0,6);
for i in 0:6 loop
arr[i]:=abs(val(TABLO.y[1],i*1000)-val(vMetre.v,i*1000));
print arr[i];
end for;
print max(arr);

when run script i got; Error: Parse error: Only function call expressions may stand alone in an algorithm section
before use arr() i have to define or something?

Oki

  current/smile  Thanks again
Oki

Ok, How can append result value to array?

Code:


for i in 0:6 loop
v:=abs(val(TABLO.y[1],i*1000)-val(vMetre.v,i*1000));
end for;

current/smile
got it thanks
Oki

Hi,
Modelica scripting language have math library such as ABS(value), MAXIMUM(array)  e.t.c. ?

Thanks

Oki

Mar-12-15 04:53:51
Topic: OMShell
execute from win7

Thanks, I just find out second ago current/smile))

Oki

Mar-12-15 04:50:29
Topic: OMShell
execute from win7

Hi,
I want to execute/run  OMShell with .mos script file   from windows cmd  console or high level  software.
How can i do that?

I am asking like this;
OMShell.exe -open c:/test/a.mos

Thanks
Oki

Mar-12-15 03:17:46
Topic: OMShell
CombiTimeTable get filename

Hi,
I am using OMShell.
After simulation how can i get and override CombiTimeTable  filename?

Thanks

Oki

Thank you,

I want to understand for loop. I run this script with  runScript("test.mos")
result of this script
"0

100
"
I am excepting 0- thru 100 count.  Wht only start and stop value print screen?
Oki



test.mos

Code:


j:=0;
for i in 1:100 loop
j:=j+1;
end for;
j;

Mar-10-15 14:21:48
Topic: OMPython
no result file

Hi again,
I found pdf file. But,

for i in 1:18 loop val(Meter.v,i); end for

this code suppose to be  print val(Meter.v,i) value but not,

What's wrong this code?

Oki




Mar-10-15 13:34:24
Topic: OMPython
no result file

Thank you sjoelund,

So, i want to compare two different parameters inside loop.
I try something like this but it is not working,

for i in 1007:1016 loop i:=i+1; val(Meter1.v,i)-val(Meter2.v) ; end for;

Is there any  documents explain more control about   for, loop, if, while, wend e.t.c.

Oki

Mar-10-15 12:59:48
Topic: OMPython
no result file

Adrian,
Also i am looking for OMShell it is very usable.
Does OMShell have   for next / while wend  type of controls?

Oki

Mar-10-15 12:52:58
Topic: OMPython
no result file

Thank you Adrian,
I think val() only working with .mat result.  For .csv not implemented yet.

Oki

Mar-10-15 02:23:53
Topic: OMPython
no result file

Hi,
I am freshly install OMPython. My OS is win7.
I have simple code such as below.

Code:


from OMPython import OMCSession
OMPython = OMCSession()

print OMPython.execute('loadModel(Modelica)')
print OMPython.execute  ('loadFile(\"C:/loop/test.mo\")')
result = OMPython.execute('simulate(test)')
OMPython.execute("plot(meter.v)")
print result

I have 3 question.
1) I read print result file ..... 'resultFile': '"C:/loop/test.mat"'}  but, there is no test.mat file in c:/loop folder.

2) How can get result file as csv file not mat?

3)If simulation stop time 100 then, how can i get specific time result on screen like meter.v (time =33) ?

Thanks

Oki 

Jan-29-15 18:34:24
How i can pass parameter to cellRecord

Here is my record. But still i got  error

record cp1
  parameter Real newR0 = 0.0022;
  extends ED_EES.CellRecords.StaticResistance.StaticResistanceParameters(SOCOCV = ED_EES.CellRecords.Components.SOCOCV(OCVtableOnFile = true, OCVtableName = "soclist", OCVfileName = "C:/oki/soc.txt"), capacity = ED_EES.CellRecords.Components.ChargeCapacity(C0 = 40 * 3600), Rs = ED_EES.CellRecords.Components.Resistance(R0 = newR0));
  annotation(defaultComponentPrefixes = "parameter");
end cp1;


ERROR:
[C:/ED_EES_Files/temp/d.mo:6:64-6:85] Error: Type mismatch in binding cellParameters = cp11, expected subtype of record ED_EES.CellRecords.StaticResistance.StaticResistanceParameters
  record ED_EES.CellRecords.Components.SOCOCV
  Boolean OCVtableOnFile;
  Real[0, 2] OCVtable;
  String OCVtableName;
  String OCVfileName;
end ED_EES.CellRecords.Components.SOCOCV; SOCOCV;
  record ED_EES.CellRecords.Components.ChargeCapacity
  Real(quantity = "ElectricCharge", unit = "C") C0;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.ChargeCapacity; capacity;
  record ED_EES.CellRecords.Components.Resistance
  Real(quantity = "Resistance", unit = "Ohm") R0;
  record ED_EES.CellRecords.Components.SOCDependency
  Real kSOC;
end ED_EES.CellRecords.Components.SOCDependency; SOC;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.Resistance; Rs;
  record ED_EES.CellRecords.Components.SOH
  Real(min = 0.0, max = 1.0) xc;
  Real(min = 1.0) xz;
end ED_EES.CellRecords.Components.SOH; SoH;
end ED_EES.CellRecords.StaticResistance.StaticResistanceParameters;, got type record cp1
  record ED_EES.CellRecords.Components.SOCOCV
  Boolean OCVtableOnFile;
  Real[0, 2] OCVtable;
  String OCVtableName;
  String OCVfileName;
end ED_EES.CellRecords.Components.SOCOCV; SOCOCV;
  record ED_EES.CellRecords.Components.ChargeCapacity
  Real(quantity = "ElectricCharge", unit = "C") C0;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.ChargeCapacity; capacity;
  record ED_EES.CellRecords.Components.SOH
  Real(min = 0.0, max = 1.0) xc;
  Real(min = 1.0) xz;
end ED_EES.CellRecords.Components.SOH; SoH;
  Real newR0;
  record ED_EES.CellRecords.Components.Resistance
  Real(quantity = "Resistance", unit = "Ohm") R0;
  record ED_EES.CellRecords.Components.SOCDependency
  Real kSOC;
end ED_EES.CellRecords.Components.SOCDependency; SOC;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.Resistance; Rs;
end cp1;.

Jan-29-15 18:15:18
How i can pass parameter to cellRecord

Hi,
I want to change some cell parameter such as internalResistance , chargingCapacity   e.t.c  from Model.

I define parameter like this:

parameter Real newRo=0.003;

and change cellParameter like this;
Rs = ED_EES.CellRecords.Components.Resistance(R0 = newR0);

When i made this change i got below error.

Error: Component cp11.Rs of variability PARAM has binding ED_EES.CellRecords.Components.Resistance(cp11.newR0,  ....

What's wrong with this?

Thanks
Oki

Jan-27-15 22:43:59
read file as a Real

Hi,
I have below test.txt

2.33
3.45
2

I am read firts line of file (2.33)   with  Streams.readLine() commands.
Return value of this command  a string. But actually this value is Real parameter.
How can read this value as a Real variable?
OM have stringtoReal function or something?

Thanks

oki

Jan-27-15 18:46:45
Its to slow.

My MSL is 3.2.1

Jan-27-15 18:26:02
Its to slow.

OMedit 1.9.1. r22929
What is MSL?

I am working on Win7.  loadSource section is very quick. But  .readRealParameter() is not.
URI mean file path on PC right: In this case "c:/oki/test.txt"

Jan-26-15 13:40:10
Its to slow.

Hi,
I am try to read  variables  from file.

Here is file:
test.txt
a = 2;
b = 3;
c = 4;

Here is the Code:
parameter String file = Files.loadResource("c:/oki/test.txt");
  parameter Real a = Examples.readRealParameter(file, "a");
  parameter Real b = Examples.readRealParameter(file, "b");
  parameter Real c = Examples.readRealParameter(file, "c");

Simulation is extremely slow. PC read this three variables  almost 7-9 seconds.
Finally , variables read but some errors.

Do you have any idea what's wrong?

Oki

Here is Errors:
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_scanToken':
rd2_functions.c:149: warning: passing argument 7 of 'mmc_mk_box6' discards qualifiers from pointer target type
C:/OpenModelica1.9.1//include/omc/c/meta/meta_modelica_mk_box.h:57: note: expected 'void *' but argument is of type 'modelica_string'
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Streams_readLine':
rd2_functions.c:175: warning: return discards qualifiers from pointer target type
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_repeat':
rd2_functions.c:605: warning: return discards qualifiers from pointer target type
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_scanDelimiter':
rd2_functions.c:717: warning: return discards qualifiers from pointer target type
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_substring':
rd2_functions.c:829: warning: return discards qualifiers from pointer target type
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_Advanced_scanIdentifier':
rd2_functions.c:851: warning: passing argument 4 of 'omc_Modelica_Utilities_Strings_Advanced_scanIdentifier' from incompatible pointer type
rd2_functions.c:831: note: expected 'const char **' but argument is of type 'void **'
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_Advanced_scanString':
rd2_functions.c:982: warning: passing argument 4 of 'omc_Modelica_Utilities_Strings_Advanced_scanString' from incompatible pointer type
rd2_functions.c:962: note: expected 'const char **' but argument is of type 'void **'
rd2_functions.c: In function 'boxptr_Modelica_Utilities_Strings_scanDelimiter_concatenate':
rd2_functions.c:1043: warning: return discards qualifiers from pointer target type

Jan-18-15 21:53:33
import record or class from file

Hi,
How i can import record or class from file ?
For example;  if i want to load  below file my BatteryCell's   cellParemeter , how can do that?


c:/test/myfile.mo

record Test1Parameters
  extends Modelica_EnergyStorages.CellRecords.LinearDynamicImpedance.LinearDynamicImpedanceParameters(SOCOCV = Modelica_EnergyStorages.CellRecords.Components.SOCOCV(OCVtableOnFile = true, OCVtableName = "soclist", OCVfileName = "C:/oki/soc.txt"), capacity = Modelica_EnergyStorages.CellRecords.Components.ChargeCapacity(C0 = 40 * 3600), Rs = Modelica_EnergyStorages.CellRecords.Components.Resistance(R0 = 0.0001), RC = {Modelica_EnergyStorages.CellRecords.Components.RCelement(Rd = Modelica_EnergyStorages.CellRecords.Components.Resistance(R0 = 0.0001), Cd = Modelica_EnergyStorages.CellRecords.Components.Capacitance(C0 = 50000))});
  annotation(defaultComponentPrefixes = "parameter", Icon(graphics));
end Test1Parameters;

Jan-05-15 20:09:27
SerialPort Object

Hi,
I am looking for serial port object  allow  communication  between OM model and  other PC via serial Port (RS232 or RS485)
Anyone knows about it?

Oki

Jan-05-15 02:09:22
BatteryPack to BatteryManagement.Cycling Connection Error

Hi,
I build up below model. I am connection BatteryPack to BatteryManagement,Cycling unit  via BusConnection.
If i choose BatteryPack only one cell and Cycling only 1 cell, everything is work as i expect.

But; if i change batterPack like 8 cell serial and also change Cycling object 8 serial cell, there is equation error.
Do you have any idea  what's going on?

Thnaks
Oki



model x
  Modelica_EnergyStorages.BatteryManagement.VoltageCycling BM(ns = 1, np = 1, Ifinal = 2, Vmax = 3.55, Vmin = 2.8, delayAfterCharging = 100, delayAfterDischarging = 100) annotation(Placement(visible = true, transformation(origin = {-40, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Ground GND annotation(Placement(visible = true, transformation(origin = {0, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sensors.VoltageSensor VMeter annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica_EnergyStorages.Sources.Loads.CCCV LOAD(Vmin = 2.8, Imax = 40) annotation(Placement(visible = true, transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica_EnergyStorages.Batteries.Stacks.WithMeasurement.StaticResistanceScaled BPack(ns = 1, np = 1, SOCini = 0.9, cellParameters = Modelica_EnergyStorages.CellRecords.StaticResistance.Test1Parameters()) annotation(Placement(visible = true, transformation(origin = {-40, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sensors.CurrentSensor IMeter annotation(Placement(visible = true, transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(VMeter.v, LOAD.v) annotation(Line(points = {{-10, -6.12303e-16}, {-10, 0}, {-18.0602, 0}, {-18.0602, -22.7425}, {27.0903, -22.7425}, {27.0903, -6.35452}, {31.1037, -6.35452}, {31.1037, -6.35452}}, color = {0, 0, 127}));
  connect(IMeter.n, LOAD.pin_p) annotation(Line(points = {{10, 40}, {40.4682, 40}, {40.4682, 10.0334}, {40.4682, 10.0334}}, color = {0, 0, 255}));
  connect(BPack.pin_pStack, IMeter.p) annotation(Line(points = {{-40, 9.4}, {-39.7993, 9.4}, {-39.7993, 40.4682}, {-9.36455, 40.4682}, {-9.36455, 40.4682}}, color = {0, 0, 255}));
  connect(BPack.cellBus, BM.singleCellBus[1, 1]) annotation(Line(points = {{-49.6, 0}, {-60.2007, 0}, {-60.2007, -59.8662}, {-50.1672, -59.8662}, {-50.1672, -59.8662}}, color = {255, 204, 51}));
  connect(BM.Discharging, LOAD.on) annotation(Line(points = {{-29, -54}, {-16.0535, -54}, {-16.0535, -29.097}, {23.0769, -29.097}, {23.0769, 0}, {31.1037, 0}, {31.1037, 0}}, color = {255, 0, 255}));
  connect(VMeter.n, BPack.pin_nStack) annotation(Line(points = {{6.12303e-16, -10}, {6.12303e-16, -20.7358}, {-39.7993, -20.7358}, {-39.7993, -9.699}, {-39.7993, -9.699}}, color = {0, 0, 255}));
  connect(VMeter.p, BPack.pin_pStack) annotation(Line(points = {{-6.12303e-16, 10}, {-6.12303e-16, 22.0736}, {-39.7993, 22.0736}, {-39.7993, 9.36455}, {-39.7993, 9.36455}}, color = {0, 0, 255}));
  connect(LOAD.pin_n, GND.p) annotation(Line(points = {{40, -10}, {40.4682, -10}, {40.4682, -34.7826}, {0, -34.7826}, {0, -51.505}, {0, -51.505}}, color = {0, 0, 255}));
  connect(BPack.pin_nStack, GND.p) annotation(Line(points = {{-40, -9.4}, {-39.7993, -9.4}, {-39.7993, -34.7826}, {0, -34.7826}, {0, -50.1672}, {0, -50.1672}}, color = {0, 0, 255}));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
  annotation(experiment(StopTime = 5000, Interval = 1), Diagram(graphics));
end x;

Jan-04-15 21:29:25
How can change booleanStep startTime variable via realExpression

Hi,
How can  change booleanStep startTime variable via realExpression value?

Thanks

Jan-02-15 18:16:32
Real Input From table

Hi,
I want to modifiy OM Model. Model have  a realEXpression  user enter value before simulation. I want to change realExpresssion with time table.
How can i do that?

https://openmodelica.org/images/agorapro/attachments/4218/mini_TABLE.jpg


Thanks

Oki

Hi,

batt5.mo

I am trying simple battery pack discharge circuit as i attached.

There is less equation but more variables I don't know  why?

Do you guys have any idea?

Thanks

Jan-01-15 01:09:11
logic to boolean connection error

Hi,
I want to use logic to boolean converter. For logic source  i am using Electrical.Digital.Source.Step object. Also i use Electrical.Digital.Converter.LogicToBoolean component. When i try to connect two pin  i saw Connect Array message (Enter Index ). I try enter1 but i got:

"[C:/OpenModelica1.9.1/lib/omlibrary/oki/test.mo:7:50-7:60:writable] Error: Type mismatch in binding before = 1, expected subtype of enumeration('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'), got type Integer.
Error: Error occurred while flattening model test

What i suppose to enter?

Dec-31-14 04:42:53
discharge current

Hi Ceraolo,
I use  Analog.Source.TableCurrent. But i got below error.

[C:/OpenModelica1.9.1/lib/omlibrary/Modelica 3.2.1/Blocks/Sources.mo:2080:5-2080:19] Error: Model is structurally singular, error found sorting equations
17: 0.0 = tablecurrent1.signalSource.a * time + tablecurrent1.signalSource.b;
18: algorithm
.....

Here is my test circuit.

batt2.mo

Could you please check device, whats wrong with

Thanks
Oki

Dec-31-14 01:20:51
discharge current

Hi Ceraolo,
There is a component called  tableCurrent. I this what i am looking for. Thanks anyway...
OKi

Dec-31-14 01:11:16
discharge current

Hi Ceraolo,
Thanks for your answer.
I know stepCurrent component.  But i need  something with more  step like this.
https://openmodelica.org/images/agorapro/attachments/4218/mini_pattern.jpg

For example i can read from table time,current rate e.t.c

Is there ayy way to do this?

Thanks

Oki

Dec-30-14 05:22:21
discharge current

Hi,
I have question about OM EnergyStorages library.

I designed basic discharging circuit atteched below.

batt1.mo

I want to change CC load discharging current during to simulation. I mean ; first 500 second  dicharging 20 amps, then next 500 second discharging current gonna be 40 amps. Is that possible?

Thnaks

Oki

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