Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AAB AAB is offline
external usenet poster
 
Posts: 1
Default Solver and Excel programming problem

Hi
Looking for a little insight on a frustrating problem with Frontline
Solver and Excel. I am working on a project that needs to run thousands
of LP problems. I seem to have all the code working but occasionally a
LP model it is trying to solve runs into a maximum iterations reached
error, if I click continue it reaches the maximum time and if I again
click continue it runs indefinitely. The problems are set up using VBA.
The confusing issue is that if I set up the problem manually, given
the same model, it finds a solution just fine. I have tried switching
to the macro language by recording the exact steps I use to set it up
manually but the same problem happens. It only occurs once every
several hundred models or so with no distinguishing characteristics to
the models it has problems with apparent. After spending much time
looking for a reason for this I am beginning to think it is a solver bug.

I have attached both the VBA code and the macro code to see if anyone
might see something I don't. System info: Frontline Premium Solver
v3.5, Excel 2000, XP Pro.

Any thoughts on this is greatly appreciated.
Thanks in advance.
Alan


Sub LPApprox()
'Reset Solver
SolverReset

SolverAdd CellRef:="$T$1", relation:=2, FormulaText:="0"
SolverAdd CellRef:="$AC$7:$AC$21", relation:=1, FormulaText:="0"
SolverAdd CellRef:="$AD$7:$AF$21", relation:=3, FormulaText:="0"
SolverEVOptions AssumeNonneg:=True

SolverOk SetCell:="$AC$23", MaxMinVal:=1, ValueOf:=0, ByChange:= _
"$T$7:$V$21,$T$3:$V$3", Engine:=2, EngineDesc:="Standard
LP/Quadratic"

SolverSolve UserFinish:=True

SolverFinish KeepFinal:=1
End Sub

Sub LPApproxMacroLanguage()
SolverReset
SolverAdd CellRef:="$AC$7:$AC$21", relation:=1, FormulaText:="0"
SolverAdd CellRef:="$AD$7:$AF$21", relation:=3, FormulaText:="0"
SolverAdd CellRef:="$T$1", relation:=2, FormulaText:="0"
SolverOk SetCell:="$AC$23", MaxMinVal:=1, ValueOf:=0, ByChange:= _
"$T$3:$V$3,$T$7:$V$21", Engine:=2, EngineDesc:="Standard
LP/Quadratic"
SolverLPOptions MaxTime:=100, ITERATIONS:=1000,
Precision:=0.00000001, PivotTol _
:=0.000001, ReducedTol:=0.000001, StepThru:=False,
Scaling:=False, AssumeNonneg _
:=True, BypassReports:=False, Derivatives:=1
SolverOk SetCell:="$AC$23", MaxMinVal:=1, ValueOf:=0, ByChange:= _
"$T$3:$V$3,$T$7:$V$21", Engine:=2, EngineDesc:="Standard
LP/Quadratic"
code = SolverSolve(True)
If code < 0 Then MsgBox ("LPApprox Return Code (Probable Error) =
" & code)
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linear Programming via Excel Solver Squadron Excel Discussion (Misc queries) 1 December 5th 08 04:48 PM
Binary integer non-linear programming excel solver premium Gary[_3_] Excel Worksheet Functions 3 September 14th 08 07:58 AM
Binary integer non-linear programming excel solver Gary[_3_] Excel Discussion (Misc queries) 0 September 12th 08 07:38 PM
Binary integer non-linear programming excel solver Gary[_3_] Excel Worksheet Functions 0 September 12th 08 07:35 PM
Binary integer non-linear programming excel solver premium Gary[_3_] Excel Worksheet Functions 0 September 10th 08 06:46 PM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"