Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jason
 
Posts: n/a
Default Using iteration to solve a two-parameter equation

Hi everyone,

My goal: My spreadsheet has two inputs and two outputs. I input the
initial values -magic calculations happen- and out come my two outputs,
which are meant to be my new inputs. This process needs to happen
until my outputs match the previous inputs to a degree that I specify,
convergence. Cookie cutter Excel iteration issue?

My problem: If I just make my inputs refer to the same cells as my
outputs, and turn iteration on, I never reached convergence and I end
up with some kind of error.

My pseudo-solution: I wrote a macro that copies the values of the
output to the inputs and after running it about 8 times, I am able to
converge (inputs=outputs)

I would like to use Excel's iteration for this instead of a macro. I
suspect the problem has to do with the timing of the calculations, but
I really dont know. Help is greatly appreciated

Have a good day

Jason

  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

Hi Jason,

What is "some kind of error"?

--
Kind regards,

Niek Otten

"Jason" wrote in message
ps.com...
Hi everyone,

My goal: My spreadsheet has two inputs and two outputs. I input the
initial values -magic calculations happen- and out come my two outputs,
which are meant to be my new inputs. This process needs to happen
until my outputs match the previous inputs to a degree that I specify,
convergence. Cookie cutter Excel iteration issue?

My problem: If I just make my inputs refer to the same cells as my
outputs, and turn iteration on, I never reached convergence and I end
up with some kind of error.

My pseudo-solution: I wrote a macro that copies the values of the
output to the inputs and after running it about 8 times, I am able to
converge (inputs=outputs)

I would like to use Excel's iteration for this instead of a macro. I
suspect the problem has to do with the timing of the calculations, but
I really dont know. Help is greatly appreciated

Have a good day

Jason



  #3   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default

Hi,

Can you please elaborate a little more on what those calculations are?
Depending on the complexity of the equations involved, the convergence will
depend critically on the intitial guess values that you input for the two
parameters; it is also possible that different intitial guess values may
converge but return different outputs (yet satisfying the convergence
criteria).

Try one of the following:

Enter the input values in A1 and B1; and the formulas for calculating the
output values in C1 and D1 (obviously these formulas would refer to A1 and
B1).
Now use the following formulas:
In A2, =C1
In B2, =D1
Drag the formulas in C1 and D1 to C2 and D2.
Now you have the second row, A2,.....D2, filled.
Drag the formulas in the second row (i.e., A2:D2) down the rows.
If the parameters are converging, Ai and Ci (and similarly Bi and Di) should
eventually become equal, where 'i' is row numbers down the spreadsheet.
See how changing the input values in A1 and B1 affect the convergence.

OR

Use the 'Solver' utility in Excel:

If A1 and B1 contain the input values, and C1 and D1 contain the output
values,
create helper cells E1 and F1 with formulas =A1-C1 and B1-D1 repsectively.
In Solver,
Set Targe Cell to E1,
By Changing, A1:B1
Add a Constraint F1 = 0
and solve. Again, the initial guess values in A1 and B1 are very critical.
The system may not converge at all or converge to weird values.
Test with different initial guess values.

Regards,
B. R. Ramachandran


"Jason" wrote:

Hi everyone,

My goal: My spreadsheet has two inputs and two outputs. I input the
initial values -magic calculations happen- and out come my two outputs,
which are meant to be my new inputs. This process needs to happen
until my outputs match the previous inputs to a degree that I specify,
convergence. Cookie cutter Excel iteration issue?

My problem: If I just make my inputs refer to the same cells as my
outputs, and turn iteration on, I never reached convergence and I end
up with some kind of error.

My pseudo-solution: I wrote a macro that copies the values of the
output to the inputs and after running it about 8 times, I am able to
converge (inputs=outputs)

I would like to use Excel's iteration for this instead of a macro. I
suspect the problem has to do with the timing of the calculations, but
I really dont know. Help is greatly appreciated

Have a good day

Jason


  #4   Report Post  
Jason
 
Posts: n/a
Default

Thanks for reading my posting Niek!

I eventually get a #NUM error in all of the cells involved in the
calculation.

Jason

  #5   Report Post  
Jason
 
Posts: n/a
Default

Thank you for the suggestions B.R.

First of all, the calculations are fairly complex. The only way that I
can describe them generally is to say that they have the form of a
matrix equation and the solution is the adjustments on the two initial
values. These values are added to the initial values (input) to yield
the final values (output).

I am having trouble adapting your first suggestion to my calculations,
but I will keep trying.

Solver failed to converge using any of the values that I tried. I
understand that the initial estimates can have an impact on
convergence, but I am simply trying to replicate a calculation that has
been demonstrated in literature repeatedly. Therefore, I have reason
to believe the initial values that I have chosen are adequate.

Do you have any idea what the difference is between the macro and
excel's iteration?

thanks for your help

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
Equation Editor- problem when editing an equation Gaby L. Excel Discussion (Misc queries) 0 September 27th 05 09:24 PM
How do I make FORMULA TO SOLVE CURVE OR 2ND ORDER EQUATION? HANY Excel Worksheet Functions 1 September 25th 05 01:31 PM
Need Help with #N/A in equation mkerstei Excel Discussion (Misc queries) 7 July 29th 05 09:03 PM
Averaging/Rounding Equation problem Hansel Excel Discussion (Misc queries) 4 June 28th 05 08:45 PM
solve quadratic equation system Miguel Excel Worksheet Functions 1 April 27th 05 02:30 PM


All times are GMT +1. The time now is 11:06 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"