Numeric Solutions to The Heat Equation
I have been reading a lot on Lucia’s blog about two box models which are essentially an approximation of the heat equation with basis functions which are constant over a box.
The heat equation is given by:
or equivalently:
The fundamental solutions or Greens functions (also see main body theory) are of the form:
This suggests my choice of a negative exponential basis in my post (Lagrangian Mechanics and the Heat Equation) was not two bad a choice although, Guasian functions will decay slightly faster then negative exponentials.
Not all solutions are based on on fundamental solutions for instance in the post (Approximations used in CrankNicolson method for solving PDEs numerically) I read that the CrankNicolson method was the standard method of soliving the Heat equation numericaly.
For instance in 1D
the Cranck Nicholson Method is given by:
It should be noted that this method produces a difference equation. The values at the next time step can be solved for analytically, using cramer’s rule (see also Invertible matrix, analytic solutions). The frequency domain characteristics can be explored using the z transform. Where the frequency response is given by evaluating the z transform along the unit circle.
Also note that numeric error can be reduced when computing future time steps by either recursive squaring:
or by using matrix decomposition.
For other numeric method of solve partial differential equations see (Numerical partial differential equations), which I posted in the thread (Preparation for PDEs).
Further with regards to crank Nicholson, there is no time dependency on the right hand side of the equations so other methods, can be used to descretize the heat equations such as using Laplace transforms or the matrix exponential.
With regards to Lucia’s blog
My understanding as posted in (Arthur’s Case 2 (I think)) that the main focus of Lucia’s blog posts is to test the model chosen by Tamino:
lucia (Comment#19822) September 12th, 2009 at 9:23 pm
What I mean is– when testing the two box model, you don’t switch to the diffusive model even if it’s more inherently sensible and intelligent. That’s because to test “X” you must test “X”. You can’t test “Y” even if “Y” seems more likely to pass the test.
This is fine but I think that a wider discussion is warranted about how this model is just a simplified version of the heat equations and what principles of modeling and differential equations can be useful to obtain better solutions.
The Cross Product in Non Orthogonal Coordinate Systems
The form of the cross product I’ve shown in my post Coriolis Forces is:
The components of this cross product can be written as follows:
We will abbreviate these relationships as follows:
Now define the coordinate transform:
where
Then the cross product components can be written as follows:
Now Right multiplying the matrix by the transform gives:
Which can be written in this form:
Where:
Laplace Transform of f(t) Related to smoothed f(t)?
When reading (Comment#18839) I started to wonder if there was a relationship between the Fourier Transform of a smoothed signal and the Laplace transform. I assumed there was a relationship (Comment#18854). After further derivation, I recommenced that if the goal is to derive the Laplace transform from the Fourier transom of the filtered signal:
1) The signal be properly windowed.
2) The FFT of the windowed Fourier Transform, needs to be compensated for the frequency effects that resulted from the low pass filter.
Weather it is a good idea to compute the Laplace transform from a windowed FFT of a filtered signal is outside of the scope of this thread (but feel free to comment bellow) .
The Laplace transform is given by:
1)
The Fourier transform is given by:
2)
The Two Sided Laplace Transform is given by:
3)
Therefor the Fourier transform is the two sided Laplace transform evaluated at
Returning to the one sided Laplace transform:
4)
5)
Let:
6)
7)
8)
where the low pass filtered version of f(t):
9)
and is the convolution of f(t) and the impulse response of a filter (or atleast aproximatly so) with bandwidth .
Plugging this result into integration by parts gives:
10)
or equivalently:
11)
The first two terms show how the endpoints chosen effect the transfrom. These two terms will cancel for a given frequency if the distance between the endpoints is some multiple of the period. The last term is the Fouier transform of the smoothed function with the frequencies weighted by and using a windowing function
(note the multiple is there because the Fourier transform variable is the Laplace transform variable but rotated by 90 degrees.)
The effect of the windowing function is to smooth the frequency response. This is because multiplication in the time domain is equivalent to convolution in the frequency domain. The following Fourier transform relationship is useful (relationship 205):
12)
Note, that if a non causal filter was used for the smoothing the relationship is much simpler.
13)
In both cases to properly deal with the end points the time shifting property of the Fourier transform is needed (relationship 102):
14)
Applying this property to the last two relationships gives:
15)
16)
Strictly dealing with the case where a causal filter is used and applying the rule for the Fourier transform of a convolution (Rule 109) we obtain:
17)
of equivalently:
18)
Some Comments:
1) If is negative the system is causal, and the filtered version of the signal will be causal.
2) Computing the smoothed signal does not save any computations with regards to computing the Laplace transform.
3) The derivation seems to show that their is a relationship between Laplace trancform and a windowed Fouier transform of the filtered signal.
4) To compute the Laplace transform based on the orginal signal use equation (5). To compute it based on the filtered signal use equation (11).
Hoskins and Simmons (1974) Coordinate System
sHoskins and Simmons (1974) Coordinate System
Hoskin and Simon used the following coordinate system:
where theta is the latitude.
Where is the surface pressure and is the verticle coordinate.
is the longitude.
This coordinate system is also used in the following model which was recomended to me as a simple model:
As the complexity of general circulation models has been and still is growing considerably, it is not surprising that, for both education and research, models simpler than those comprehensive GCMs at the cutting edge of the development, are becoming more and more attractive. These medium complexity models do not simply enhance the climate model hierarchy. They support understanding atmospheric or climate phenomena by simplifying the system gradually to reveal
the key mechanisms. They also provide an ideal tool kit for students to be educated and to teach themselves, gaining practice in model building or modeling. Our aim is to provide such a model of intermediate complexity for the university environment: the PlanetSimulator. It
can be used for training the next GCM developers, to support scientists to understand climate processes, and to do fundamental research.
http://www.mi.unihamburg.de/216.0.html?&L=1
In order to use the coordinates given by Hoskins and Simmons in the Navier Stokes equations it is necissary to find the operations for Div Grad and Curl in this coordinate system. You can get a free PDF here:
http://www.scribd.com/doc/2590597/LecturesonTransformationofCoordinates
Which shows how to derive these operations for any coordinate system. These derivations express the apove operations in terms of scaling quantities. The scaling quantitys are the magnitude of the derivative of the change in postion, with respect to a change in one of the coordinates in the new coordinate system.
In our case for the coordinate the scalling quanity is:
because when you change latitude the distance moved is proportional to the radius multiplied by the change in latitudinal (measured in radians).
Now expressing the latitude in terms of
Now for the which is the longitude coordinate, depends on how you define zero latitude. The distance changed for a given change in longitude is the product of the change in logitude (measured in radians) multiplied by the distance to the earths axis of rotation. If zero lattitude is the center of the earth then this distance is if zero latitude is the north pole (typical in spherical coordinates) then this distance is .
We will see that taking zero latitude as the north pole will be simpler.
But Therefore:
The vertical coordinate is the ratio of the hydrostatic pressure to the hydrostatic pressure at sea level.
In Hoskins & Simmons the hydrostatic pressure used in the coordinate ignores the lapse rate. In some models variations on this are used. For instance in a model used by Judith Curry this coordinate is somewhat adjusted based on the surface topology of the earth. (see my post: hybird Coordinate System)
In Curries model this is done to try and keep wind flow on the horizontal plane. Anyway, the equation for hydrostatic equilibrium is:
Now:
Hmmmmmmm: From what I’ve done the only way I can see to make the constants disappear is to set
Here is what Hoskins and Simmons have to say about temperature scaling and such.
all nondimensionalized using as length scale the radius of the planet, a, ; as time scale the reciprocal of its angular velocity ; temperature scale (R as the gas constant) and pressure scale Bar.
In http://www.mi.unihamburg.de/fileadmin/files/forschung/theomet/planet_simulator/downloads/PS_ReferenceGuide.pdf was taken to be 250K. Some numbers of rellevence:
Gas constant of air: 287.058 J kg−1 K−1
and for the molar mass of air:
Standard temperature =273.16k
Source for the molar mass of air:
Standard pressure=1 Atm=1013.250*10^2 Pa.
The molar mass of air at standard temperature and pressure is 28.964*10^3 kg/mole. Molar
http://www.blurtit.com/q139778.html
Standard Gravity: 9.80665 m/s2
Vector Identities and Derivations
To derive the prognostic equations in a GCM usually requires the use of vector identities. Here is a list of some links which give vector identities:
http://en.wikipedia.org/wiki/List_of_vector_identities
http://en.wikipedia.org/wiki/Product_rule
http://en.wikipedia.org/wiki/Vector_calculus_identities
http://mathworld.wolfram.com/VectorDerivative.html
http://planetphysics.org/encyclopedia/VectorIdentities.html
http://geo.phys.spbu.ru/~runov/SPIntro/SPIntro_15.pdf
I’ve been searching for the derivations of these identities and have found an excellent source:
Vector algebra is a powerful and needful tool for Physics but unfortunately, due to lack of mathematical skills, it becomes misleading for first undergraduate courses of science and engineering studies. Standard vector identities are usually proved using Cartesian components or geometrical arguments, accordingly. Instead, this work presents a new teaching strategy in order to derive symbolically vector identities without analytical expansions in components, either explicitly or using indicial notation. This strategy is mainly based on the correspondence between threedimensional vectors and skewsymmetric secondrank tensors. Hence, the derivations are performed from skew tensors and dyadic products, rather than cross products. Some examples of skewsymmetric tensors in Physics are illustrated.
http://www.citeulike.org/user/pak/article/4524046
http://arxiv.org/PS_cache/arxiv/pdf/0904/0904.1814v1.pdf
This will require some understanding of some concepts of tensor algebra. Here are some helpfull links of concepts that will be needed:
http://www.foamcfd.org/Nabla/guides/ProgrammersGuidese3.html
http://en.wikipedia.org/wiki/LeviCivita_symbol
http://en.wikipedia.org/wiki/Dyadics
http://en.wikipedia.org/wiki/Pseudovector
As a side note, the prognostic equations are typically derived from the vorticy equation. See:
http://en.wikipedia.org/wiki/Vorticity_equation
http://en.wikipedia.org/wiki/Barotropic_vorticity_equation
Small Region Aprox. of Spherical Harmonics
The beauty of the method I orginaly proposed, is that if you take a small enough region of the earth the grid becomes rectangular. This means, that over a small region, spherical harmonics, will look more like sine, and cosine functions.
If we use sine and cosine functions to approximate spherical harmonics over a small region the mathematics is greatly simplified and we can use standard FFTs, to compute the spectral components over this region. In fact little will be gained in this case by using the FFT instead of the DFT because we can use information about the spectral components, computed over one small region, to reduce the computation of the spectral components in an overlapping spectral region. This recurive comutation, will only be of linear complexity while the FFT is loglinear complexity.
Of course on a large scale we want to take fall advantage of the FFT like alrorithims to compute the spectral components, but when it comes to small scales we want to use interpolationg functions which capture the local rather then the global behavior and consequently we need a new DFT for each small overlapping region and therefore recursive algorithims are more efficient then FFTs.
Some consideration needs to be given as to weather, a Fourier Series is a good interpolating function for small regions of Navier stokes equations. Aproximation, can be done with regards to another bais but the foier series, has a lot of advantages in terms of computational complxity. Even if another basis is used, it can be used in conjuction with the FFT by using one of the basis to interpolate the error given that truncated expansion in terms of the other basis.
Recursive Numeric Integration, The FFT and Spherical Harmonics
I was briefly exploring various methods of numeric integration, because if any spectral techniques are used (e.g. Spherical Harmonics) then, the computation of there coefficients involves an inner product between the basis function, and the properties of the earth who’s spectral expansion is being computed. The computation of the inner product involves integration.
In order to reduce computations, some kind of recursive integration may be desirable. Examples include: Clenshaw Curtis_Quadratures, Gaussian Quadrature, Romberg method.
These are of course one dimensional techniques. An interesting concept for multiple dimensional integrals is as follows:
Recursive Integration Methodologies with Statistical Applications
A. J. Hayter, Industrial & Systems Engineering
Georgia Tech, Atlanta, USA
SummaryThis paper shows how recursive integration methodologies can be used to evaluate high dimensional integral expressions. This has applications to many areas of statistical inference where probability calculations and critical point evaluations often require such high dimensional integral evaluations. Recursive integration can allow an integral expression of a given dimension to be evaluated by a series of calculations of a smaller dimension. This significantly reduces the computation time. The application of the recursive integration methodology is illustrated with several examples.
http://www2.isye.gatech.edu/statistics/papers/0427.pdf
As for the single dimension methods of integration, Gaussian quadrature works well, when the function being ingegrated is well approximated by a polynomial. Romberg is quite interesting, it will work for uneven step sizes. It is derived by applying Richardson extrapolation (Richardson 1910) repeatedly on the trapezium rule.
Clenshaw Curtis_quadratures is particularly interesting. In this method a change of variables is done by letting x=cos(theata). This reduces the problem of integration to the problem of finding the Fourier series, which can be efficiently by using the Fast Fourier Transform. The Fast Fourier Transform has the advantage that the computational complexity grows with the logarithm of the number of the points.
In climatology spherical harmonics are used to represent the spectrum instead of Fourier Transforms. It is worth checking to see if there are efficient ways to compute these transforms. Some relevant links include:
AbstractSpherical Harmonic Transforms (SHTs) which are essentially Fourier transforms on the sphere are critical in global geopotential and related applications. Among the best known strategies for discrete SHTs are Chebychev quadratures and least squares. The numerical evaluation of the Legendre functions are especially challenging for very high degrees and orders which are required for advanced geocomputations. The computational aspects of SHTs and their inverses using both quadrature and leastsquares estimation methods are discussed with special emphasis on numerical preconditioning that guarantees reliable results for degrees and orders up to 3800 in REAL*8 or double precision arithmetic. These numerical results of spherical harmonic synthesis and analysis using simulated spectral coefficients are new and especially important for a number of geodetic, geophysical and related applications with ground resolutions approaching 5 km.
http://www.springerlink.com/content/tn78433n5h53505h/
and:
SpharmonicKit is a collection of routines, written in C, which implement discrete Legendre and spherical harmonic transforms by a number of different algorithms. For certain algorithms, code for the inverse transform is also provided. Included as well are routines for spherical convolutions.The Legendre transforms in the Kit require that a function of bandwidth B be sampled on the 2Bmany Chebyshev points and not the Bmany Gaussian points. Therefore, the number of samples needed is twice the function’s bandwidth. This implies that for the spherical transforms in the Kit, a function of bandwidth B is sampled on the equiangular 2Bx2B grid on the sphere.
Some of the algorithms implemented in this package are based on the work of Driscoll and Healy. A preprint that offers a detailed development and description of the algorithms implemented in SpharmonicKit is here.
Caveat emptor – this is research code only and has not been hardened. All the code works quite well on DEC Alpha workstations using OSF1 Versions 3.2 and 4.0. Some code has also been tested and successfully run on Pentiumbased GNU/Linux workstations, SGI workstations using IRIX 5.3 and IRIX 6.4, Sun workstations using SunOS 4.1.2 1, an HP Exemplar XClass running SPP–UX 5.2.1, and even a NeXTstation Color Turbo running NeXTStep 3.3!
We would also like to mention that there exists other software for performing spherical transforms. Details on other possibilities may be found here.
http://www.cs.dartmouth.edu/~geelong/sphere/
Spectral Solutions to the prognaustic equations
In some GCMs spectral solutions (see [1] For instance) to the prognaustic equations are sought out. This is either done for long term predictions or for reasons of stability testing. Another reason to use spectral solutions, is to relate points, in space and time, so that we can extrapolate both spacialy and temporarily given that we are given limited data.
Spectral solutions also seem to be useful for separating fast gravity waves from slower nonlinear dynamics as is done in:
http://www.mi.unihamburg.de/216.0.html?&L=1
I don’t really have much to say about this at the moment. I am wonder what is the basis for using spherical harmonics, for the basis expansion. It is true that spherical harmonics form a linear independent basis but they also arise as the solution to Laplace’s equation. I’m wondering if there is any connection.
I was thinking a bit about what predictive properties these basises must have. If we are trying to use information at Y(P2) to estimate Y(P1), then the amount the point P2 contributes to the basis expansion is:
Y(P1)=sum_i f_i(P1)fi(P2)Y(P(2))
where:
Y(P1) is the value of the property at P1
Y(P2) is the value of the property at P2
f_i(P1) is the ith basis funciton evaluated at P1
f_i(P2) is the ith basis function evaluated at P2
Notice that the quantity:
sum_i f_i(P1)fi(P2)
acts like a correlation coefficent between Y(P1) and Y(P2)
it is not clear in general if this quantity will converge but if we instead of choosing a single point Y(P2) integrate about some region around Y(P2) then the higher frequency basis functions will become less significant to this correlation.
Therefore it might be usefull to develop some expressions for the integral of this over a sufrace area corresponding to the smallest grid resolution. It is worth considering basis functions that may be easier to integrate then, integrating spherical harmonics.
Another question, is with regards to the choice of extrapolation funciton what will give good extrapolation along the z component. There are solid spherical harmonics, but the verticle components of these are not orthogonal.
[1] A multilayer spectral model and the semiimplicit method by B J. Hoskins and A.J. Simmons

Recent
 Laplace Transform Via Limits
 log(CO2) and Scary Graphs
 Numeric Solutions to The Heat Equation
 Coriolis Forces in Hopkins and Simmons Vorticity Equation
 The Cross Product in Non Orthogonal Coordinate Systems
 Lagrangian Mechanics and The Heat Equation
 Laplace Transform of f(t) Related to smoothed f(t)?
 Coriolis Forces
 Vector Operations in Hoskins and Simmons Coordinates
 API/Object Viewers/Memory Mapping/
 Defining a Microsoft access Datasource
 Fractal Modeling of Turbulence

Links

Archives
 July 2012 (1)
 September 2009 (5)
 August 2009 (19)
 March 2009 (2)

Categories

RSS
Entries RSS
Comments RSS