0

So, here is one of the most basic script you can run in OMShell:

loadFile(getInstallationDirectoryPath() + "/share/doc/omc/testmodels/BouncingBall.mo")
simulate(BouncingBall, startTime=0.0, stopTime=1.0)

Now, the call to simulate is slow and the output indicates that the the compilation is what take the most time:

...
    timeFrontend = 0.0041435,
    timeBackend = 0.003568,
    timeSimCode = 0.0010321,
    timeTemplates = 0.0145525,
    timeCompile = 5.0517363,
    timeSimulation = 0.2011517,
    timeTotal = 5.2764338
...

Now, I would like to run the simulation as quickly as possible. Is there a way to split up the call to simulate so that compilation and simulation is done separately?

It seems I can use buildModel to compile the model but how do I run the model after compilation?

1 Answer 1

1

As you pointed out, you can use buildModel. Afterwards, simply run the executable. If you want to use OMShell, you can call system("./BouncingBall")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.