Alex,
Here is a similar question on Stack Overflow: https://stackoverflow.com/questions/73850403/can-i-use-implicit-objective-function-in-a-design-optimization-process-in-gekko/73858161
You can’t use a black-box function with Gekko, but the black box model can be used to fit a cspline (1D), bspline (2D), or machine learning models (higher dimension functions).
For future gekko questions, please use Stack Overflow with tag [gekko].
-John Hedengren
--
--
APMonitor user's group e-mail list.
- To post a message, send email to apmo...@googlegroups.com
- To unsubscribe, send email to
apmonitor+...@googlegroups.com
- Visit this group at http://groups.google.com/group/apmonitor
---
You received this message because you are subscribed to the Google Groups "apmonitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
apmonitor+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/apmonitor/d494bbe3-35f1-4fcd-a6ed-b6d11c35b651n%40googlegroups.com.
Dear John, thank you for your reply.As I understood your answer - it's not possible to optimize parameters if you haven't complete direct functional form, right?Maybe I have confused you with the previous description..The key moments: I am having the experimental data and a complexed model that is described in f1(set of parameters).And I need to find such parameters (search_params) which will lead to the minimum of a distance such as f1(search_params) will be as close as possible to the experimental data I have.For each parameter of a set I have initial value and boundaries and even some constraints..So i need to to something like this:---
m = GEKKO()
#parameters I need to find
param_1 = m.FV(value = val_1, lb = lb_1, ub=rb_1)
param_2 = m.FV(value = val_2, lb = lb_2, ub=rb_2)
...
param_n = m.FV(value = val_n, lb = lb_n, ub=rb_n) #constructing the input for the function f1()
params_dataframe = ....()# some function that collects all the parameters and arranges all of them to a proper form to an input of f1()
#exp data description
x = m.Param(value = xData)
z = m.Param(value = yData)
y = m.Var()
#model description - is it possible to use other function inside equation? because f1 is very complexed with a lot of branches and options.. I don't really want to translate it in equation form..
m.Equation(
y==f1(params_dataframe)
)
#add some constraints
min = m.Param(value=some_val_min)
m.Equation(min <= (param_1+param_2) / (param_1+param_2)**2))
# trying to solve and minimize the sum of squares
m.Minimize(((y-z))**2)
# Options for solver
param_1.STATUS = 1
param_2.STATUS = 1
...
param_n.STATUS = 1
m.options.IMODE = 2
m.options.SOLVER = 1
m.options.MAX_ITER = 1000
m.solve(disp=1)
---Is it possible to use GEKKO this way or it's not allowed?
You received this message because you are subscribed to a topic in the Google Groups "apmonitor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/apmonitor/49vRUS2rhfE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to apmonitor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/BYAPR08MB4600F96E73E0CD19240707D5EE399%40BYAPR08MB4600.namprd08.prod.outlook.com.
----
To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/CABqRW0YvQj-0RLeeQy47XHguu3-iFJgRTfzS12ik_0%3DQVj5i6Q%40mail.gmail.com.