Computational Physics PHYS 420

Similar documents
APPM/MATH Problem Set 4 Solutions

Linear Interpolating Splines

Design considerations

Lecture 9: Introduction to Spline Curves

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Need for Parametric Equations

Rational Bezier Surface

Curve fitting using linear models

2D Spline Curves. CS 4620 Lecture 18

An introduction to interpolation and splines

Multiple-Choice Test Spline Method Interpolation COMPLETE SOLUTION SET

Rational Bezier Curves

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Know it. Control points. B Spline surfaces. Implicit surfaces

COMP3421. Global Lighting Part 2: Radiosity

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

2D Spline Curves. CS 4620 Lecture 13

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

CS-184: Computer Graphics

Lecture VIII. Global Approximation Methods: I

Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

lecture 10: B-Splines

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Sung-Eui Yoon ( 윤성의 )

Parameterization. Michael S. Floater. November 10, 2011

A popular method for moving beyond linearity. 2. Basis expansion and regularization 1. Examples of transformations. Piecewise-polynomials and splines

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

CS-184: Computer Graphics. Today

TO DUY ANH SHIP CALCULATION

99 International Journal of Engineering, Science and Mathematics

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313

Objects 2: Curves & Splines Christian Miller CS Fall 2011

CS 450 Numerical Analysis. Chapter 7: Interpolation

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

implicit surfaces, approximate implicitization, B-splines, A- patches, surface fitting

See the course website for important information about collaboration and late policies, as well as where and when to turn in assignments.

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

AMS527: Numerical Analysis II

Parameterization of triangular meshes

Geometric Modeling of Curves

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 )

Interpolation and Splines

Mar. 20 Math 2335 sec 001 Spring 2014

Central issues in modelling

Splines and penalized regression

Research Article Data Visualization Using Rational Trigonometric Spline

Computer Graphics Curves and Surfaces. Matthias Teschner

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Fitting to a set of data. Lecture on fitting

B-Spline Polynomials. B-Spline Polynomials. Uniform Cubic B-Spline Curves CS 460. Computer Graphics

Handout 4 - Interpolation Examples

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

A MATRIX FORMULATION OF THE CUBIC BÉZIER CURVE

Interpolation by Spline Functions

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Solve Non-Linear Parabolic Partial Differential Equation by Spline Collocation Method

Concept of Curve Fitting Difference with Interpolation

Monotonic Cubic Spline Interpolation

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

Four equations are necessary to evaluate these coefficients. Eqn

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II

08 - Designing Approximating Curves

Knot Insertion and Reparametrization of Interval B-spline Curves

Almost Curvature Continuous Fitting of B-Spline Surfaces

Intro to Modeling Modeling in 3D

Splines. Patrick Breheny. November 20. Introduction Regression splines (parametric) Smoothing splines (nonparametric)

Properties of Blending Functions

An introduction to NURBS

Positivity Preserving Interpolation of Positive Data by Rational Quadratic Trigonometric Spline

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Spline Methods Draft. Tom Lyche and Knut Mørken. Department of Informatics Centre of Mathematics for Applications University of Oslo

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Keyword: Quadratic Bézier Curve, Bisection Algorithm, Biarc, Biarc Method, Hausdorff Distances, Tolerance Band.

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

8 Project # 2: Bézier curves

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

A technique for constructing monotonic regression splines to enable non-linear transformation of GIS rasters

Lecture IV Bézier Curves

3D Modeling Parametric Curves & Surfaces

Spline Methods Draft. Tom Lyche and Knut Mørken

Lecture 16: High-dimensional regression, non-linear regression

Spline Methods Draft. Tom Lyche and Knut Mørken

Fathi El-Yafi Project and Software Development Manager Engineering Simulation

Representing Curves Part II. Foley & Van Dam, Chapter 11

Justify all your answers and write down all important steps. Unsupported answers will be disregarded.

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

Knowledge Discovery and Data Mining

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

Interpolation - 2D mapping Tutorial 1: triangulation

Curves. Computer Graphics CSE 167 Lecture 11

8 Piecewise Polynomial Interpolation

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not.

Connected Minimal Acceleration Trigonometric Curves

Nonparametric regression using kernel and spline methods

Information Coding / Computer Graphics, ISY, LiTH. Splines

A Comparative Study of LOWESS and RBF Approximations for Visualization

Transcription:

Computational Physics PHYS 420

Dr Richard H. Cyburt Assistant Professor of Physics My office: 402c in the Science Building My phone: (304) 384-6006 My email: rcyburt@concord.edu My webpage: www.concord.edu/rcyburt In person or email is the best way to get a hold of me.

My Office Hours TR: 9:30-11:00, 13:00-15:00 F: 9:00-11:00, 13:00-15:00 Meetings may also be arranged at other times, by appointment

Midterm approaches nigh Tuesday, Oct 3 during class PHYS420

Computational Physics

Douglas Adams Hitchhiker s Guide to the Galaxy

Interpolation and Splines n Basis: In Linear Algebra, a basis is a set of vectors satisfying: Ø Linear combination of the basis can represent every vector in a given vector space; Ø No element of the set can be represented as a linear combination of the others.

n In Function Space, Basis is degenerated to a set of basis functions; n Each function in the function space can be represented as a linear combination of the basis functions. n Example: Quadratic Polynomial bases {1,t,t 2 }

n n n What are basis functions? We need flexible method for constructing a function f(t), can be as simple or complex as we want/need. We pick a system of K basis functions φ k (t), and call this the basis for f(t). We express f(t) as a weighted sum of these basis functions: f(t) = a 1 φ 1 (t) + a 2 φ 2 (t) + + a K φ K (t) The coefficients a 1,, a K determine the shape of the function.

