×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Interpolating

Interpolating

Interpolating

(OP)
Hello,

I have to vectors (flow and pressure).
I am scatter plotting them (flow vs pressure). I did it before, I do not recall how I interpolated around for a certain value of let say pressure and have the flow value on that specific point...
hope anyone can help me, thanks


 

RE: Interpolating

Have you tried linear interpolation?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

(OP)
is it interp2?
I will try tomorrow morning
 

RE: Interpolating

Do you want an interpolation or a best fit line?

use "polyfit" for the latter

M

--
Dr Michael F Platten

RE: Interpolating

(OP)
Interpolation

RE: Interpolating

I'm sure there are some built in excel functions that's do what you want.  

Personally rather then worrying about that syntax I would rather just write the formula.  Then you can do the same thing in Matlab or Maple or whatever.  Math works in any language.

Step 1:  What is the slope of a line passing through two points: (X1,Y1) and (X2,Y2).
Think about it before you read the answer.
Answer:  slope = (Y2-Y1)/(X2-X1)

Step 2: How do I use that slop to find the value of Y at some arbitrary X in the interval (X1,YX)?
Think about it before you read the answer.
Answer:  
Y = Y1 + slope * (X-X1)

Sorry I am not trying to be a jerk.  It is something you should spend time understanding (rather than memorizing) imo.
 

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

obvious typo correction in bold:

Quote:

Step 2: How do I use that slope to find the value of Y at some arbitrary X in the interval (X1,X2)?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

I apologize if I have underestimated your problem. Maybe you want a general formula to work with two columns of X, Y data.  Then you need to use some lookups if you are going to build the arguments for the interpolation formula if you are going to build it yourself.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

Here is a vba function to return the interpolation from a range of X's and Y's:

CODE

Function InterpL(LookupValue, KnownXs, KnownYs)
Dim pointer As Integer
Dim XO As Double, YO As Double, X1 As Double, Y1 As Double
pointer = Application.Match(LookupValue, KnownXs, 1)

XO = KnownXs(pointer)
YO = KnownYs(pointer)
X1 = KnownXs(pointer + 1)
Y1 = KnownYs(pointer + 1)
InterpL = YO + (LookupValue - XO) * (Y1 - YO) / (X1 - XO)
End Function
 

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

And yes this is linear interpolation.  For a higher order interpolation you need a spline technique.  Let us know if you are interested in that.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

Hmmm.  I thought I was in the excel forum - hence the vba function.  IRStuff sent me off track (or maybe I just wasn't paying attention).

Use interp1 for simple interpolation like you are talking about.

Interp2 is for 2-d interpolation.

There is a lot of help in the help

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Interpolating

If you are using interp1, be sure that your independent axis (you haven't told us whether it's pressure or flow) is monotonic.

- Steve

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now