cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Logarithmic Interpolation

lbny09
1-Newbie

Logarithmic Interpolation

I have a set of data in an array in which I shall do logarithmic interpolation.
Can anyone help me with this ?
29 REPLIES 29

On 12/4/2009 10:51:58 AM, lhbny1 wrote:
>I have a set of data in an
>array in which I shall do
>logarithmic interpolation.
>Can anyone help me with this ?
______________________________

The sense of that would be limited, very limited !
If you have a data set and if you fit a model, nothing more is needed. If you can't find a model, but instead an acceptable rational approximation (rational or else approximation), again not needed. And if the data set spans in he negative domain(s) ... that excludes logarithmic interpolation. And if the data set is not regular and only splinable, not needed again.
Attach the data set for collabs to look at it and advise.

Whatever you have,
linear interpolation is pretty standard and traceable to the effect of it.

jmG

Thanks for the answer. What is the best to choose of c- , p- or l-spline ?

No special rules, hust evaluate each one-by-one.

Any interpolation ought to be checked with another one to determine if the points between the calibration points are represented. A discrete Fourier interpolation won't agree between these points. The cure for that is to use a scaled Fourier transformn (Budapest).

What do you mean by "logaritmic interpolation"? For some data it is common to transform the independent variable by a logarithmic transformation prior to doing interpolation. This is typically done when the spacing of the tabled values is irregular, with the spacing roughy proportional to the value. Is this what you have and mean?

In terms of cubic splines unless you have some very specific reason to do otherwise use cspline. It is generally the most accurate, the others commonly producing significant errors near the end points.

Note that using a cubic spline requires reasonably smooth data, with a sampling density high enough to clearly resolve all significant features. Noise or inadequate sampling will cause the cubic spline to produce possibly large oscillations between the measured points. Always check the results of any interpolation.
__________________
� � � � Tom Gutman

You see, I know a very little about these things. I am working with a standard for pressure vessels. A note to a table says that "logarithmic interpolation" shall be used. That's all I know. Perhaps I shall take whay is the "worst" case for the different splines.

On 12/4/2009 3:29:48 PM, lhbny1 wrote:
>You see, I know a very little
>about these things. I am
>working with a standard for
>pressure vessels. A note to a
>table says that "logarithmic
>interpolation" shall be used.
>That's all I know. Perhaps I
>shall take whay is the "worst"
>case for the different
>splines.
_______________________________

That's all what you need: attach the data table.
"logarithmic interpolation" may not have much meaning in term of more modern and efficient interpolation methods. Maybe there is a good model to the data table. The question is simple: The data, if they come from a function, you just need the function. The data, if they were collected and concluded from experiments, certainly most of the suggestions will meet any debate, whereas in that case, what is the truth ? !

jmG

Post the data. That may show what is reasonable. Looking up logarithmic interpolation on the web indicates that the term is not used completely consistently, but mostly refers to interpolating using the logarithms of the y values. But sometimes the logaritms of the x values, or even both (log-log plots).
__________________
� � � � Tom Gutman

I guess that the table data that you are using have one or both axis as log scale, then must to use something that the author says as "log interpolation" instead the usual manual (i.e. handwriting) lineal interpolation.

Regards. Alvaro.

I attach a bit of the datatable.
I call 0.01 0.02 0.04 for X-values.
The Y-values can only be integers.
The note says that for values between X-values "Logarithmic interpolation" shall be used.
Exuse my poor english.

As presented, looks like an errata on the book (or where you found this): probably where says "logarithmic interpolation" must to say "linear interpolation". If not, I can't see any reason to do the proposed "log interpolation". What are X,Y? Are not dB or pH or Ritcher degrees or something else? If not, log have nothing to do there.

Regards. Alvaro.

Quite a mix up of the data to be corrected and edited. After that, plenty of models may be selected, but the programmer wanted logarithmetic interpolation.

X= h/R. Where h is the heigth of an reinforcement ring and R is the radius of the vessel on which the ring is attached.
I really must thank you for that you are trying to help me so much.
After I have seen your comments I am a little confused why the standard talks of "logarithmic interpolation" for 2 of its tables.
Regards
Leif

Disregarding all mention of Logarithmic Interpolation, the original, raw, corrected, data is handled by spline and linterp funtions and the lspline works best.

