How can I improve convergence for my complex mathematical model?

AI Thread Summary
The discussion revolves around optimizing a complex mathematical model for heat exchanger performance using an iterative method to find the entering temperature that meets a target duty. The current approach involves guessing an entering temperature, calculating fluid properties, and adjusting based on a correction factor, but it sometimes leads to oscillations and slow convergence. Suggestions include averaging successive iterations to improve convergence speed and employing a geometric approximation to refine estimates. However, issues arise when the iterations do not approach the solution closely enough for the geometric method to be valid, leading to nonsensical negative outputs. The conversation highlights the need for more effective numerical methods or derivative estimations to enhance the iterative process.
Redhunter
Messages
2
Reaction score
0
I have a complex mathematical model (about 2000 lines of code) which calculates heat exchanger performance.
Using Q=UxAxLMTD I want to iterate the entering temperature until I find that the installed surface satisfies a target duty.

At present I
1 guess an entering temperature and from the duty calculate the leaving and mean temperature.
2 Calculate various fluid properties, Reynolds No, Prandtl No etc and so a U-value
3 Using the target duty, I calculate the required surface
4 I compare the required surface with the actual surface and make a correction factor
ie k x ((Required-Actual)/Actual)
where k is say 0.25
5 New entering temperature = previous entering temp x (1- correction)

after playing about with k I generally get convergence at between 5 and 40 iterations but sometimes I get oscillation about the solution.

The books I have seem to use first and second order derivatives but my process is too complex for that. Any simple solutions?
 
Physics news on Phys.org
If you get oscillations about the solution, and they take a long time to settle, simply averaging 2 successive iterations should make things converge faster.

For a more rigorous approach, be aware that numerical solutions tend to converge (approximately) geometrically to the answer. (This is true whether they oscillate about or approach exponentially the final answer.) You can use that fact and 3 successive iterations to "accelerate" the convergence:

Let x1, x2, and x3 be 3 successive iterations, and let xx be the actual solution. Since the iterations converge approximately geometrically:

(x2-xx)/(x1-xx) ≈ (x3-xx)/(x2-xx)

I.e., the error decreases by the same ratio with each iteration. Solving the above for xx gives

xx = (x1 x3 - x22) / (x1 - 2x2 + x3)

This, of course, is an approximation to the actual value, but it will be much closer than x1, x2, and x3 are.

Next, you can do another 3 iterations starting with xx, and repeat the process as needed.
 
I can see your logic but this does not seem to work. Supposing sucessive iterations were x1=99, x2=100, x3=101 then xx = -1/0

I also tried with some actual data. My first three iterations were 799,717,642 using my current method it converges at 577. The formula gives xx as -198 as these are duty in Kw a negative estimate is nonsense and could not be processed.
 
If the surface is a monotonic function of the temperature, you could use a collapsing grid to zero in on the right temperature.
 
Redhunter said:
I can see your logic but this does not seem to work. Supposing sucessive iterations were x1=99, x2=100, x3=101 then xx = -1/0

I also tried with some actual data. My first three iterations were 799,717,642 using my current method it converges at 577. The formula gives xx as -198 as these are duty in Kw a negative estimate is nonsense and could not be processed.

Yes, I've found you do have to get more "in the neighborhood" of the answer before the geometric approximation is valid. Clearly this is not the case for the 99,100,101 example since the output is changing by the same amount each time.

How does the geometric formula do when your iterations get below 600 in your example? Or when they oscillate as you mentioned they sometimes do in Post #1?

Another comment: you mentioned a method using derivatives, but your process is too complicated to compute them. Could you estimate them numerically, i.e. change the input parameter by a small amount to estimate the derivative?

Regards,

Mark
 
Hello! Let's say I have a cavity resonant at 10 GHz with a Q factor of 1000. Given the Lorentzian shape of the cavity, I can also drive the cavity at, say 100 MHz. Of course the response will be very very weak, but non-zero given that the Loretzian shape never really reaches zero. I am trying to understand how are the magnetic and electric field distributions of the field at 100 MHz relative to the ones at 10 GHz? In particular, if inside the cavity I have some structure, such as 2 plates...
Back
Top