Closed MohammadHadiAlizadeh closed 1 year ago
Ouch, this shouldn't happen. @arun3688 can you please have a look.
@MohammadHadiAlizadeh @casella I can reproduce the problem in Matlab, based on the initial testing, i can see the configurations works directly from the mos script,
loadFile("test8.mo"); getErrorString();
simulate(test8, startTime=0, stopTime=0, simflags="-override=x_P[1,1]=1,x_P[1,2]=1,x_P[1,3]=1"); getErrorString();
linearize(test8, startTime=0, stopTime=1, simflags="-override=x_P[1,1]=2,x_P[1,2]=2,x_P[1,3]=2"); getErrorString()
Based on initial debugging, i see that if the stopTime is same for both linearize and simulation, then OMMatlab works fine.
I guess, there is some problem in the csv file when setting the inputs, I will debug more and fix it.
@MohammadHadiAlizadeh The issue is fixed with this commit https://github.com/OpenModelica/OMMatlab/commit/837c33c4d53fe6df07b77ae298236200ada19439, pull the changes from master and test it. The problem with infinity loop for data generation happened due to setting linearization options i.e stopTime in two different places, especially in overrideFile
@arun3688 , thanks. I'm closing the issue.
Please consider the following model & Matlab script:
When we use simulation options as
omc.setSimulationOptions(["startTime=0","stopTime=1"]);
the sequential use of simulation and linearization completes successfully.But if we set the simulation options as
omc.setSimulationOptions(["startTime=0","stopTime=0"]);
( in case we want to initialize the model and get the initial states only), the simulation finishes successfully. But when it comes to run linearization, the process does not stop and fills the Windows drive(C:\
in my PC) completely (like an infinity loop for data generation)!!!!!!!However, both the linearization and simulation have simple mathematical solutions in each case!