Is it possible for someone of you to give me an example of how I could write a solution in Math Cad ?
Regards
Leif

A few examples are provided for the data, no log transforms used.

This is a bit of a small sample to try to make decisions.

The first thing to note is that this a a 2D table, not a 1D table, so you need interpolation in two dimensions. Standard Mathcad interpolation is for one dimension, not two, so you need some work to get two dimensions.

Based on this extremely limited sample, and the verbiage you provide, I would guess that the interpolation must be based on the log of the X value, with a bilinear interpolation applied using log(X) and Y as the independent variables.

In any case, here is an interpolation, linear in Y, logarithmicin X.
__________________
� � � � Tom Gutman

Is this a contortionist's act? I edited the given Datatable to get a nearly perfect 1-D log-log and assumed from that fact it was from a pressure vessel code that is was 1-D.

This is working with the data as given, rather than as somebody might like it to be.
__________________
� � � � Tom Gutman

Then the Datatable is a part of a page from some pressure vessel code recommendations based on a very wide set of parameters - - material, service, temperatures, pressures, etc., etc. Looks like the submitter was earlier talking about pipe size, and that is not interpolatable because pipe comes in fixed sizes. USA type decisions are based on calculated stresses, then double the amount of material required.

A 2-D data set gives the designer a choice of stuff, like a wad of chewing gum, thickness, flavors, etc., ratio of materials, etc, etc.

I can't locate a page from the Web with explanations, legends, etc. The submitter ought to illuminate his table like with Middle Age scrolls on a written composition.

Trying to see what could be this the log interp meaning I found this strange effect in a simple linear interpolation within "exponential" data (data are data, I wan't to introduce new concepts here).

Regards. Alvaro.

If you want your interpolation to look linear on the plot, then you must use a compatible interpolation. Here you are using a log scale for x, so your interpolation should be based on the log of x. Nothing to do with Mathcad per se, just a general property of interpolation.
__________________
� � � � Tom Gutman

On 12/6/2009 1:00:35 AM, Tom_Gutman wrote:
>If you want ...

Yes, it's logic, but requires certain analysis and is not inmidiatly for me. See what happend changing ln by log.

Regards. Alvaro.

It's immediate for me. linterp (as suggested by the name) is a piecewise linear function. Linear functions on a semilog graph (just the dependent variable a log) plot as curves. Seems rather obvious to me.

Also, searching for logarithmic interpolation on google I ran across a Mathcad worksheet, which explicitly deals with the linear/non-linear appearance of graphs based on the axis scal.
__________________
� � � � Tom Gutman

On 12/6/2009 2:00:09 AM, Tom_Gutman wrote:
>It's immediate for me. linterp (as suggested by the name) is a piecewise linear function.

But it is an interpolation and one always expect that both curves (original data and interpolated) seems similars - This prove that this is a bad prejuice. Coordinate transformations preserve linearity if they are linear. There are a big world of non linear transformations out there /:.)

>Linear functions on a semilog graph (just the dependent variable a log) plot as curves. Seems rather obvious to me.

True. More surprising for me the effect of changing ln by log. Not only not interpolate nothing, also draw rect lines for the first points



>Also, searching for logarithmic interpolation on google I ran across a Mathcad worksheet, which explicitly deals with the linear/non-linear appearance of graphs based on the axis scal.

First, can't understand nothing, but searching in google you're right, there is a similar ws in mathcad: this is not a new question then.

Regards. Alvaro.

On 12/6/2009 12:05:46 AM, study wrote:
>I enterted my edited version of Datatable on Alvaro's worksheet & got escellent results.

But I'm think that you must to disable the assignation Yi:=i*ln(Xi) to see the how linterp cames to a curve under log plot (for x axis only, there are same effects for y-axis and for both axis as log plots).

Regards. Alvaro.

A corected and revised version based on information from the original submitter.
lbny09
1-Newbie
(To:lbny09)

I have found what they ment in this standard.
I happemed to read another standard in the same series and there was an written example.

Regards
Leif

0.06720 is mot right.

For 3 dents, the code response is 0.07079 at hR = 0.032

Since Lief wanted to use logarithmic Interpolation, I have engineered my last worksheet to do that.
Announcements

Top Tags