1 / 29

Numerical Differentiation

Numerical Differentiation. Consider a particle whose position as a function of time is recorded in a table. How do we determine its velocity v(t)=dx/dt?. Consider a particle whose position as a function of time is recorded in a table. How do we determine its velocity v(t)=dx/dt?

maia
Download Presentation

Numerical Differentiation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Numerical Differentiation

  2. Consider a particle whose position as a function of time is recorded in a table. How do we determine its velocity v(t)=dx/dt?

  3. Consider a particle whose position as a function of time is recorded in a table. How do we determine its velocity v(t)=dx/dt? • We differentiate!

  4. Consider a particle whose position as a function of time is recorded in a table. How do we determine its velocity v(t)=dx/dt? • We differentiate! • This form is not usefully as it is plagued by subtractive cancellation; h oscillates between 0 and as

  5. Alternative methods are the forward difference, central difference and extrapolated difference.

  6. Alternative methods are the forward difference, central difference and extrapolated difference. • For completeness we will look very briefly at the forward difference (the other methods will be left as research).

  7. Forward Difference • This the most direct method and starts with expanding the function as a Taylor series.

  8. Forward Difference • This the most direct method and starts with expanding the function as a Taylor series. • The series advances the function one small step forward, • h is the step size.

  9. Forward Difference • The forward difference algorithm is obtained by solving for f prime. • Where c represents the compute value. • Ie an approx. using two points to rep the function by a straight line in the interval x to x+h

  10. Error which is proportional to h. Forward Difference • The forward difference algorithm is obtained by solving for f prime. • Where c represents the compute value. • Ie an approx. using two points to rep the function by a straight line in the interval x to x+h

  11. x x+h Diagram illustrating the forward difference

  12. Forward Difference • Consider the case where,

  13. Forward Difference • Consider the case where, • The exact derivative is • The computed derivative is • For small h the approximation becomes good. ie

  14. Numerical Solutions to Differential equations

  15. Most real world problems are written as (modelled with) differential equations.

  16. Most real world problems are written as (modelled with) differential equations. • in chemistry, physics, and engineering. • more recently in models for medicine, biology.

  17. Most real world problems are written as (modelled with) differential equations. • in chemistry, physics, and engineering. • more recently in models for medicine, biology. • Eg. Oscillators (harmonic motion). • Assume we have a mass m attached to a spring forced by an external force.

  18. A problem may require you to solve for the motion of the mass as a function of time.

  19. From classical mechanics we use Newton’s 2nd law, which can be written in differential form.

  20. From classical mechanics we use Newton’s 2nd law, which can be written in differential form. • may be used to determine v(t) and x(t) given initial conditions.

  21. A differential equation is an equation involving an unknown function and one or more of its derivatives.

  22. A differential equation is an equation involving an unknown function and one or more of its derivatives. • The equation is an ordinary differential equation (ODE) if the unknown function depends on only one independent variable.

  23. Types of ordinary differential equations include initial-value problems (IVP) and boundary-value problems (BVP).

  24. Types of ordinary differential equations include initial-value problems (IVP) and boundary-value problems (BVP). • Examplesof ODEs: Growth equation Harmonic Oscillator

  25. Differential equations and Oscillators

  26. The exciting feature of computational work is highlighted in that we can solve for problems of this type very easily. • We are not restricted to linear differential equations or nearly linear. There is no need for the usual common assumptions.

  27. Linear Driven Oscillator: • Where is the force exerted by the spring and is the external force.

  28. Linear Driven Oscillator: • Where is the force exerted by the spring and is the external force. • Nonlinear Oscillator: • PE is an arbitrary power p of displacement x from equilibrium.

More Related