Excel solver functionality in Matlab

8 visualizaciones (últimos 30 días)
Sem Albers
Sem Albers el 17 de Dic. de 2021
Respondida: Harsh Mahalwar el 23 de Feb. de 2024
Hi everyone,
I am currently working on an inventory model and I want to forecast the demand using the holt-winters additive forecasting method. In this forecasting method there are three parameters that influence the outcome namely: alpha, beta, and gamma. I first made this forecast in Excel but now I want to implement it into Matlab. To have the best values for these three parameters I am using a training dataset and by using in Excel the solver function, screenshot below.
With this tool I can set the objective, this is the total deviation between the forecasted values and the actual demand, and I this to be a close as possible to zero. Therefore the solver can change three cells: alpha, beta, and gamma. The solver changes the values of the parameters to make the objective as close as possible to zero. Is there a way to do this in matlab?
Thank you for your help in advance!

Respuestas (1)

Harsh Mahalwar
Harsh Mahalwar el 23 de Feb. de 2024
Hi Sem,
I can recognise that you are trying to find a way to solve a nonlinear optimisation problem using MATLAB.
The optimisation toolbox in MATLAB provides the fmincon function which can be used for solving constrained nonlinear optimization problems. Unfortunately, it has no support for generalized reduced gradient (GRG) method (refer this article to know more on this), but you can choose between multiple algorithms in it using optimoptions function.
Here an example in which I am changing the algorithm from 'interior-point' (default) to ‘sqp’:
options = optimoptions(@fmincon,'Algorithm','sqp')
You can learn more about the optimoptions function from the link mentioned here:
One important thing to remember here is that 'trust-region-reflective' algorithm requires a gradient which can be added by setting SpecifyObjectiveGradient to true.
To know more about the algorithms supported by fmincon, from the link mentioned here:
For more information on the fmincon function in MATLAB by using the link mentioned here:
I hope this, helps!

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by