nonlinear-optimization

How to implement dynamic parameter estimation with missing data in Gekko?

早过忘川 提交于 2021-02-10 16:00:34
问题 Going back and forth through the documentation, I was able to set-up a dynamic parameter estimation in Gekko. Here's the code, with measurement values shown below (the file is named MeasuredAlgebrProductionRate_30min_18h.csv on my system, and uses ; as separator): import numpy as np import matplotlib.pyplot as plt from gekko import GEKKO #%% Read measurement data from CSV file t_x_q_obs = np.genfromtxt('MeasuredAlgebrProductionRate_30min_18h.csv', delimiter=';') #t_obs, x_obs, q_obs = t_xq

How to implement dynamic parameter estimation with missing data in Gekko?

风流意气都作罢 提交于 2021-02-10 15:59:07
问题 Going back and forth through the documentation, I was able to set-up a dynamic parameter estimation in Gekko. Here's the code, with measurement values shown below (the file is named MeasuredAlgebrProductionRate_30min_18h.csv on my system, and uses ; as separator): import numpy as np import matplotlib.pyplot as plt from gekko import GEKKO #%% Read measurement data from CSV file t_x_q_obs = np.genfromtxt('MeasuredAlgebrProductionRate_30min_18h.csv', delimiter=';') #t_obs, x_obs, q_obs = t_xq

Non-linear fitting with nls() is giving me singular gradient matrix at initial parameter estimates. Why?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 17:07:59
问题 This is my first attempt at fitting a non-linear model in R, so please bear with me. Problem I am trying to understand why nls() is giving me this error: Error in nlsModel(formula, mf, start, wts): singular gradient matrix at initial parameter estimates Hypotheses From what I've read from other questions here at SO it could either be because: my model is discontinuous, or my model is over-determined, or bad choice of starting parameter values So I am calling for help on how to overcome this

Non-linear fitting with nls() is giving me singular gradient matrix at initial parameter estimates. Why?

那年仲夏 提交于 2021-02-08 17:04:38
问题 This is my first attempt at fitting a non-linear model in R, so please bear with me. Problem I am trying to understand why nls() is giving me this error: Error in nlsModel(formula, mf, start, wts): singular gradient matrix at initial parameter estimates Hypotheses From what I've read from other questions here at SO it could either be because: my model is discontinuous, or my model is over-determined, or bad choice of starting parameter values So I am calling for help on how to overcome this

Non-linear fitting with nls() is giving me singular gradient matrix at initial parameter estimates. Why?

ⅰ亾dé卋堺 提交于 2021-02-08 17:03:27
问题 This is my first attempt at fitting a non-linear model in R, so please bear with me. Problem I am trying to understand why nls() is giving me this error: Error in nlsModel(formula, mf, start, wts): singular gradient matrix at initial parameter estimates Hypotheses From what I've read from other questions here at SO it could either be because: my model is discontinuous, or my model is over-determined, or bad choice of starting parameter values So I am calling for help on how to overcome this

How to solve nonlinear equations using a for loop in python?

最后都变了- 提交于 2021-02-08 11:45:27
问题 I am trying to solve for non linear equations in python. I have tried using the solver of the Sympy but it doesn't seem to work in a for loop statement. I am tyring to solve for the variable x over a range of inputs [N] . I have attached my code below import numpy as np import matplotlib.pyplot as plt from sympy import * f_curve_coefficients = [-7.14285714e-02, 1.96333333e+01, 6.85130952e+03] S = [0.2122, 0, 0] a2 = f_curve_coefficients[0] a1 = f_curve_coefficients[1] a0 = f_curve

Replicate XL GRG Nonlinear solver in R (example provided)

混江龙づ霸主 提交于 2021-01-29 05:43:41
问题 I am trying to replicate with R this optimization problem for which the XL solver seems to do the job (I am assuming it's a decent one); I seem to fail getting the package/function ticking all the relevant boxes. It is essentially a non-linear optimization problem with inequality constraints. The relevant elements of the problem can be replicated with this snippet: varCovar <- matrix(data = c(0.000576046, 0.000126261, 0.00012385, 0.000104201, 5.57911E-05, 0.000126261, 0.000411463, 9.88479E-05

mixed integer quadratic programming in python

自作多情 提交于 2021-01-29 05:16:08
问题 I was wondering if someone could give me some guidance in setting up my objective. I am trying to minimise variance in python with some cardinality constraints on the number of assets in my portfolio. I am not sure what package would help me do this. And if there was a working example for the above. 回答1: Below is a MIQP model that illustrates how we can model a portfolio problem with the number assets limited to be between minAssets and maxAssets . If an asset is in the portfolio, furthermore