n n n n n What do we want from basis functions? Fast computation of individual basis functions. Flexible: can exhibit the required curvature where needed, but also be nearly linear when appropriate. Fast computation of coefficients a k : possible if matrices of values are diagonal, banded or sparse. Differentiable as required: We make lots of use of derivatives in functional data analysis. Constrained as required, such as periodicity, positivity, monotonicity, asymptotes and etc.

n What are some commonly used basis functions? Powers: 1, t, t 2, and so on. They are the basis functions for polynomials. These are not very flexible, and are used only for simple problems. n Fourier series: 1, sin(ωt), cos(ωt), sin(2ωt), cos(2ωt), and so on for a fixed known frequency ω. These are used for periodic functions. n Spline functions: These have now more or less replaced polynomials for non-periodic problems. More explanation follows.

What is Basis Expansion? n Given data X and basis functions, h ( ) m X Then we can model + f X = % β ' h ' (X) ',- as a linear basis expansion in X, where is a basis function. hm ( X )

Why Basis Expansion? n In regression problems, f(x) will typically nonlinear in X; n Linear model is convenient and easy to interpret;

n Spline: 2. Piecewise Polynomials and Splines Ø In Mathematics, a spline is a special function defined piecewise by polynomials; Ø In Computer Science, the term spline more frequently refers to a piecewise polynomial (parametric) curve. n Simple construction, ease and accuracy of evaluation, capacity to approximate complex shapes through curve fitting and interactive curve design.

n Assume a four knots spline (two boundary knots and two interior knots), also X is one dimensional.

n Assume four knots spline (two boundary knots and two interior knots), also X is one dimensional. n Piecewise constant basis: h - X = 1 for X < ξ -, h 6 X = 1 for ξ - < X < ξ 6, h 7 X = 1 for X > ξ 6 n Piecewise Linear Basis: h - X = X for X < ξ -, h 6 X = X ξ - for ξ - < X < ξ 6, h 7 X = X ξ 6 for X > ξ 6

Piecewise Cubic Polynomial

Spline Interpolation Method

What is Interpolation? Given (x 0,y 0 ), (x 1,y 1 ), (x n,y n ), find the value of y at a value of x that is not given.

Interpolants Polynomials are the most common choice of interpolants because they are easy to: Evaluate Differentiate, and Integrate.

Why Splines? f(x) = Table : Six equidistantly spaced points in [-1, 1] 1 y = 1+ 25x x 2-1.0 0.038461-0.6 0.1-0.2 0.5 0.2 0.5 1 1 + 25x 6 0.6 0.1 1.0 0.038461 Figure : 5 th order polynomial vs. exact function 24

Why Splines? 1.2 0.8 0.4 y 0-1 -0.5 0 0.5 1-0.4-0.8 x 19th Order Polynomial f (x) 5th Order Polynomial Figure : Higher order polynomial interpolation is a bad idea

Spline Interpolation l Linear, Quadratic, Cubic l Preferred over other polynomial interpolation l More efficient l High-degree polynomials are very computationally expensive l Smaller error l Interpolant is smoother

Spline Interpolation Definition l Given n+1 distinct knots x i such that: with n+1 knot values y i find a spline function with each S i (x) a polynomial of degree at most n.

Linear Spline Interpolation l Simplest form of spline interpolation l Points connected by lines Each S i is a linear function constructed as: Must be continuous at each data point: Continuity:

Quadratic Spline Interpolation l The quadratic spline can be constructed as: The coefficients can be found by choosing a z 0 and then using the recurrence relation:

Quadratic Splines 2 l Quadratic splines are rarely used for interpolation for practical purposes l Ideally quadratic splines are only used to understand cubic splines

Quadratic Spline Graph Dx=2

Quadratic Spline Graph Dx=0.5

Natural Cubic Spline Interpolation SPLINE OF DEGREE k = 3 l The domain of S is an interval [a,b]. l S, S, S are all continuous functions on [a,b]. l There are points t i (the knots of S) such that a = t 0 < t 1 < < t n = b and such that S is a polynomial of degree at most k on each subinterval [t i, t i+1 ]. x t 0 t 1 t n y y 0 y 1 y n t i are knots

Natural Cubic Spline Interpolation S i (x) is a cubic polynomial that will be used on the subinterval [ x i, x i+1 ].

Natural Cubic Spline Interpolation l S i (x) = a i x 3 + b i x 2 + c i x + d i l 4 Coefficients with n subintervals = 4n equations l There are 4n-2 conditions l Interpolation conditions l Continuity conditions l Natural Conditions l S (x 0 ) = 0 l S (x n ) = 0

Hand spline interpolation

Bezier Spline Interpolation l A similar but different problem: Controlling the shape of curves. Problem: given some (control) points, produce and modify the shape of a curve passing through the first and last point. http://www.ibiblio.org/e-notes/splines/bezier.htm

Bezier Spline Interpolation Practical Application

Bezier Spline Interpolation Idea: Build functions that are combinations of some basic and simpler functions. Basic functions: B-splines Bernstein polynomials

Bernstein Polynomials l Bernstein polynomials of degree N are defined by: l For n = 0, 1, 2,, n, where = <! >! <?>! l In general there are N+1 Bernstein Polynomials of degree N. For example, the Bernstein Polynomials of degrees 1, 2, and 3 are: l 1. B 0,1 (t) = 1-t, B 1,1 (t) = t; l 2. B 0,2 (t) = (1-t) 2, B 1,2 (t) = 2t(1-t), B 2,2 (t) = t 2 ; l 3. B 0,3 (t) = (1-t) 3, B 1,3 (t) = 3t(1-t) 2, B 2,3 (t)=3t 2 (1-t), B 3,3 (t) = t 3 ;