Shuai Dong. Using Math and Science to improve your game

Similar documents
CISE 301: Numerical Methods Lecture 5, Topic 4 Least Squares, Curve Fitting

INTERPOLATION(1) ELM1222 Numerical Analysis. ELM1222 Numerical Analysis Dr Muharrem Mercimek

Chapter Newton-Raphson Method of Solving a Nonlinear Equation

GAUSS ELIMINATION. Consider the following system of algebraic linear equations

Abhilasha Classes Class- XII Date: SOLUTION (Chap - 9,10,12) MM 50 Mob no

DCDM BUSINESS SCHOOL NUMERICAL METHODS (COS 233-8) Solutions to Assignment 3. x f(x)

Chapter Newton-Raphson Method of Solving a Nonlinear Equation

Model Fitting and Robust Regression Methods

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad

Concept of Activity. Concept of Activity. Thermodynamic Equilibrium Constants [ C] [ D] [ A] [ B]

Principle Component Analysis

Lecture 7 Circuits Ch. 27

ME 501A Seminar in Engineering Analysis Page 1

Definition of Tracking

Trigonometry. Trigonometry. Solutions. Curriculum Ready ACMMG: 223, 224, 245.

Variable time amplitude amplification and quantum algorithms for linear algebra. Andris Ambainis University of Latvia

VECTORS VECTORS VECTORS VECTORS. 2. Vector Representation. 1. Definition. 3. Types of Vectors. 5. Vector Operations I. 4. Equal and Opposite Vectors

Course Review Introduction to Computer Methods

Review of linear algebra. Nuno Vasconcelos UCSD

Lecture 4: Piecewise Cubic Interpolation

4. Eccentric axial loading, cross-section core

Chapter Gauss-Seidel Method

STRENGTH FIELDS AND LAGRANGIANS ON GOsc (2) M

Least squares. Václav Hlaváč. Czech Technical University in Prague

UNIVERSITY OF IOANNINA DEPARTMENT OF ECONOMICS. M.Sc. in Economics MICROECONOMIC THEORY I. Problem Set II

Fall 2012 Analysis of Experimental Measurements B. Eisenstein/rev. S. Errede. with respect to λ. 1. χ λ χ λ ( ) λ, and thus:

Katholieke Universiteit Leuven Department of Computer Science

LOCAL FRACTIONAL LAPLACE SERIES EXPANSION METHOD FOR DIFFUSION EQUATION ARISING IN FRACTAL HEAT TRANSFER

3/20/2013. Splines There are cases where polynomial interpolation is bad overshoot oscillations. Examplef x. Interpolation at -4,-3,-2,-1,0,1,2,3,4

PHYSICS 212 MIDTERM II 19 February 2003

Rank One Update And the Google Matrix by Al Bernstein Signal Science, LLC

] dx (3) = [15x] 2 0

In this Chapter. Chap. 3 Markov chains and hidden Markov models. Probabilistic Models. Example: CpG Islands

Applied Statistics Qualifier Examination

Remember: Project Proposals are due April 11.

ESCI 342 Atmospheric Dynamics I Lesson 1 Vectors and Vector Calculus

Physics 121 Sample Common Exam 2 Rev2 NOTE: ANSWERS ARE ON PAGE 7. Instructions:

Statistics 423 Midterm Examination Winter 2009

" = #N d$ B. Electromagnetic Induction. v ) $ d v % l. Electromagnetic Induction and Faraday s Law. Faraday s Law of Induction

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Chapter Runge-Kutta 2nd Order Method for Ordinary Differential Equations

Quiz: Experimental Physics Lab-I

Two Coefficients of the Dyson Product

Machine Learning Support Vector Machines SVM

8. INVERSE Z-TRANSFORM

Electrochemical Thermodynamics. Interfaces and Energy Conversion

Fitting a Polynomial to Heat Capacity as a Function of Temperature for Ag. Mathematical Background Document

The Number of Rows which Equal Certain Row

Lecture 36. Finite Element Methods

Learning Enhancement Team

The Schur-Cohn Algorithm

A-Level Mathematics Transition Task (compulsory for all maths students and all further maths student)

Jens Siebel (University of Applied Sciences Kaiserslautern) An Interactive Introduction to Complex Numbers

7.2 Volume. A cross section is the shape we get when cutting straight through an object.

4.4 Areas, Integrals and Antiderivatives

Trigonometry. Trigonometry. Curriculum Ready ACMMG: 223, 224, 245.

Introduction to Numerical Integration Part II

1. Extend QR downwards to meet the x-axis at U(6, 0). y

The Trapezoidal Rule

Operations with Matrices

KULLBACK-LEIBLER DISTANCE BETWEEN COMPLEX GENERALIZED GAUSSIAN DISTRIBUTIONS

Partially Observable Systems. 1 Partially Observable Markov Decision Process (POMDP) Formalism

