2 views

Uploaded by duyvu

lecture

- first 20 days of math workshop
- Function Approximation
- pan tompkins algorithm
- delta-k-Vol-53-2
- Bible Code Simulator
- How to Monitor SAP System and Do Performance Checks
- cagdhand
- Surrogate
- Interpolation
- overview and organsisation
- Load-Speed Interaction Effects on the Biomechanics of Backpack Load Carriage
- Review Ch_02 Annuity
- goalplanupdate2
- Conscientious and Incisive Learning In Engineering : A Pedagogical Approach
- Alg. II-9 Notes March 19
- Feature optimisation for stress recognition in speech
- L09 DynamicProgramming_Part03
- AN EFFICIENT FUSION BASED UP-SAMPLING TECHNIQUE FOR RESTORATION OF SPATIALLY COMPRESSED IMAGES
- ode with matlab
- Sheets of Numerical

You are on page 1of 6

Slide 1 of 5

Lecture 14c

Interpolating Data with Splines

Brian G. Higgins

Department of Chemical Engineering & Materials Science

University of California, Davis

April 2014, Hanoi, Vietnam

ECM6Lecture14cVietnam_2014.nb

Background

The following data represents the diffusivity of copper compounds in an ion exchange resin for various

concentrations expressed in terms of normality N (Data taken from Bradie, 2006)

In[111]:=

Out[112]=

80.4946, 2.76<, 80.9863, 3.12<, 82.443, 2.92<, 85.06, 2.07<<;

Grid@Prepend@data, 8"N", "D"<D, Frame AllD

N

0.0521

0.1028

0.2036

0.4946

0.9863

2.443

5.06

D

1.65

2.1

2.27

2.76

3.12

2.92

2.07

In[113]:=

PlotRange 880, 6<, 81.6`, 3.2`<<, AxesOrigin 80, 1.6`<, Frame True,

FrameLabel 8Style@"Normality H N L", 16D, Style@"Diffusivity H D L", 16D<,

AspectRatio 1, ImageSize 300D

Out[113]=

Diffusivity H D L

3.0

2.5

2.0

Normality H N L

ECM6Lecture14cVietnam_2014.nb

Suppose we want to determine the maximum diffusivity and also measure the rate of change of diffusivity with respect to concentration. Let see if we can use Mathematicas Interpolation function.

Recall Interpolation works by fitting polynomial curves between successive data points.

In[114]:=

Out[114]=

In[115]:=

myFunc = Interpolation@dataD

InterpolatingFunction@880.0521, 5.06<<, <>D

plt2 = Plot@myFunc@xD, 8x, Min@dataD, Max@dataD<, PlotStyle 8Thick, Red<,

PlotRange 880, 6<, 81.6`, 3.6`<<, AxesOrigin 80, 1.6`<, Frame True,

FrameLabel 8Style@"Normality H N L", 16D, Style@"Diffusivity H D L", 16D<,

AspectRatio 1D;

Show@plt2, plt1, ImageSize 300D

Out[116]=

Diffusivity H D L

3.5

3.0

2.5

2.0

Normality H N L

Here is a comparison of the data with the interpolation function. Recall Interpolation works by fitting

polynomial curves between successive data points, but as the plot illustrates, there is no continuity of

the derivatives.

Recall the default value for Interpolation fits a piecewise-cubic polynomial through the data. The result is

that the derivatives of the piecewise cubic are not continuous at the data points. To summarize: the

interpolation has gone through the data but it is not a smooth curve. We can try to change the interpolation order but that will not help matters. An alternative possibility is to use a spline interpolation function.

ECM6Lecture14cVietnam_2014.nb

A spline interpolation is a form of interpolation where the interpolant is a special type of piecewise

polynomial called a spline.

Spline interpolation is preferred over polynomial interpolation because the interpolation error can be

made small even when using low degree polynomials for the spline.

Spline interpolation avoids the problem of Runge's phenomenon (oscillation at edges of a domain),

which occurs when interpolating using high degree polynomials.

Here is our data

In[82]:=

80.4946, 2.76<, 80.9863, 3.12<, 82.443, 2.92<, 85.06, 2.07<<;

We use the function SplineFit to interpolate the data, using cubic splines

In[91]:=

Out[91]=

SplineFunction@Cubic, 80., 6.<, <>D

The interval of the spline is parameterized so that all the data lies between t=0 and t=6. Thus the data is

parameterized in terms of the new variable t. Hence we can plot the 2-D data using ParametricPlot

In[117]:=

FrameLabel 8Style@"Normality H N L", 16D, Style@"Diffusivity H D L", 16D<,

PlotRange All, AspectRatio 1, PlotStyle 8Red, Thick<,

Epilog 8PointSize@LargeD, Blue, Map@Point@D &, dataD<,

ImageSize 300, Axes FalseD

3.0

Out[117]=

Diffusivity H D L

2.8

2.6

2.4

2.2

2.0

1.8

Normality H N L

Note that the data in the plot is the original data at the node points t=0,1,2,3,4,5,6

ECM6Lecture14cVietnam_2014.nb

In[96]:=

Out[96]=

880.0521, 1.65<, 80.1028, 2.1<, 80.2036, 2.27<,

80.4946, 2.76<, 80.9863, 3.12<, 82.443, 2.92<, 85.06, 2.07<<

From the plot we observe that the diffusivity D is a maximum near a normality of N=1.2. We can extract

out the maximum value of the diffusivity D by searching for all values of diffusivity between 4t5

In[97]:=

Out[97]=

3.13436

Having the maximum value we can now determine the t value by using FindRoot on the following

function

In[98]:=

That is, we want to find the value of t such that D=3.13436. Here is the result

