MOON
MOON

Reputation: 2801

How to provide the Gekko Python with the first and second derivatives of the objective function?

I am trying to minimize the difference of a function with a data point over different time points. So the objective function is the sum of the squares of the difference between the model (my function) and the data points over different times.

My model has analytical first and second order derivatives. How can I provide these derivatives to Gekko Python?

Upvotes: 2

Views: 324

Answers (1)

Junho Park
Junho Park

Reputation: 997

There are several examples in the APMonitor webpage regarding parameter estimation. Please check the link below. It also provides the data and model that you can use for practice.

TCLab C - Parameter Estimation

You can also get the idea how to implement the higher order differential equations in GEKKO in the link below. You basically want to introduce additional variable which links the first derivative variable to the 2nd derivative variable. That way, you can collapse the higer order DE down into the multiple 1st order DEs.

Solve 2nd Order Differential Equation

Upvotes: 2

Related Questions