Dennis Bricker, 2001 Dept of Industrial Engineering The University of Iowa. MDP: Taxi page 1

( ) 1. 1) Let f( x ) = 10 5x. Find and simplify f( 2) and then state the domain of f(x).

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

MCR 3U Exam Review. 1. Determine which of the following equations represent functions. Explain. Include a graph. 2. y x

Physics for Scientists and Engineers I

GRAND PLAN. Visualizing Quaternions. I: Fundamentals of Quaternions. Andrew J. Hanson. II: Visualizing Quaternion Geometry. III: Quaternion Frames

ENERGY AND PACKING. Outline: MATERIALS AND PACKING. Crystal Structure

6 Roots of Equations: Open Methods

6.5 Improper integrals

Representing Curves. Representing Curves. 3D Objects Representation. Objects Representation. General Techniques. Curves Representation

6.6 The Marquardt Algorithm

6 Random Errors in Chemical Analysis

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

Fundamental Theorem of Calculus

Polynomial Approximations for the Natural Logarithm and Arctangent Functions. Math 230

Solving Radical Equations

Analysis of Variance and Design of Experiments-II

Linear and Nonlinear Optimization

8.6 The Hyperbola. and F 2. is a constant. P F 2. P =k The two fixed points, F 1. , are called the foci of the hyperbola. The line segments F 1

Machine Learning: and 15781, 2003 Assignment 4

Solutions to Assignment 1

CAMBRIDGE UNIVERSITY ENGINEERING DEPARTMENT. PART IA (First Year) Paper 4 : Mathematical Methods

INTRODUCTORY NUMERICAL ANALYSIS

The Bernoulli Numbers John C. Baez, December 23, x k. x e x 1 = n 0. B k n = n 2 (n + 1) 2

1. Twelve less than five times a number is thirty three. What is the number

Chapter 5 Supplemental Text Material R S T. ij i j ij ijk

5.7 Improper Integrals

Calculus 2: Integration. Differentiation. Integration

Counting intersections of spirals on a torus

Math1110 (Spring 2009) Prelim 3 - Solutions

Matrix- System of rows and columns each position in a matrix has a purpose. 5 Ex: 5. Ex:

Pyramid Algorithms for Barycentric Rational Interpolation

An Introduction to Support Vector Machines

CS434a/541a: Pattern Recognition Prof. Olga Veksler. Lecture 9

Department of Mechanical Engineering, University of Bath. Mathematics ME Problem sheet 11 Least Squares Fitting of data

SECTION 9-4 Translation of Axes

Algebra & Functions (Maths ) opposite side

Chapter 8.2: The Integral

Transcription:

Computtonl phscs Shu Dong Usng Mth nd Sene to mprove our gme

Appromton of funtons Lner nterpolton Lgrnge nterpolton Newton nterpolton Lner sstem method Lest-squres ppromton Mllkn eperment

Wht s nterpolton? Interpolton s needed when we wnt to nfer some lol nformton from set of nomplete or dsrete dt. trjetor of golf bll/footbll/mssle/...

Interpolton between two ponts Lner nterpolton = More ponts: Dret onnetons between two nerest neghbor ponts.

More smooth nterpolton Lgrnge nterpolton Let's strt from the smplest se: A A A A A A,, A,, A

Lgrnge nterpolton - Three ponts X Y O =f A A A A A A A A A

Lgrnge nterpolton - generl formul In generl, for n+ ponts: j n j j A n j j j A The prnple = j A j = =!=j A j =

How to wrte ode? A subroutne Inputs: j, j, nd Output: Algorthm n the blk bo: To lulte the oeffent A j Then we n obtn: n j A j j

