|
|
| Author |
Message |
Martin Jørgensen science forum beginner
Joined: 17 Apr 2006
Posts: 20
|
Posted: Sat May 27, 2006 3:11 pm Post subject:
2D interpolation ? How?
|
|
|
Hi,
Suppose we have a geometry like:
1------------------------2 \
| | \
| | |
| | |
| | |
| | |
| | \ this is the vertical
| x | / spacing, "dy".
| | |
| | |
| | |
| | |
| | |
| | /
3------------------------4 /
\ /
\---------- ----------/
\/
this is the horizontal
spacing, "dx".
Suppose in each of the 4 corners we know the force, the temperature, the
noise-level or whatever, then it's clear that in the center (marked "x")
interpolation will lead to x = (1+2+3+4)/4.
If "x" was in the "4"-corner, then x = 100% * 4 + 0% * (1+2+3).
What is the general equation/formula?
1------------------------2 \
| ^ | \
| | | |
| dy' | |
| | | |
| v | |
| x<-dx'->| \ this is the vertical
| | / spacing, "dy".
| | |
| | |
| | |
| | |
| | |
| | /
3------------------------4 /
\ /
\---------- ----------/
\/
this is the horizontal
spacing, "dx".
It must be something like: x = (dx-dx')* ? + (dy-dy') * ? (1-(dx-dx')) *
?? + (1-(dy-dy'))
I need the ? to be replaced by something... Am I on the right track or
how to solve this problem the best way?
A numerical algorithm is welcome, since I'll program this in C.
Best regards / Med venlig hilsen
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk |
|
| Back to top |
|
 |
Roy Stogner science forum beginner
Joined: 13 Jun 2005
Posts: 38
|
Posted: Sat May 27, 2006 5:28 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
On Sat, 27 May 2006 17:11:25 +0200, Martin Jørgensen wrote:
| Quote: | Suppose in each of the 4 corners we know the force, the temperature, the
noise-level or whatever, then it's clear that in the center (marked "x")
interpolation will lead to x = (1+2+3+4)/4.
If "x" was in the "4"-corner, then x = 100% * 4 + 0% * (1+2+3).
What is the general equation/formula?
1------------------------2 \
| ^ | \
| | | |
| dy' | |
| | | |
| v | |
| x<-dx'->| \ this is the vertical
| | / spacing, "dy".
| | |
| | |
| | |
| | |
| | |
| | /
3------------------------4 /
\ /
\---------- ----------/
\/
this is the horizontal
spacing, "dx".
It must be something like: x = (dx-dx')* ? + (dy-dy') * ? (1-(dx-dx')) *
?? + (1-(dy-dy'))
I need the ? to be replaced by something... Am I on the right track or
how to solve this problem the best way?
|
It looks like you're having trouble because you're trying to find a
linear formula when you want a bilinear one. Using u to represent the
dependent variable,
u = (dx'/dx)*(dy'/dy)*u3 + (1 - dx'/dx)*(dy'/dy)*u4 +
(dx'/dx)*(1 - dy'/dy)*u1 + (1 - dx'/dx)*(1 - dy'/dy)*u2
---
Roy Stogner |
|
| Back to top |
|
 |
Martin Jørgensen science forum beginner
Joined: 17 Apr 2006
Posts: 20
|
Posted: Sat May 27, 2006 9:30 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
Roy Stogner wrote:
| Quote: | On Sat, 27 May 2006 17:11:25 +0200, Martin Jørgensen wrote:
-snip- |
| Quote: | It looks like you're having trouble because you're trying to find a
linear formula when you want a bilinear one. Using u to represent the
dependent variable,
u = (dx'/dx)*(dy'/dy)*u3 + (1 - dx'/dx)*(dy'/dy)*u4 +
(dx'/dx)*(1 - dy'/dy)*u1 + (1 - dx'/dx)*(1 - dy'/dy)*u2
|
Thanks a lot. That looks intuitively correct, so I'll use that. I didn't
know that was called a "bilinear" formula.
Best regards
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk |
|
| Back to top |
|
 |
Julian V. Noble science forum Guru Wannabe
Joined: 03 May 2005
Posts: 148
|
Posted: Sat May 27, 2006 11:54 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
Martin Jørgensen wrote:
| Quote: | Hi,
Suppose we have a geometry like:
1------------------------2 \
| | \
| | |
| | |
| | |
| | |
| | \ this is the vertical
| x | / spacing, "dy".
| | |
| | |
| | |
| | |
| | |
| | /
3------------------------4 /
\ /
\---------- ----------/
\/
this is the horizontal
spacing, "dx".
Suppose in each of the 4 corners we know the force, the temperature, the
noise-level or whatever, then it's clear that in the center (marked "x")
interpolation will lead to x = (1+2+3+4)/4.
If "x" was in the "4"-corner, then x = 100% * 4 + 0% * (1+2+3).
What is the general equation/formula?
1------------------------2 \
| ^ | \
| | | |
| dy' | |
| | | |
| v | |
| x<-dx'->| \ this is the vertical
| | / spacing, "dy".
| | |
| | |
| | |
| | |
| | |
| | /
3------------------------4 /
\ /
\---------- ----------/
\/
this is the horizontal
spacing, "dx".
It must be something like: x = (dx-dx')* ? + (dy-dy') * ? (1-(dx-dx')) *
?? + (1-(dy-dy'))
I need the ? to be replaced by something... Am I on the right track or
how to solve this problem the best way?
A numerical algorithm is welcome, since I'll program this in C.
Best regards / Med venlig hilsen
Martin Jørgensen
|
Abramowitz & Stegun is your friend. Look at 25.2.65ff.
--
Julian V. Noble
Professor Emeritus of Physics
University of Virginia |
|
| Back to top |
|
 |
Martin Jørgensen science forum beginner
Joined: 17 Apr 2006
Posts: 20
|
Posted: Sun May 28, 2006 2:26 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
Julian V. Noble wrote:
| Quote: | Martin Jørgensen wrote:
-snip- |
| Quote: | Abramowitz & Stegun is your friend. Look at 25.2.65ff.
|
Thanks a lot... The 3-point formula is even better for me...
I'm wondering if this website is legal or isn't there any copyright on
that? Because then I would just include the webpage-reference in my list
of references...
From: http://www.math.sfu.ca/~cbm/aands/
"Before any lawyers gets their knickers in a bunch about this,
Abramowitz and Stegun: Handbook of Mathematical Functions is a work
commissioned by the government of the United States of America and is
not under copyright (to the best of my knowledge—bring on the
cease-and-desist letters if you think I’m wrong)."
Do you know if that's true?
Best regards
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk |
|
| Back to top |
|
 |
Gordon science forum beginner
Joined: 19 Oct 2005
Posts: 28
|
Posted: Mon May 29, 2006 1:40 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
Martin Jørgensen wrote:
| Quote: | Roy Stogner wrote:
On Sat, 27 May 2006 17:11:25 +0200, Martin Jørgensen wrote:
-snip-
It looks like you're having trouble because you're trying to find a
linear formula when you want a bilinear one. Using u to represent the
dependent variable,
u = (dx'/dx)*(dy'/dy)*u3 + (1 - dx'/dx)*(dy'/dy)*u4 +
(dx'/dx)*(1 - dy'/dy)*u1 + (1 - dx'/dx)*(1 - dy'/dy)*u2
Thanks a lot. That looks intuitively correct, so I'll use that. I
didn't know that was called a "bilinear" formula.
|
It could also be called 2D Lagrange interpolation, since it uses products of
polynomials in each direction. In this case the polynomials are linear. In
the finite element world, the quantities that multiply the grid point values
(u1, u2, u3, u4) are called shape functions. A shape function (or
interpolation function) associated with a given grid point has the property
that is takes the value unity at that grid point and zero at all other grid
points. |
|
| Back to top |
|
 |
Martin Jørgensen science forum beginner
Joined: 17 Apr 2006
Posts: 20
|
Posted: Mon May 29, 2006 3:47 pm Post subject:
Re: 2D interpolation ? How?
|
|
|
"Gordon" <gordo432xRemove@comcast.net> writes:
| Quote: | Martin Jørgensen wrote:
Roy Stogner wrote:
On Sat, 27 May 2006 17:11:25 +0200, Martin Jørgensen wrote:
-snip-
It looks like you're having trouble because you're trying to find a
linear formula when you want a bilinear one. Using u to represent the
dependent variable,
u = (dx'/dx)*(dy'/dy)*u3 + (1 - dx'/dx)*(dy'/dy)*u4 +
(dx'/dx)*(1 - dy'/dy)*u1 + (1 - dx'/dx)*(1 - dy'/dy)*u2
Thanks a lot. That looks intuitively correct, so I'll use that. I
didn't know that was called a "bilinear" formula.
It could also be called 2D Lagrange interpolation, since it uses products of
polynomials in each direction. In this case the polynomials are linear. In
the finite element world, the quantities that multiply the grid point values
(u1, u2, u3, u4) are called shape functions. A shape function (or
interpolation function) associated with a given grid point has the property
that is takes the value unity at that grid point and zero at all other grid
points.
|
Ok. I'll take a 10 ECTS FEM-course later and hopefully learn a lot of interesting stuff.
Best regards
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 9:26 pm | All times are GMT
|
|
Myspace Layouts | Credit Cards | Credit Counseling | Unsecured Credit Cards | Loans and Credit Cards
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
Other DeniX Solutions sites:
Electronics forum |
Medicine forum |
Unix/Linux blog |
Unix/Linux documentation |
Unix/Linux forums
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|