[Scilab-users] LInear interpolation between 2 curves

Mike Page Mike at Page-One.Waitrose.com
Mon Sep 17 11:14:39 CEST 2012


Hi Paul,

Assuming the relationship between x, y and T is approximately linear, then
you can just match the points on the curves pairwise and interpolate between
the pairs using interpln.  If your target temperature T is such that T = aT1
+ (1-a)T2, then it will produce a point at abscissa x = ax1 + (1-a)x2 and
ordinate y = ay1 + (1-a)y2, where (x1,y1) and (x2,y2) are one of the pairs
of points.  You can build up the two x and y vectors and plot using plot2d.

This is usually only useful between your two temperatures (interpolation)
and is of limited accuracy outside (extrapolation), but that depends...

If you need to get the result on a defined abscissa grid, then you can
interpolate in the x and y directions separately, noting that sometimes it
makes a difference which order you do this in.  Depending on the spacing of
your x points, a linear interpolation in the x direction may not be accurate
enough.  In that case, I would use for example a Lagrange interpolation.

HTH,
Mike.

  -----Original Message-----
  From: users-bounces at lists.scilab.org
[mailto:users-bounces at lists.scilab.org]On Behalf Of Carrico, Paul
  Sent: 17 September 2012 08:54
  To: users at lists.scilab.org
  Subject: [Scilab-users] LInear interpolation between 2 curves


  Dear all,

  Is it possible to make a linear interpolation between 2 curves ? note the
abscissa are not necessary exactly the same  ...

  In particular terms, I've a curve one at temperature X and another one at
température Y and I would like to have (and to plot) temperature at
temperature Z in-between X-Y ... (see attachment)

  I had a look in interp, interp1 and interpln but nothing sound useful for
me ... Am I wrong ?

  Thanks for any advice

  Paul
----------------------------------------------------------------------------
----


Le présent mail et ses pièces jointes sont confidentiels et destinés à la
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail
par erreur, veuillez contacter immédiatement l'expéditeur et effacer le
message de votre système. Toute divulgation, copie ou distribution de cet
e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please contact the sender and
delete the email from your system. If you are not the named addressee you
should not disseminate, distribute or copy this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120917/182e1842/attachment.htm>


More information about the users mailing list