I want to run around 100 simulations with my model changing two parameters f and TLoadand track the changes on the phase currents currentSensor.i[1] etc.
Now I'm stuck with the documentation on the Wolfram website because there is no definite explanation on how to use scripting with the SystemModeler. I found for example this link on the Wolfram site with some code but no explanation in which commandline I should use it.
I downloaded the WolframScript program and tried to open my model with wolframscript -file SMPM_VoltageSource_Inverter.mo but it says ToExpression::sntx: Invalid syntax in or before ... eventhouh my model simulates totally fine and without any errors in the SimulationCenter.
Can someone explain to me:
- Is it possible to write scripts ?
If Yes:
- How can I simulate my model?
- How can I do a parameter sweep of
fandTLoad? Is it as described in the link? - Is it possible to export data of
currentSensor.i[1]as a csv-file? And how to?
Thank you for any help!
I don't know about wolfram sorry, but for OpenModelica the following works:
Put this in a file named for example
model.mosand call it from terminal or command line, depending on your os, withomc model.mosif you have OpenModelica installed. this should generate a csv.EDIT: I realized the original just saves the last value of x, you might want the full output. Therefore i changed the
.mos-file. Each different result will be saved in a different file, if you want to change it to csv you just have to change the generated xml.