GRID3 Problems [message #84989] |
Thu, 20 June 2013 12:48  |
seanelvidge
Messages: 11 Registered: January 2013
|
Junior Member |
|
|
Hi all,
I seem to be having a fairly common problem when using GRID3, even though it is common I still can't fix it!
The problem is the dreaded "Ill-conditioned matrix or all nodes co-planar".
The info; I have a model simulation (of atmospheric densities) which is spaced over a grid and have lat (dimension 36), lon (dimension 72) and alt (dimension 54) arrays and then the actual densities (dimension [36,72,54]). However what I want to do is sample this simulation space with a (different) specific set of lat's, lon's and alts (I am trying to compare the output to observations, but of course the observations don't fall exactly on the model grid!).
So as far as I can tell the right thing to use for this is GRID3, right?
I have created some form of mesh grid from the model to give me x_lat (dimension 139968), y_lon (139968), z_alt (139968), mesh_den (139968) so they can be used in GRID3.
So then what I was hoping to do was:
Result = GRID3(x_lat, x_lon, x_alt, mesh_den, obs_lat, obs_lon, obs_alt, /GRID)
Where obs_* represents the lat, lon and alt of the observations.
However the GRID3 call gives me:
% GRID3: Ill-conditioned matrix or all nodes co-planar.
% Program caused arithmetic error: Floating underflow
The densities are pretty small (between 4e-17 and 1e-6) so I thought that might be the problem, and indeed I can get the 'Ill-conditioned matrix' line to go away with an absurdly small dtol (0.0000000000000000000000000000000000000000000001D, that is the first value that worked!), however this leaves me with a result of mostly just -NaN's (with the odd value that looks right).
Does anyone have any pearls of wisdom to help me along?
Many thanks,
Sean.
|
|
|
|
Re: GRID3 Problems [message #84991 is a reply to message #84990] |
Thu, 20 June 2013 13:03  |
seanelvidge
Messages: 11 Registered: January 2013
|
Junior Member |
|
|
Thanks for the speedy reply David.
I tried, separately, multiplying the data by 1e11 and 1e17 (with and without the dtol) with the same results.
When I use the very small dtol (and the result is filled with -NaN's) I get the following errors:
% Program caused arithmetic error: Floating divide by 0
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand
Which I guess means that -NaN's are coming from the machine just rounding values to 0.
|
|
|