How can I improve convergence for my complex mathematical model?

In summary, the conversation discusses a complex mathematical model used to calculate heat exchanger performance. The process involves iterating the entering temperature until the installed surface satisfies a target duty. The individual follows a process of guessing an entering temperature and calculating various fluid properties to determine a U-value. They then compare the required surface with the actual surface and make a correction factor to find a new entering temperature. The conversation also discusses solutions for issues with oscillation around the solution and suggests using a collapsing grid or a geometric approximation using three successive iterations to accelerate convergence.
  • #1
Redhunter
2
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
  • #2
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.
 
  • #3
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.
 
  • #4
If the surface is a monotonic function of the temperature, you could use a collapsing grid to zero in on the right temperature.
 
  • #5
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
 

Related to How can I improve convergence for my complex mathematical model?

What is a convergence algorithm?

A convergence algorithm is a mathematical method used to find the solution of a problem by iteratively approaching the desired outcome. It is commonly used in optimization and machine learning tasks where the goal is to minimize a cost function.

Why is a convergence algorithm needed?

A convergence algorithm is needed because it allows us to find the optimal solution to a problem by iteratively improving upon an initial guess. This is important in complex problems where a direct solution is not feasible.

How does a convergence algorithm work?

A convergence algorithm works by starting with an initial guess and then repeatedly applying a set of rules or equations to update the guess until it converges to the desired solution. The rules used are typically based on the gradient or direction of change of a cost function.

What are some common convergence algorithms?

Some common convergence algorithms include Gradient Descent, Newton's Method, and the Bisection Method. There are also variations and combinations of these algorithms that are commonly used in different fields.

What factors can affect the convergence of an algorithm?

The convergence of an algorithm can be affected by the initial guess, the choice of algorithm, the complexity of the problem, and the stopping criteria used. Other factors such as the precision of calculations and the size of the dataset can also play a role.

Similar threads

Replies
1
Views
636
Replies
6
Views
639
Replies
19
Views
1K
Replies
3
Views
2K
Replies
9
Views
981
  • Introductory Physics Homework Help
Replies
9
Views
900
  • General Discussion
Replies
2
Views
849
Replies
1
Views
2K
Replies
5
Views
2K
  • Mechanical Engineering
Replies
6
Views
1K
Back
Top