- Index
- » Users
- » lambu0815
- » Profile
Posts
Posts
Sorry,
not reproducible in a simple case, I'll live with it for now. Should I run into that issue more frequently, I'll come back to you.
Regards - André
I have to correct myself, escaping the quote sign does do the trick, I had a typo in two of the 4 variable names (sinks do not have outputs, right?).
Thank you!
(well - no need trying the overrideFile approach)
thank you for the hint.
escaping the quote sign works "a little". I get 2 out of 4 variable classes.
escaping the pipe doesn't work.
I'll try the file approach on thursday, when I'm back.
thank you.
I'll try to come up with a simple example (day after tomorrow).
Hi,
this should be my last open problem:
From my final simulation I want to keep only a few variables in a .csv file, so I do:
Code:
system("mymodel -override startTime=243,stopTime=391,outputFormat=csv,variableFilter=mixer21.Out.*|mixer22.Out.*|effluentsink1.Out.*|sludgesink1.Out.* -iif start.mat -r results.csv")
When I filter only for one class of variables, e.g. mixer21.Out.* it works just fine, I get all my 16 state variables for that subsystem. Unfortunately it gives me an error (255) when I try more using the pipe (|). I have to admit I'm not very keen on regex. Is it a problem that using "system" my call to variableFilter is already within a string and I can't use the quote sign for the regex? Well, I didn't get it to work with "simulate" either... .
Any comments?
Thank you.
André
Hi again,
I'm slowly getting closer to a solution. My model runs fine when I call it using
Code:
simulate(mymodel, startTime=250,stopTime=260)
When I try to build it first and then run it via system() I get an error "-34".
Code:
buildModel(mymodel)
system("mymodel -override startTime=250,stopTime=260 -r D:\\path\\to\\output.mat")
I can get the build/system approach to work, when I compile startTime and stopTime, too:
Code:
buildModel(mymodel, startTime=250,stopTime=260)
system("mymodel -override startTime=250,stopTime=260 -r D:\\path\\to\\output.mat")
this gives me a "0", everything is fine. (And of course I actually don't even need to override start and stop in the system call. However, it will only then also accept a different startTime=251.)
But then I try to rerun the simulation using the last output as input and get an "-1":
Code:
system("mymodel -override startTime=250,stopTime=260 -iif D:\\path\\to\\output.mat -r D:\\path\\to\\output.mat")
API-Documentation is not accessible (https://github.com/OpenModelica/OpenMod … HowTo.pdf) and I couldn't find any other documentation of error codes.
edit:
the last issue can be omitted, when the start file (output.mat) is read from the current working directory (without path):
Code:
system("mymodel -override startTime=250,stopTime=260 -iif output.mat -r D:\\path\\to\\output.mat")
Oh, this is funny, it works the other way around, too. Init file and output file must obviously not be in the same directory (at least, when they have the same name).
OK: so I have a working solution. Only still would like to understand the "-34" and why I have to compile startTime/stopTime.
Thank you all.
André
oh, that was easy. It seems, R messed up even my few programming skills.
Thank you so much. And incredibly quick.
Hi,
I try to reach a pseudo-steady state to run simulations of a biological system. The idea is to rerun a certain time period several times and always use the latest result as starting point. I first run the model and save the results in mymodel_start.mat:
Code:
system("mymodel -override startTime=255,stopTime=260 -r mymodel_start.mat")
The following also works, using the startfile to run the same model again and writing the results back to that file:
Code:
system("mymodel -override startTime=255,stopTime=260 -iif C:\\OpenModelica1.9.2\\tmp\\mymodel_start.mat -r mymodel_start.mat")
But when I put this simulation in a for-loop, I get an error (see below)
Code:
for i in 1:20 loop
system("mymodel -override startTime=255,stopTime=260 -iif C:\\OpenModelica1.9.2\\tmp\\mymodel_start.mat -r mymodel_start.mat")
end for;
Error occurred building AST
Syntax Error
[<interactive>:1:0-1:3:writable] Error: Parser error: Unexpected token near: for (FOR)
Any suggestions?
Thank you.
Andre
Hi atame,
we have the Wastewater library running since a few weeks. Getting it to run in the first place was admins' job. From what I understood the library loaded just fine but they had to set start values for concentrations (in example plants) to be unequal to zero in order to avoid division by zero.
I than noticed that saving a modified library was not possible in the original format so I save it in a WasteWater.om file.
André
Hi,
my first post here.
I was able to get the old WasteWater library (Reichl) to run in OM including a view OM-related fixes and also extended it by another ASM (actvated sludge model).
In Wastewater treatment, we are dealing with comlex non-steady-state systems. System state initialization is an important step before simulation itself. System states are usually a result of a simulation prerun.
I can't figure out (and didn't find profound information) on how to save a final state (an hopefully the final state only, the "_res.mat" is usually several hundred MB) and than reuse it for initialization.
Any help is appreciated.
Regards.
André
- Index
- » Users
- » lambu0815
- » Profile