Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Solver model loading problem | Excel Discussion (Misc queries) | |||
linear model with solver | Excel Discussion (Misc queries) | |||
Solver. When a model is liner and when it's not? | Excel Discussion (Misc queries) | |||
how do i model discounts in excel solver | Excel Worksheet Functions | |||
Trouble with Solver | Excel Discussion (Misc queries) |