How to work around this equation giving infinities in the numerical calculation?

In summary, the heat conduction equation for a semi-infinite slab with a boundary condition of the first kind poses a problem as delta, a very small number, causes the exponential term to tend towards infinity. Programming it in Fortran can handle values up to a magnitude of 310, but beyond that, the code returns infinities. Applying a log transformation on the integrand can solve the issue of delta squared, but leads to negative infinity due to the complimentary error functions at the boundary of z = 0. Suggestions to resolve this issue include expanding the Taylor series of delta and using a transformation such as u=\tan^{-1}x or redefining the variables to absorb delta. Another option is to scale the variables to make
  • #1
FQVBSina_Jesse
54
9
TL;DR Summary
Heat conduction solution using Green's function has exponential and erfc terms. At boundaries, exponential gives infinity and other boundaries, erfc gives 0, making log transform difficult.
The heat conduction equation for a semi-infinite slab with a boundary condition of the first kind is as follows:

1652468206637.png


The problem is delta is a very small number, so the first exponential will tend to infinity. I am programming this in Fortran and it can accommodate values up to magnitude of 310, but beyond that, the code simply returns infinities. If the program does not simply return infinity, the exponential and erfc terms balance each other and generates a reasonable value.

If I apply the log transformation on the integrand, that will solve the problem of the delta squared. But the complimentary error functions at the boundary of z = 0 will give erfc(2/delta*sqrt(...)) = 0, which under log will return negative infinity.

Does anyone have a suggestion as to how I can resolve this issue? Thanks!
 
  • Like
Likes Delta2
Physics news on Phys.org
  • #2
I don't know about this specific application, but the natural thing to do would be to expand things as Taylor series of delta, watch the infinities cancel out, and then keep whatever constant term is left over.

Assuming that's what's actually happening here.
 
  • #3
Try a transformation [itex]u=\tan^{-1}x[/itex]. That should map everything onto a finite region.
 
  • #4
Can you try redefining the variables ##t, t', z## to absorb the ##\delta##? It looks like once you do that the upper limit on your integral will get large, but it should take all dependence on ##\delta## out of the integrand.
 
  • #5
Can you scale your variables so that [itex]\delta \approx 1[/itex]? That would be the usual way of handling this.
 

FAQ: How to work around this equation giving infinities in the numerical calculation?

Why does this equation give infinities in numerical calculations?

There are several reasons why an equation may give infinities in numerical calculations. One common reason is that the equation is undefined for certain values, such as dividing by zero. Another reason could be that the equation is approaching a singularity, where the value becomes infinitely large or small.

How can I avoid getting infinities in my numerical calculations?

To avoid getting infinities in your numerical calculations, you can try using a different numerical method or algorithm. You can also try adjusting the precision or tolerance of your calculations. Additionally, checking for any potential singularities in the equation beforehand can help prevent infinities.

Can I still use an equation that gives infinities in numerical calculations?

Yes, you can still use an equation that gives infinities in numerical calculations as long as you are aware of the potential issues and take steps to address them. This could include using alternative methods, adjusting parameters, or applying mathematical techniques to handle infinities.

How do I know if an equation will give infinities in numerical calculations?

There is no definitive way to know if an equation will give infinities in numerical calculations without actually performing the calculations. However, you can look for any potential singularities or undefined values in the equation and test it with different inputs to get an idea of its behavior.

Can infinities in numerical calculations affect the accuracy of my results?

Yes, infinities in numerical calculations can affect the accuracy of your results. Infinities can cause errors to propagate and can also lead to numerical instability. It is important to be aware of potential infinities and take steps to minimize their impact on the accuracy of your calculations.

Back
Top