Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update getParameters when rebuilding model #50

Merged
merged 1 commit into from
Aug 2, 2021

Conversation

arun3688
Copy link
Contributor

@arun3688 arun3688 commented Aug 2, 2021

Related issues

#47

Purpose

This PR fixes the bug in getParameters() with new values set by users using setParameters() API. after rebuilding the model using buildModel().

Example

using OMJulia
mod = OMJulia.OMCSession()
ModelicaSystem(mod, "Test.mo", "Test.Example")
getParameters(mod)
## use the setParameters() API 
setParameters(mod, "c=9")
buildModel(mod)
simulate(mod)
c = getParameters(mod, "c")
x = getSolutions(mod, "x")[end][end]
println("c  = ", c, "\tx = ", x)

output

c = 9 x = 0.001109553030142552

@arun3688 arun3688 merged commit fd5e1ea into OpenModelica:master Aug 2, 2021
@arun3688 arun3688 deleted the updategetParameters branch August 4, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant