PC Review


Reply
Thread Tools Rate Thread

Automatic Solver

 
 
curiouslearn@gmail.com
Guest
Posts: n/a
 
      21st Jul 2007
(1) Suppose cell C1 is a complicated formula (objective function)
which depends on B1 (a parameter) and A1 (a variable)

(2) For every value of B1 suppose there is an A1 which maximizes C1.
Is there a way that whenever I change B1, the value of A1
automatically changes so that C1 is maximized.

I know how to find any new A1 corresponding to a new B1 by using
solver. But I have to go and do this manually.

I really appreciate any help.

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      23rd Jul 2007
Record a macro that runs Solver solving A1.

Then use the Worksheet_Change event to call the macro whenever B1 is
changed.

Hth,
Merjet


 
Reply With Quote
 
TallBill
Guest
Posts: n/a
 
      28th Jul 2007
Solver normally requires a final value for it to solve for. Since this
is not quite what you are wanting, then you will have to write a
routine to do this search. I created a workbook, just for fun, that
employs the "Golden Section" search method that I remember from
college many years ago. The code is a little over 100 lines, so is a
little big to post here, but I will send it to you for you to look
over. I included some extra "goodies" also: a separate worksheet to
"log" each value of the iteration, and a chart sheet to plot the
points.

You need to give the routine an upper and a lower limit for the values
in cell A1, so I put those in cells A2 and A3. It uses a button to
start the macro, rather than automatically calling the routine from
the worksheet Change event, but you could add this call very easily.
This allows one to enter various values in cell A1 to verify the
formula in cell C1, then push the button to find the value of A1 that
will maximize the value of C1. I used a parabola for the function in
cell C1. Just change cell C1 to your function.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing Solver.xlam vs. Solver.xla - 2007 vs. 2003 =?Utf-8?B?RHVrZSBDYXJleQ==?= Microsoft Excel Programming 3 20th Nov 2007 03:48 PM
Solver Function - Making it Automatic =?Utf-8?B?SmFtZXNC?= Microsoft Excel Worksheet Functions 6 5th Mar 2007 09:25 PM
Automatic use of Solver in an Excel model Jasper Microsoft Excel Programming 1 11th May 2006 01:29 PM
automatic solver function Adam Microsoft Excel Misc 0 11th Jul 2003 04:58 PM
automatic solver in realtime Adam Microsoft Excel Worksheet Functions 0 11th Jul 2003 04:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:13 PM.