BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
580 stars 103 forks source link

.dt() is not functioning properly #37

Closed cvernon3 closed 5 years ago

cvernon3 commented 5 years ago

My python script is reporting that my derivatives are causing attribute errors as in quotations " File "C:\Users\corya\Anaconda3\lib\site-packages\gekko\gk_operators.py", line 36, in getattr raise AttributeError(name) AttributeError: dt " I did not have this issue prior to updating GEKKO, so I think it may be related. Thanks!

loganbeal commented 5 years ago

@cvernon3, earlier versions of GEKKO incorrectly allowed differentials of MVs. It was removed in the recent release. Is this what you encountered?

@APMonitor, can you confirm that differentials are not allowed on MVs? I have the following quote from you from May 24th:

Any variable that is expressed as a differential in one of the equations should be an Var(), SV(), or CV().

cvernon3 commented 5 years ago

Yeah, that was my problem, thanks! It is confirmed that differentials are not allowed on MVs. Would it be possible for GEKKO to give an error that says that rather than just saying "AttributeError: dt"? If not, no worries. Thanks!

APMonitor commented 5 years ago

Yes, differentials are only allowed on variables that are calculated.