View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Héctor Miguel Héctor Miguel is offline
external usenet poster
 
Posts: 434
Default Using Solver to Minimise the Result of Another Iterative Routine

hi, Graeme !

it's not clear (or viewable) "where" (in the code) could it be a integration with solver tool

however (and AFAIK) once solver "solves" an equation...
there is no way that solver seek for another (possible) solution
unless you reset the solver arguments and you will get (probably) the same solution as before

(perhaps) if you post the code (and a sample data) -?-

hth,
hector.

__ OP __
I've written an iterative Trapezoidal integrator in VBA for integrating an analytic function f(x)
where f(x) is defined in a cell, for example, B1: =3*A1^3 + 2*A1^2 + A2^3 - A3
where the integrating variable x is in cell A1, and cells A2 and A3 contain parameters.
In this example, the cells B1, A1, the cells with the lower and upper limits
and the cell to receive the result, are passed as arguments.

All this works fine.

Now, this is the part I 'm wanting to do, but cannot achieve.

After the integrator produces its result, I'm wanting to call the Solver tool to minimise the integral result (target cell)
adjust the parameters in 2 and A3 (changing cells), and then for the integrator to be run again, producing its next result.
This process is to be repeated, until such time as the parameters have been so adjusted by the Solver
and the integral result has reached its minimum value.

ie,

1. Set up initial values.
2. The integrator determines its result.
3. Solver reads the result, then adjusts the two parameters.
4. Repeat steps 2 and 3, until the Solver has minimised the integral via the two changed parameters.

I am unable to determine how to combine the iterative integrator with the Solver in the above manner
so they alternately operate until such time that the integral has been minimised.

Any guidance greatly appreciated.