Closed notesofdabbler closed 3 years ago
I have recreated your problem and think this is a bigger problem than it seems. I suspect that ParameterEstimator does not have any information regarding the fixed trajectories and therefore is overfitting the problem. I am looking into a fix for this now.
I have fixed the issue. It was as I suspected. I will make a pull request for this fix now. In the mean time, you can simply add the following to the end of the create_estimator method in ReactionModel:
self._from_trajectories(estimator)
Happy New Year. Thanks for a very quick fix. I tried adding the line you suggested and it works. Also, I noticed that each time I import KipetModel, I get the following warning message.
WARNING: DEPRECATED: The pyomo.core.base.sets module is deprecated. Import
Set objects from pyomo.core.base.set or pyomo.core. (deprecated in 5.7)
(called from <frozen importlib._bootstrap>:219)
_SetProduct not found
It doesn't impact anything currently but wanted to bring it to your attention.
Happy New Year to you too. Which version of Pyomo are you using?
I am using pyomo version 5.7.1. I have also listed below the screenshot.
This is the expected behavior at the moment. In the fe_factory module it checks for _SetProduct or SetProduct depending on which version of pyomo is being used. So, there is nothing wrong, but it could be improved to avoid showing any message.
Fixed in #153
For your information, I have included a modified example of this problem as a new example problem in KIPET. See my branch nsd_new for more details. It replaces the fixed trajectory with a step function. This new arrangement also allows you to fit the switching time as well.
I was trying a fed batch reaction example. First, I tried simulating it and it worked fine (notebook). In this example, B is dosed in over 15 min and is set as a trajectory
qin_B
. However, when I tried to do parameter fitting for the same example (notebook), it is not fixing the trajectory for inflowqin_B
. I wasn't sure if I need to do something different for parameter estimation.