FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » num-analysis
2D interpolation ? How?
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
Martin Jørgensen
science forum beginner


Joined: 17 Apr 2006
Posts: 20

PostPosted: Sat May 27, 2006 3:11 pm    Post subject: 2D interpolation ? How? Reply with 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

--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Back to top
Roy Stogner
science forum beginner


Joined: 13 Jun 2005
Posts: 38

PostPosted: Sat May 27, 2006 5:28 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

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

PostPosted: Sat May 27, 2006 9:30 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

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

PostPosted: Sat May 27, 2006 11:54 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

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

PostPosted: Sun May 28, 2006 2:26 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

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

PostPosted: Mon May 29, 2006 1:40 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

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

PostPosted: Mon May 29, 2006 3:47 pm    Post subject: Re: 2D interpolation ? How? Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 9:26 pm | All times are GMT
Forum index » Science and Technology » Math » num-analysis
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts 2D Lagrangian interpolation deltaquattro@gmail.com num-analysis 0 Fri Jul 21, 2006 1:57 pm
No new posts Problems with interpolation of near z... deltaquattro num-analysis 0 Mon Jun 19, 2006 1:29 pm
No new posts Closed Periodic B-Spline Interpolation jaisingh@adelphia.net Math 0 Mon May 22, 2006 7:37 am
No new posts new interpolation algorithms kjinnovation@earthlink.ne num-analysis 0 Wed May 17, 2006 4:15 pm
No new posts cubic Hermite splines for interpolation franz.bauer78@yahoo.de Math 0 Tue May 16, 2006 10:33 am

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
[ Time: 0.3819s ][ Queries: 16 (0.2792s) ][ GZIP on - Debug on ]