In[99]:=

Out[99]=

81.1945, 3.13436<

ECM6Lecture14cVietnam_2014.nb

References

These notes are based on the topics taken from

B. Bradie, A friendly Introduction to Numerical Analysis, Pearson/Prentice Hall, 2006

- first 20 days of math workshopUploaded byapi-234024772
- Function ApproximationUploaded byShraddha_90
- pan tompkins algorithmUploaded byLeslie Wright
- delta-k-Vol-53-2Uploaded byOscar Reynaga Alarcón
- Bible Code SimulatorUploaded byjjrmsg
- How to Monitor SAP System and Do Performance ChecksUploaded byMassimo Quagliani
- cagdhandUploaded bymannuvpatel
- SurrogateUploaded byChris Tso
- InterpolationUploaded byaaaaaaaa43254252624624627
- overview and organsisationUploaded byapi-204772730
- Load-Speed Interaction Effects on the Biomechanics of Backpack Load CarriageUploaded bytestor1111
- Review Ch_02 AnnuityUploaded byNelson Cabingas
- goalplanupdate2Uploaded byapi-272521734
- Alg. II-9 Notes March 19Uploaded byrobin smith ccs
- Feature optimisation for stress recognition in speechUploaded byHugo Leonardo Rufiner
- AN EFFICIENT FUSION BASED UP-SAMPLING TECHNIQUE FOR RESTORATION OF SPATIALLY COMPRESSED IMAGESUploaded byijitjournal
- Conscientious and Incisive Learning In Engineering : A Pedagogical ApproachUploaded byIJAMTES
- L09 DynamicProgramming_Part03Uploaded byEnmusk
- ode with matlabUploaded bysherisha
- Sheets of NumericalUploaded byAhmed M. Hegazy
- graphing type1-1Uploaded byapi-288922072
- Math 1Uploaded byErika Hanne Yap
- 04 Curves SurfacesUploaded bySuryakumar Bendalam
- Numan AlUploaded byశ్రీనివాస బాబ్జి జోస్యుల
- 2018 - Semester 1 - Book 1Uploaded byPeter Bolocelli
- C3 June 2014Uploaded byDon Wilson
- Conrob_programming_assignments_MOOC Control of Mobile Robots Simulation Lecture 2Uploaded byDineshChauhan
- 04U_5Uploaded byjagruthims
- HotelUploaded byPrabhu Raja
- bhosle r paper mea582s12Uploaded byapi-219041353

- ECM6Lecture14bVietnam_2014Uploaded byduyvu
- ECM6Lecture14aVietnam_2014Uploaded byduyvu
- ECM6Lecture11dVietnam_2014Uploaded byduyvu
- ECM6Lecture11cVietnam_2014Uploaded byduyvu
- ECM6Lecture11bVietnam_2014Uploaded byduyvu
- ECM6Lecture11aVietnam_2014Uploaded byduyvu
- ECM6Lecture9Vietnam_2014Uploaded byduyvu
- ECM6Lecture8Vietnam_2014Uploaded byduyvu
- ECM6Lecture6Vietnam_2014Uploaded byduyvu
- ECM6Lecture5Vietnam_2014Uploaded byduyvu
- ECM6Lecture4Vitenam_2014Uploaded byduyvu
- ECM6Lecture2Vietnam_2014Uploaded byduyvu
- ECM6Lecture3Vietnam_2014Uploaded byduyvu

- Design CalculationUploaded byomdkhaleel
- HF-QCM Sensors - Technical DatasheetUploaded byeitan-dalia4971
- Sc Trial 2011Uploaded byHisyam Embong
- 8th Syllabus [PDF Library]Uploaded bykp1292
- Vapor Compresion Refrigeration Report- Group 5Uploaded byMunis Rao
- PART-5-67-EVALUATION-AND-SELECTION-OF-CORROSION-INHIBITORS-PAG-1169-11782.pdfUploaded byVanessa Rios Nolaya
- Loctitie Nordbak CeramicsUploaded bytoru101
- OCC_d_4_physi_sur_1605_2_eUploaded bysil
- Central Zagros fold-thrust belt (Iran): New insights from seismic data, field observation, and sandbox modelingUploaded byCaniusLupus
- Offshore Product Catalogue1Uploaded byluciandu
- Low Carbon Stations LeemansUploaded byVitorCardoso
- 4.3 ExtrusionUploaded bySiddharth Rajendran
- L-005 - Compact Flanged Connections Ed3, Dec2013Uploaded byDragoslav Dzolic
- Superabsorbent Polymers and Superabsorbent Polymer CompositesUploaded bymutazsalih
- Repair Model of Power Distribution ComponentsUploaded byedrevollo
- A Home-built Vibrating Sample Magnetometer.pdfUploaded bylazaros
- NTPC Presentation by rishiUploaded byRishikeshMalviya
- 3 (3)Uploaded byChhoemSovann
- CM 2012 Fasc 2 EnglezaUploaded byGeorge Gavrila
- Foaming in EP Industry- A Global PerspectiveUploaded byarunperth
- Principles of unit operationsUploaded byFranco Hidalgo
- Matlab GuideUploaded byShane Takamune
- 09 lectureoutlineUploaded byapi-225960274
- Generators IndustrialUploaded byCamilo R.Ortega M.
- Anchor Escapement - WikipediaUploaded byAri Sudrajat
- Application DIN 2303Uploaded byMarcelle Poll
- MR of crcUploaded byNader ElSayed
- Comprehension Terminal - march 1.docxUploaded byKrish Ashok
- Piping Engineering Important Questions (Consolidated With Himanshu)Uploaded byLinh Thùy
- Adp - II ReportUploaded byRajeuv Govindan