Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trouble getting solver to load a model

I have written my solver to work in a loop. During each loop I need to adjust size of the "By Changing Cells" array and also one of the constraints. I have no problems with getting the program to adjust the "By Changing Cells" array. The constraint however is different.

I have my program change the formula in the saved model area to accomadate the new array size, (it looks like this {=G44:G61=0}). Now, when I load the saved model, I get this error "SOLVER: An Unexpected internal error occurred, or available memory was exhausted". It doesn't matter if I try to load a model after the program has adjusted my new constraint or if I type in all my constrains it the main solver form then save them then try to reload them. I get the same error.

Can anyone give me some advice? Or do I have to have my program write a constraint for each cell in the array (i.e. =G44=0, =G45=0, . . . , =GXX0)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Trouble getting solver to load a model

Changing the "Saved Model" area is "usually" not the way to change a model
in a loop. But, as a suggestion...
Try removing the "{" and the "})" in your constraint. (
{=G44:G61=0}) ) These are usually used in the last cell to hold the
values of your solver options. (It's an array of options).
Solver usually stores the cell values using Absolute reference. You may
want to experiment and do the same.
If you are using Excel 97 or above, make sure your worksheet is using A1
reference, and not R1C1 reference.
I agree with Tushar that's it's probably best just to reset the model and
start fresh with each loop.

--
Dana DeLouis
= = = = = = = = = = = = = = = = =


"Don C" wrote in message
...
I have written my solver to work in a loop. During each loop I need to

adjust size of the "By Changing Cells" array and also one of the
constraints. I have no problems with getting the program to adjust the "By
Changing Cells" array. The constraint however is different.

I have my program change the formula in the saved model area to accomadate

the new array size, (it looks like this {=G44:G61=0}). Now, when I load
the saved model, I get this error "SOLVER: An Unexpected internal error
occurred, or available memory was exhausted". It doesn't matter if I try to
load a model after the program has adjusted my new constraint or if I type
in all my constrains it the main solver form then save them then try to
reload them. I get the same error.

Can anyone give me some advice? Or do I have to have my program write a

constraint for each cell in the array (i.e. =G44=0, =G45=0, . . . ,
=GXX0)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trouble getting solver to load a model

Thanks for the input. I did do exactly as you said and it works great now. I didn't know about the SolverAdd code to add constraints. Now I just set the whole model up in the code.

I did find that the problem with loading the model didn't have anything to do with that array function I was tring to load. It was with the solver options (the last cell in the saved model). For some reason, when you try to load a model with different solving Options, (rather then the defaults) you get the unexpected internal error.

Thanks again.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trouble getting solver to load a model

Thanks for the input. Unfortunatly, I did need that G44:G61=0 in the {} brackets, because that is an array function.

See my reply to Tushar, I found that the problem that was giving me the error was actual the cell holding the solver options array. If you save a model with Assume Non-Negative checked on and Use Automatic Scaling checked on and Central Derivatives Checked on (leave the rest set as defaulted), then try to load it back up, you will get the same error I did. I got the error when I ran it in my code and when just doing it manually.

Thanks for the reply.
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
Solver model loading problem marineCORVETTEran Excel Discussion (Misc queries) 0 July 17th 08 11:31 PM
linear model with solver vert Excel Discussion (Misc queries) 1 April 4th 06 04:34 PM
Solver. When a model is liner and when it's not? PV Excel Discussion (Misc queries) 1 February 15th 06 04:16 PM
how do i model discounts in excel solver Samir Syed Excel Worksheet Functions 0 December 23rd 05 05:23 PM
Trouble with Solver Wanderingspirit99 Excel Discussion (Misc queries) 0 September 12th 05 03:50 PM


All times are GMT +1. The time now is 12:38 AM.

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"