I'm developing a transient model using the Livelink interface. The model first calculates an initial solution for the first time window, then I would like to modify the state variable values due to some external disturbance using MATLAB, then proceed to rerun the model for the next time window using the newly adjusted values of some of the variables, but the other variables should be retained from the previous solution iteration.
When I prescribe the use of the previous solution for subsequent iterations as:
model.sol('sol1').feature('v1').set('initmethod', 'sol');
model.sol('sol1').feature('v1').set('initsol', 'sol1');
it seems that the specification of initial conditions through either
model.variable('var15').set('X0', num2str(X0));
or
model.init('init4').set('position',num2str(X0));
are ignored completely and the unchanged values from the previous solution are retained. Is there a plausible method to effectively update some of the variables this way? Perhaps by modifying the dataset of the previous solution?
Thanks.
When I prescribe the use of the previous solution for subsequent iterations as:
model.sol('sol1').feature('v1').set('initmethod', 'sol');
model.sol('sol1').feature('v1').set('initsol', 'sol1');
it seems that the specification of initial conditions through either
model.variable('var15').set('X0', num2str(X0));
or
model.init('init4').set('position',num2str(X0));
are ignored completely and the unchanged values from the previous solution are retained. Is there a plausible method to effectively update some of the variables this way? Perhaps by modifying the dataset of the previous solution?
Thanks.