# Latitude & longitude & air pressure

1. May 22, 2013

### wachovia

Hi there,

I have a peculiar question. Imagine that you are in a earth position, obtained by google, that gives you the latitude and longitude. Those values are given in the decimal notation (ex: lat=20.44 ; long=-8.5).

Now imagine that you want to know the air pressure in your position. So, you will get it from metar statios (metereologic stations along the countries). If you visit the three closer metar stations, you won't be able to do
, because the air pressure in the metar station that is closer from your position has more weight to the calculus of the final air Pressure in you position.

I also know the latitude and longitude of the three metar stations and I also know the distance between my position and those stations.

How can I calculate the pressure in my position based on weights?

Thanks

Wachovia

2. May 22, 2013

### MisterX

I suppose you could weight the pressure measurements by the great circle distance from your position.

$P = \frac{D_1P_1 + D_2P_2 + D_3P_3 }{D_1 + D_2 + D_3}$

3. May 22, 2013

### 256bits

Another method would be to assume the pressure follows a linear function from one station to the another. You can model it as 3 points, a,b,c forming a plane , with coordinates x and y being the latitude and longtitude, and z being the air pressure. Your air pressure would be the value of z at a point lying on the plane.

So if you remember your early geometry days, of where a line perpendicular to the x-y plane ( at your coordinates ) intersects a plane formed by points a, b,c you could do it that way.

4. May 23, 2013

### CWatters

and just hope there isn't something like a weather front between you and some of the stations.

5. May 23, 2013

### wachovia

, can I use the decimal values of latitude and longitude to x and y ? Or should I convert them to another value?

6. May 23, 2013

### physwizard

You are giving the greatest weightage to the station which is farthest away. How would that work?!

7. May 23, 2013

### physwizard

I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by $p=a_1 + a_2d + a_3d^2.$, where $d=\sqrt(x^2+y^2)$. Plug in the values of d at the three locations to get the values of the three constants. The value of $a_1$ would be the pressure at your location.
A really good calculation would need to correctly incorporate the variation of pressure with temperature and altitude though.
Why not just get a barometer? Cheaper than a GPS device.

Last edited: May 23, 2013
8. May 23, 2013

### wachovia

Absolutly true

9. May 23, 2013

### wachovia

What is x and y ? decimal latitude and longitude? Or can D be the distances that I'v already calculated?

Last edited: May 23, 2013
10. May 23, 2013

### physwizard

d is the distance along the surface of the earth(taken at the same altitude) of these stations. If you assume the earth as a sphere, you can approximately get x and y by $x=(Rcos\theta_2)\phi_2-(Rcos\theta_1)\phi_1$ and $y=R(\theta_2-\theta_1)$ . Where the subscripts 2 and 1 indicate respectively the station and your location. θ and $\phi$ are the latitudes and longitudes respectively. If you assume the earth as an ellipsoid(more accurate) these calculations would be more complex. The expression for calculating distance $d=\sqrt(x^2+y^2)$ assumes that the points are close enough that you can neglect the curvature of the earth. If not, then you would have to actually find the distance along the geodesic connecting the two points.

Last edited: May 23, 2013
11. May 23, 2013

### MisterX

poorly

my apologies

This should be better

$P =\left( \frac{P_1}{D_1} + \frac{P_2}{D_2} + \frac{P_3}{D_3}\right)\frac{1}{\frac{1}{D_1} + \frac{1}{D_2} + \frac{1}{D_3} } = \frac{D_2 D_3 P_1 + D_1 D_3 P_2 + D_1 D_2 P_3}{D_2 D_3 + D_1 D_3 + D_1 D_2 }$

12. May 23, 2013

### MisterX

There is a problem with this technique. Consider what happens if two stations have similar values of $d$ but are geographically separated and have different pressure. One could end up with unreasonably large or small values of $a_1$. See the attached picture for an example.

I think that the method employed should only generate pressures that are between the pressures given by the stations.

#### Attached Files:

File size:
1.9 KB
Views:
131
Last edited: May 23, 2013
13. May 23, 2013

### someGorilla

What if the three locations are equidistant from you but with different pressures?
Our almost equidistant and with different pressures? You can get VERY strange results.

Edit: oops MisterX beat me to it

14. May 23, 2013

### physwizard

Quite true. This would lead to an inconsistency(many valued). Isotropy cannot be assumed in general.
Actually, if you assume everything is at the same altitude, we can assume an equation like this:
$p = a + bx + cy$ for the purpose of interpolation.
If the altitudes are different, the z direction would need to be factored in as well.
The right way to model this really would be to take into account the physics and other factors like temperature.

Last edited: May 23, 2013
15. May 23, 2013

### Aero_UoP

Even pilots don't need this kind of accuracy...
The differences in the values that will be obtained will be neligible.
Just use the data from the closest station.

16. May 23, 2013

### 256bits

Yes you can use latitude-longitude values.

the basic equation of a plane is Ax + By +Cz + D = 0
what you would be doing is finding the equation of a graph relating air pressure ( z) with the location ( x and y )

How to find the plane with 3 points.
http://www.math.washington.edu/~king/coursedir/m445w04/notes/vector/equations.html

the x and y are your latitude and longtitude.
the z is your air pressure.

then when you have found your equation substute x and y for your own location to give you your z which is your air pressure.

As I stated before, this assumes a linear location-pressure relationship, so if the stations are not too far apart that asumption may be true.

Qnce you have your equation you do all sorts of things with it, such as change of pressure with direction, direction of maximum change, ie directional derivatives, gradient, it could become useful depending on what your plan is.
knowing dot cross product, analytical geometry and calculus applied to such would be helpful.

Last edited: May 23, 2013
17. May 24, 2013

### wachovia

The air pressure has a decrease variaton from north to south.
If I have three points, aligned from north to south with Pressures : p1=1020hPa ; p2=1017hPa ; p3=1013hPa and a point P, who's at south of the point 3, the pressure in P must be smaller then p3 (1013hPa).

Can your fomula present that result?

18. May 24, 2013

### wachovia

Its not a true solution. If I have, for example three points from North to south, with pressures p1=1020 ; p2=1017 and p3=1013. And if i'm in a position that is at south of p3, there, air pressure must be smaller then p3, but with your formula, I have a value near 1014 or 1015.. That's not right, we can't use Air pressure calcution with weights :)

19. May 24, 2013

### Aero_UoP

20. May 24, 2013

### 256bits

If that is the case then a simple equation of a line through 3 points would be sufficient, or an approximation of the best fit line, and then extrpolate to your 4th point.

you should note that with only 3 points as your data set, there could be many equations that can describe the variation of pressure over the surface ( line in the special case of 3 data points in a row ) , which is why I suggested as taking the linear model approach.

What you are actually asking is what equation descibes the variation of air pressure given 3 points, and that is impossible to say. For example, a sinusoidal variation with frequency/amplitude dependancy could apply, so could some sort of quadratic function, ..., etc, and all are equally valid since the a priori function is unknown. Each equation would necessarily have a different weighting value applied to the points and subsequentaly your 4th point is basically unknown until you can actually describe the relationship. Without the function, assume the most basic and that would be linear.

21. May 24, 2013

### wachovia

Theres's not missing the a4 and also the respective d ?

I tried your formula (without the third pressure and x,y position) and its not working, it gaves me a big value (1824347.62).. I don't know why!

a1=1018
a2=1018
a3=1018

x2=40.2
x3=40.9

y2=-8.55
y3=-8.65