The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: interopolation with method log, ln, or exp(-x)
Replies: 3   Last Post: Apr 4, 2013 3:51 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2,359
Registered: 12/6/04
Re: interopolation with method log, ln, or exp(-x)
Posted: Apr 4, 2013 3:51 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

ime"Jonathan W Smith" wrote in message <kjkabm$b68$>...
> "someone" wrote in message <kictr5$ajb$>...
> > "Jonathan W Smith" wrote in message <kicmao$ek3$>...
> > > Hello
> > > I have 3D gas constituent data from a model. The gas constituent data is on pressure levels. The pressure is on the 3D grid as well. Pressure falls exponentially with height. However I want to interpolate based on a different set of 3D pressure levels from satellite data.
> > >
> > > Is it best to use interp2 or interp3? Just as there is method 'linear' or 'cubic', is there one for ln (natural log) or exponential decay? If not, what function or set of functions can I use to substitute for this?

> >
> > If I understand your question, I don't believe there is a "best" answer.
> > It really depends on your data and what you want to do with it.
> >
> > If x is a vector, y = exp(x), and you want to interpolate y (by any method) then you could do either:
> >
> > z = interp(y)
> >
> > or
> >
> > z = exp(interp(x))
> >
> > Its really YOUR choice.

> > >
> Thanks for your response, but still what if you have an 3D array and you wanted to interpolate along the 3rd dimension? Just like we have the choice of implementing method 'linear' and 'cubic', is there one for exponential?

> > > Thanks
> > > Jonathan

I'm still not sure what you mean by "The pressure is on the 3D grid as well." But I'll take a stab at it. The short answer might be to look at the MathWorks Curve Fitting Toolbox. I am supposing you have collected some gas data where:

g = f(x,y,h)

and you know g varies linearly with x&y but decays exponentialy with h. Now you want to find g for some x1,y1,h1. I would define a new function gprime where:

gprime = f(x,y,ln(h))

Now linearly interpolate gprime (using interp2 or interp3) so that:

gprime1 = f(x1,y1,ln(h1))

this shoud give you g at x1,y1,h1.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.