Azzera filtri
Azzera filtri

Excel solver functionality in Matlab

5 visualizzazioni (ultimi 30 giorni)
Sem Albers
Sem Albers il 17 Dic 2021
Risposto: Harsh Mahalwar il 23 Feb 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!

Risposte (1)

Harsh Mahalwar
Harsh Mahalwar il 23 Feb 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!

Categorie

Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by