pyFMI Python simulation different number of output points





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















How to pricisely control the number of model outputs



I get an different number of output points based on different input parameters:



model = load_fmu("Trial.fmu") # 64 Bit generated FMU with Dymola+Buildsyspro 
tstart = model.get_default_experiment_start_time() #### START TIME
tstop = model.get_default_experiment_stop_time() #### STOP TIME
opts = model.simulate_options () # Setting the output number of outputs
opts['ncp']=194 ## Want to have exactly 194 data points


foo is a function to convert parameters into the righ format
thetaInit are the initial values of paramaters



results=model.simulate(input=foo(thetaInit),options=opts, start_time=tstart, final_time=tstop)

len(results['DC_Power')
267


Changing the initial parameters values by multiplying them with 0.9



results2=model.simulate(input=foo(thetaInit*0.9),options=opts, start_time=tstart, final_time=tstop)
len(results['DC_Power')
263


For calibration issues I need to have the same number of output points. If somebody has a clue how to control this.










share|improve this question




















  • 1





    I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

    – Hans Olsson
    Nov 16 '18 at 17:00


















2















How to pricisely control the number of model outputs



I get an different number of output points based on different input parameters:



model = load_fmu("Trial.fmu") # 64 Bit generated FMU with Dymola+Buildsyspro 
tstart = model.get_default_experiment_start_time() #### START TIME
tstop = model.get_default_experiment_stop_time() #### STOP TIME
opts = model.simulate_options () # Setting the output number of outputs
opts['ncp']=194 ## Want to have exactly 194 data points


foo is a function to convert parameters into the righ format
thetaInit are the initial values of paramaters



results=model.simulate(input=foo(thetaInit),options=opts, start_time=tstart, final_time=tstop)

len(results['DC_Power')
267


Changing the initial parameters values by multiplying them with 0.9



results2=model.simulate(input=foo(thetaInit*0.9),options=opts, start_time=tstart, final_time=tstop)
len(results['DC_Power')
263


For calibration issues I need to have the same number of output points. If somebody has a clue how to control this.










share|improve this question




















  • 1





    I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

    – Hans Olsson
    Nov 16 '18 at 17:00














2












2








2








How to pricisely control the number of model outputs



I get an different number of output points based on different input parameters:



model = load_fmu("Trial.fmu") # 64 Bit generated FMU with Dymola+Buildsyspro 
tstart = model.get_default_experiment_start_time() #### START TIME
tstop = model.get_default_experiment_stop_time() #### STOP TIME
opts = model.simulate_options () # Setting the output number of outputs
opts['ncp']=194 ## Want to have exactly 194 data points


foo is a function to convert parameters into the righ format
thetaInit are the initial values of paramaters



results=model.simulate(input=foo(thetaInit),options=opts, start_time=tstart, final_time=tstop)

len(results['DC_Power')
267


Changing the initial parameters values by multiplying them with 0.9



results2=model.simulate(input=foo(thetaInit*0.9),options=opts, start_time=tstart, final_time=tstop)
len(results['DC_Power')
263


For calibration issues I need to have the same number of output points. If somebody has a clue how to control this.










share|improve this question
















How to pricisely control the number of model outputs



I get an different number of output points based on different input parameters:



model = load_fmu("Trial.fmu") # 64 Bit generated FMU with Dymola+Buildsyspro 
tstart = model.get_default_experiment_start_time() #### START TIME
tstop = model.get_default_experiment_stop_time() #### STOP TIME
opts = model.simulate_options () # Setting the output number of outputs
opts['ncp']=194 ## Want to have exactly 194 data points


foo is a function to convert parameters into the righ format
thetaInit are the initial values of paramaters



results=model.simulate(input=foo(thetaInit),options=opts, start_time=tstart, final_time=tstop)

len(results['DC_Power')
267


Changing the initial parameters values by multiplying them with 0.9



results2=model.simulate(input=foo(thetaInit*0.9),options=opts, start_time=tstart, final_time=tstop)
len(results['DC_Power')
263


For calibration issues I need to have the same number of output points. If somebody has a clue how to control this.







python optimization modelica dymola fmi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 14:34







kelamahim

















asked Nov 16 '18 at 14:07









kelamahimkelamahim

701112




701112








  • 1





    I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

    – Hans Olsson
    Nov 16 '18 at 17:00














  • 1





    I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

    – Hans Olsson
    Nov 16 '18 at 17:00








1




1





I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

– Hans Olsson
Nov 16 '18 at 17:00





I assume the reason for the extra points are events. I would assume there is a way of turning off storing values at events in pyFMI; but haven't investigated it yet.

– Hans Olsson
Nov 16 '18 at 17:00












1 Answer
1






active

oldest

votes


















4














As Hans points out the extra points are likely due to events which are stored by default (on top of the ncp). Disabling storing of the event points can be done using:



model = load_fmu(...)
opts = model.simulate_options()
opts["CVode_options"]["store_event_points"] = False

res = model.simulate(options=opts)





share|improve this answer
























  • was exactly what I was looking for!

    – kelamahim
    Nov 19 '18 at 12:49












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339436%2fpyfmi-python-simulation-different-number-of-output-points%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














As Hans points out the extra points are likely due to events which are stored by default (on top of the ncp). Disabling storing of the event points can be done using:



model = load_fmu(...)
opts = model.simulate_options()
opts["CVode_options"]["store_event_points"] = False

res = model.simulate(options=opts)





share|improve this answer
























  • was exactly what I was looking for!

    – kelamahim
    Nov 19 '18 at 12:49
















4














As Hans points out the extra points are likely due to events which are stored by default (on top of the ncp). Disabling storing of the event points can be done using:



model = load_fmu(...)
opts = model.simulate_options()
opts["CVode_options"]["store_event_points"] = False

res = model.simulate(options=opts)





share|improve this answer
























  • was exactly what I was looking for!

    – kelamahim
    Nov 19 '18 at 12:49














4












4








4







As Hans points out the extra points are likely due to events which are stored by default (on top of the ncp). Disabling storing of the event points can be done using:



model = load_fmu(...)
opts = model.simulate_options()
opts["CVode_options"]["store_event_points"] = False

res = model.simulate(options=opts)





share|improve this answer













As Hans points out the extra points are likely due to events which are stored by default (on top of the ncp). Disabling storing of the event points can be done using:



model = load_fmu(...)
opts = model.simulate_options()
opts["CVode_options"]["store_event_points"] = False

res = model.simulate(options=opts)






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '18 at 20:58









Christian WintherChristian Winther

7831615




7831615













  • was exactly what I was looking for!

    – kelamahim
    Nov 19 '18 at 12:49



















  • was exactly what I was looking for!

    – kelamahim
    Nov 19 '18 at 12:49

















was exactly what I was looking for!

– kelamahim
Nov 19 '18 at 12:49





was exactly what I was looking for!

– kelamahim
Nov 19 '18 at 12:49




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339436%2fpyfmi-python-simulation-different-number-of-output-points%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues