Feed Formulation using
Excel Solver
MK. Teknik Formulasi Ransum dan SIP
Department of Nutrition and Feed Technology
Faculty of Animal Science – Bogor Agricultural University
Website: http://intp.ipb.ac.id
Introduction
Solver : Solver is part of a suite of commands
sometimes called what-if analysis tools.
With Solver, you can find an optimal value for a
formula in one cell— called the target cell— on a
worksheet.
Solver is an optimization and resource allocation
tool
Helps you achieve a goal
Constrains specify restriction
Solver Options lets you specify how Solver will
attempt to find a solution
The Steps in Implementing an LP
Model in a Spreadsheet
1. Organize the data for the model on the
spreadsheet.
2. Reserve separate cells in the spreadsheet
for each decision variable in the model.
3. Create a formula in a cell in the spreadsheet
that corresponds to the objective function.
4. For each constraint, create a formula in a
separate cell in the spreadsheet that
corresponds to the left-hand side (LHS) of
the constraint.
How Solver Views the Model
Target cell - the cell in the spreadsheet that
represents the objective function
Changing cells - the cells in the spreadsheet
representing the decision variables
Constraint cells - the cells in the spreadsheet
representing the LHS formulas on the
constraints
Installing Solver for Use
On Excel Menu,
choose
Tools
Add-Ins...
Installing Solver for Use
On Excel Menu,
choose
Tools
Add-Ins...
Put a Check in the
Box Next to ‘Solver
Add-in’
Using Solver
On Excel Menu,
choose
Tools
Solver
This brings up the
Solver Parameters
box which will be
discussed next.
Feed Formulation using Solver
First Step:
The feed ingredient and nutrition composition are put on Excel
Worksheet, as following:
Setting Up the Problem in Excel
The Objective
Function
Setting Up the Problem in Excel
The Objective
Function
The Decision
Variables
(optimal values
will be calculated
by Solver)
Setting Up the Problem in Excel
The Objective
Function
The Decision
Variables
The Constraints
Relationships
Solver Parameters
Add Constraint
Solver Solution
Example : Ransum Ayam.xls
Solver Parameters:
The parameters in Solver Program is set up as default
and can be changed as wanted.
To change the solver parameters, as follow:
Tools Solver Solver Parameters Options.
in Solver menu, chose one or more options :
Time to process
Max Time: a running time required
Iterations, number of maximum iteration needed
Solver Options
Excel Solver: Options Button
Max time: How long Solver should work on the problem. Default 100
seconds, max 32,767 seconds (over nine hours!)
Excel Solver: Options Button
Iterations: How many iterations Solver should work.
Default = 100, Max = 32,767
Excel Solver: Options Button
Precision: How precise Solver should be working on a possible
solution against your constraints. Default = 0.000001,
Variable = 0.0000 – 1.0000
Excel Solver: Options Button
Tolerance: How precise Solver should be on meeting integer
constraints.
Excel Solver: Options Button
Convergence: Lets Solver know when to quit looking for a better
solution. Variable = 0 to 1.
Excel Solver: Options Button
Assume Linear Model: Lets Solver know you are working with a
linear model, making the solution time faster.
Excel Solver: Options Button
Assume Non-negative: Lets Solver know variables are >= 0
( this creates a constraint).
Excel Solver: Options Button
Use Automatic Scaling: Lets Solver know variables are of different
magnitudes.
Excel Solver: Options Button
Show Iteration Results: Lets Solver know to pause between iterations.
Show Trail Solutions.
Excel Solver: Options Button
Estimates: Choose Tangent or Quadratic extrapolations, try
Quadratic for non-linear optimization models.
Excel Solver: Options Button
Derivatives: Choose Forward or Central. Default = Forward, try
Central for highly constrained calculations.
Excel Solver: Options Button
Search: Choose Newton or Conjugate. Default = Newton. Lets you
choose the algorithm for Solver to use to find the optimal solution.
Summary
Solver is an optimization and resource
allocation tool
Helps you achieve a goal
Constrains specify restriction
Solver Options lets you specify how Solver
will attempt to find a solution