Code emple double nterpolteonst double [], onst double [],onst nt n,onst double { // n+: totl ponts // [ ]: rr of // [ ]: rr of // : n double =; //= fornt j=;j<=n;j++ //Aj*j { double j=; //Aj fornt =;<=n;++ { f!=j n { Aj j*=-[]/[j]-[]; j j } } n +=j*[j]; //SumAj*j Aj } j return ; } j

Code emple equl spng ponts of os wthn [,p]:, p/,... 9p/, p, LgrngeInterpolton.pp

Results

Drwbk If one more pont s dded, ll oeffents hve to be reulted. An possble mprovement? An lterntve lgorthm: Newton nterpolton!

Newton Interpolton The ft s: =f +f +f +f 3 3 +f 4 4...+f n n polnoml funton. n order for n+ ponts Another epresson of the polnoml funton 3 Gven ponts:,,,,,... n, n Then the tsk s to lulte eh, whh onl depends on the frst + ponts. If one more pont s dded, we onl need to lulte n+.

Clulton of N = ----> : [ - ]/ - N = ---> : [ -N ]/[ - - ] N 3 3 = 3 ---> 3 : [ 3 -N 3 ]/[ 3-3 - 3 - ]... 3 3 N N N N N 3

Homework I Newton nterpolton of equl spng ponts of os wthn [,p].

One more method - self-mde The ft s: =f +f +f +f 3 3 +f 4 4...+f n n polnoml funton for n+ ponts. Then we get sstem of lner equtons nvolvng the sme set of vrbles f k k=~n. The oeffents re k k=~n. =f +f + f + 3 f 3 + 4 f 4...+ n f n

Three ponts emple Three ponts:,,,, The nterpolton funton s =f +f +f. The lner equtons re: =f +f +f =f +f +f =f +f +f f f f

Code emple vod nterpolteonst double [], onst double [],onst nt n,double f[] { // n: totl ponts // [ ]: rr of // [ ]: rr of // f[]: rr of f double [n][n]; //Mtr A fornt =;<n;++ //Aj*j { double j=; onst double =[]; fornt j=;j<n;j++ { [][j]=j; j*=; } } SolveMtr,,n,f }

Lest-squres ppromton Interpolton s mnl used to fnd the lol ppromton of gven dsrete set of dt. In mn stutons n phss, we need to know the globl behvor of set of dt n order to understnd the trend n spef mesurement or observton:----> Overll ppromton or fttng A tpl emple s polnoml ft to set of epermentl dt wth error brs.

Proess Wht do we hve? A fttng funton p vs the dt,. p s lose to but m not pss through,. The dfferenes between p nd re the error brs. The m s to redue the error brs to mnmum level b djustng the oeffents of p.

Emple: p s mth-order polnoml n>m, or the error brs n be zero m+ vrbles k k m k m p for dsrete dt ] [ ] [ m n k p

To mnmze the error brs. We get m+ lner equtons. Then solve the lner sstem for k. The smplest emple: lner fttng ] [ l k ] [ n k p

B lultng the prtl dervtve 3 n ] [ l k n n n n 3,,, where., 3 3 n n n

Johnn Crl Fredrh Guss A Germn mthemtn who ontrbuted sgnfntl to mn felds, nludng number theor, lgebr, sttsts, nlss, dfferentl geometr, geodes, geophss, mehns, eletrostts, stronom, mtr theor, nd opts. 777-855 Referred to s the Prne of Mthemtns nd gretest mthemtn sne ntqut.

Robert Andrews Mllkn In 9, Mllkn publshed hs fmous work on the ol drop eperment n Sene. Bsed on the mesurements of the hrges rred b ll the ol drops, Mllkn 868 953 onluded tht the hrge rred b n objet s multple wth sgn of Presdent of the fundmentl hrge, the hrge of n Clforn Insttute of Tehnolog eletron for negtve hrges or the Presdent of the hrge of proton for postve hrges. Amern Phsl Soet for hs work on the elementr hrge of eletrt nd on the photoeletr effet 93 Hermnn von Helmholtz ---> Albert Abrhm Mhelson st ---- > Robert Andrews Mllkn nd --->Chung-Yo Cho 赵忠尧

The Mllkn eperment Input dt Fttng equton: q k =k*q e +Q Output: Q e & Q Mllkn s orgnl ol-drop pprtus, 99-9

Code emple vod Mllknonst double k[], onst double q[],onst nt n { // n: totl ponts // k[ ]: rr of k // q[ ]: rr of q double [4]={,,,}; //oeffents fornt =;<n;++ { []+=k[]; []+=k[]*k[]; []+=q[]; [3]+=k[]*q[]; } n n n onst double q=[]*[3]-[]*[]/[]*[]-n*[]; onst double qe=[]*[]-n*[3]/[]*[]-n*[]; out<<"the elementr hrge s:\t"<<qe<<endl; } 3, 3.

..Mllkn.pp Code emple

Nonlner sstems - I For emple: the phsl behvor s n the form of p=*ep[b*], lke nuler de. If ou ft dt dretl, the huge ontrst between lrge nd smll regons wll mke the fttng nurte. An lternton s to ft ln[] nd ln[p]. ln[p]=ln[]+b*, whh s lner funton.

Nonlner sstems - II For emple: the phsl behvor s n the form of p=/-b, whh dverges t =b. An lternton s to ft nd /p. /p= / - b/, whh s lner funton.

Homework II Lest-squres ppromton for nuler de. To fnd the hlf-lfe of n unknown nuleus. tme - - -3 3-4 4-5 5-6 fsson 3 5 9 6 5 You n do t s projet!

The sore of projet Evluted bsed on the qult from the followng spets: Algorthm: orret n phss? effent n prte? fleble for other ses? Code: well orgnzed? lerl wrtten? properl ommented? robust? orret result? user-frendl? Pper: well wrtten, nludng proper fgures, tbles, & referenes f n? free from tpos nd grmmr errors?