Hot answers tagged

4

I think you should stick with yyour current formulation. If you want to use a penalty, I would augment your function. Calculate your function itself, and then add a penalty of the form $$dJ = -(y - y_{max})^3$$. This will heavily punish any values of $y > y_{max}$. But this will tell your optimizer to seek low values of y. The best choice is if your ...


4

Below is an example of using Gekko (v0.2.4+) to define a SOS1 variable with an objective function to find the minimum in that sequence of values. from gekko import GEKKO m = GEKKO() y = m.sos1([19.05, 25.0, 29.3, 30.2]) m.Obj(y) # select the minimum value m.solve() print(y.value) Additional information on model building functions is available in the Gekko ...


4

If they don't have a variable that is constrained to a discrete set you can formulate it like so: b1 = m.Var(lb=0,ub=1,integer=True) #Binary variable b2 = m.Var(lb=0,ub=1,integer=True) #Binary variable b3 = m.Var(lb=0,ub=1,integer=True) #Binary variable b4 = m.Var(lb=0,ub=1,integer=True) #Binary variable a = m.Var() #Variable ...


3

The m.MV() type has additional tuning parameters such as move suppression that is likely contributing to the difference in solution. Also, the m.MV() is adjustable at every time point in m.time instead of just a single value with an m.FV() over the entire time window. You can get similar results to an FV by making the following adjustments to the MV. Set ...


3

A good first step with any parameter estimation problem is to solve it in simulation to verify that you can get a good solution and that the parameters have an effect on the objective. You can first simulate with m.options.IMODE=7. Once you have an initial solution, you can set your objective function with: for i in range(n): m.Minimize((phi[i]-phi_hat[...


3

Gekko / APMonitor provides the following to Nonlinear Programming Solvers (APOPT, BPOPT, IPOPT, MINOS, SNOPT) in sparse form: Variables with default values and constraints Objective function Equations Evaluation of equation residuals Sparsity structure Gradients (1st derivatives) Gradient of the equations Gradient of the objective function Hessian of the ...


2

I made a mistake in the concept formulation. If you are using an optimization algorithm with constraints, then you just need to develop properly the constraints, as functions of the variables. In this case, I was worried because some constraints are functions of the different problem variables, but another constrains were a result of properties values, ...


1

As you mentioned, the cspline and bspline objects are available in Gekko. We've used them successfully for drag in large-scale optimization problems with flight dynamics with high altitude, long endurance (HALE) aircraft (source code) in Dynamic Optimization of High-Altitude Solar Aircraft Trajectories Under Station-Keeping Constraints (link to article). ...


Only top voted, non community-wiki answers of a minimum length are eligible