Calculus S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Math Review with Matlab: Differentiation.

Slides:



Advertisements
Similar presentations
Derivatives A Physics 100 Tutorial.
Advertisements

Section 3.3a. The Do Now Find the derivative of Does this make sense graphically???
Differential Equations
Laplace Transform Math Review with Matlab:
Math Review with Matlab:
Chapter 11-Functions of Several Variables
The Chain Rule Section 3.6c.
Beginning Programming for Engineers
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit.
Complex Numbers S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Math Review with Matlab: Complex Math.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Chapter 11: Symbolic Computing for Calculus
Solving Algebraic Equations
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
Calculus S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department University of Michigan-Dearborn Math Review with Matlab: Taylor’s Series.
CSE 123 Symbolic Processing. Declaring Symbolic Variables and Constants To enable symbolic processing, the variables and constants involved must first.
Copyright © Cengage Learning. All rights reserved.
4.5 Linearization & Newton’s Method
ESSENTIAL CALCULUS CH11 Partial derivatives
Section 2.9 Linear Approximations and Differentials Math 1231: Single-Variable Calculus.
TECHNIQUES OF INTEGRATION
Complex Power – Background Concepts
Math Review with Matlab: Application: Solving Differential Equations
MULTIPLE INTEGRALS MULTIPLE INTEGRALS Recall that it is usually difficult to evaluate single integrals directly from the definition of an integral.
8 Indefinite Integrals Case Study 8.1 Concepts of Indefinite Integrals
3.1 Derivative of a Function
Section 11.3 Partial Derivatives
RESISTIVE CIRCUITS Here we introduce the basic concepts and laws that are fundamental to circuit analysis LEARNING GOALS OHM’S LAW - DEFINES THE SIMPLEST.
Chapter 3 Introduction to the Derivative Sections 3. 5, 3. 6, 4
DERIVATIVES 3. We have seen that a curve lies very close to its tangent line near the point of tangency. DERIVATIVES.
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
APPLICATIONS OF INTEGRATION 6. A= Area between f and g Summary In general If.
SECOND-ORDER DIFFERENTIAL EQUATIONS Series Solutions SECOND-ORDER DIFFERENTIAL EQUATIONS In this section, we will learn how to solve: Certain.
AP CALCULUS AB Chapter 4: Applications of Derivatives Section 4.5:
C CONVERSATION: Voice level 0. No talking! H HELP: Raise your hand and wait to be called on. A ACTIVITY: Whole class instruction; students in seats. M.
Chapter 3 Limits and the Derivative
Chapter 12 Review: Symbolic Mathematics
Chapter 8 Multivariable Calculus Section 2 Partial Derivatives.
3 DERIVATIVES. The functions that we have met so far can be described by expressing one variable explicitly in terms of another variable.  For example,,
Chapter 14 – Partial Derivatives 14.3 Partial Derivatives 1 Objectives:  Understand the various aspects of partial derivatives Dr. Erickson.
Copyright © Cengage Learning. All rights reserved Partial Derivatives.
Chapter 4 Techniques of Differentiation Sections 4.1, 4.2, and 4.3.
Section 2.5 – Implicit Differentiation. Explicit Equations The functions that we have differentiated and handled so far can be described by expressing.
3 DERIVATIVES. The functions that we have met so far can be described by expressing one variable explicitly in terms of another variable.  For example,,
Copyright © Cengage Learning. All rights reserved. 5 Integrals.
Differential Equations Also known as Engineering Analysis or ENGIANA.
The Indefinite Integral
MULTIPLE INTEGRALS 2.2 Iterated Integrals In this section, we will learn how to: Express double integrals as iterated integrals.
TECHNIQUES OF INTEGRATION Due to the Fundamental Theorem of Calculus (FTC), we can integrate a function if we know an antiderivative, that is, an indefinite.
Directional Derivatives and Gradients
Tangent Planes and Normal Lines
ANTIDERIVATIVES Definition: reverse operation of finding a derivative.
8 TECHNIQUES OF INTEGRATION. Due to the Fundamental Theorem of Calculus (FTC), we can integrate a function if we know an antiderivative, that is, an indefinite.
Math Review and Lessons in Calculus
Math 3120 Differential Equations with Boundary Value Problems
Calculus BC 2014 Implicit Differentiation. Implicit Differentiation Equation for a line: Explicit Form Implicit Form Differentiate the Explicit Differentiation.
Section 13.3 Partial Derivatives. To find you consider y constant and differentiate with respect to x. Similarly, to find you hold x constant and differentiate.
© 2010 Pearson Education Inc.Goldstein/Schneider/Lay/Asmar, CALCULUS AND ITS APPLICATIONS, 12e– Slide 1 of 33 Chapter 3 Techniques of Differentiation.
2.2 The Derivative as a Function. 22 We have considered the derivative of a function f at a fixed number a: Here we change our point of view and let the.
Class 3 Linear System Solution Using the Laplace Transform
The Derivative and the Tangent Line Problem
Calculus for AP physics
Description and Analysis of Systems
2.2 Rules for Differentiation
3.2: Rules for Differentiation
Differentiation Rules
5.1 Introduction to Curve Fitting why do we fit data to a function?
The Derivative as a Function
Presentation transcript:

Calculus S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Math Review with Matlab: Differentiation

Calculus:Differentiation 2 n General Derivatives General Derivatives n Diff Command Diff Command n Differentiation Example Differentiation Example n Product Rule Example Product Rule Example n Chain Rule Example Chain Rule Example n Partial Differentiation Partial Differentiation n Partial Derivative Example Partial Derivative Example n Total Difference Approximation Total Difference Approximation n Sensitivity Analysis Example Sensitivity Analysis Example

Calculus:Differentiation 3 General Derivatives n In general, derivatives are used to determine how quickly or slowly a function varies with respect to a changing variable n For a two dimensional continuous curve, the derivative can be thought of as representing the instantaneous slope of the curve with respect to the changing variable n The derivative operation is a limiting process defined as:

Calculus:Differentiation 4 Differential Pairs n A few common differential pairs are shown below n Note that a is a constant

Calculus:Differentiation 5 Higher Order Derivatives n Higher order derivatives can also be defined n The second derivative of a function f(x) is defined as: n The nth derivative of a function f(x) is defined as:

Calculus:Differentiation 6 Diff Command The diff command can be used to differentiate symbolic variables diff(s) differentiates s with respect to the Matlab default free variable diff(s,v) differentiates s with respect to the free variable v diff(s,v,n) differentiates s n times with respect to the free variable v ( n must be positive)

Calculus:Differentiation 7 Differentiation Example n Given the sinusoidal function f(x): 1)Use Matlab to determine the first derivative of f(x) 3)Use Matlab to determine the second, third, and fourth derivatives of f(x) 2)Plot f(x) and its first derivative to verify that the first derivative of f(x) corresponds to the scaled instantaneous slope of f(x)

Calculus:Differentiation 8 First Derivative Use the diff command to determine the first derivative thus verifying the differential pair: » syms x » f=sin(2*x); » dfdx=diff(f) dfdx = 2*cos(2*x)

Calculus:Differentiation 9 Slope Analogy n Plot f(x)=sin(2x) and its df/dx=2cos(2x) » subplot(2,1,1) » ezplot(f) » subplot(2,1,1) » ezplot(f,0,pi) » grid on » subplot(2,1,2) » ezplot(dfdx,0,pi) » grid on n Show relationship between slope of f(x) and the derivative

Calculus:Differentiation 10 Second Derivative n Calculate second derivative from the first derivative » d2fdx2=diff(dfdx) d2fdx2 = -4*sin(2*x) n Calculate second derivative f(x) by passing 2 as the number of times to differentiate n Both methods give the same result! » d2fdx2=diff(f,2) d2fdx2 = -4*sin(2*x)

Calculus:Differentiation 11 Higher Order Differentiation n Calculate the third and fourth derivatives » d3fdx3=diff(f,3) d3fdx3 = -8*cos(2*x) » d4fdx4=diff(f,4) d4fdx4 = 16*sin(2*x)

Calculus:Differentiation 12 Product Rule n The Product Rule is used to differentiate products of functions of the same variable and is defined as: n The Product Rule can be expressed in shorthand notation as:

Calculus:Differentiation 13 Product Rule Example n Use Matlab to verify the Product Rule 1)Create two arbitrary functions u(x) and v(x) both dependent on x 2)Let f(x)=u(x)v(x) 3)Use Matlab to differentiate f(x) and verify that:

Calculus:Differentiation 14 Product Rule Verification n Define u and v as functions of x » syms x » u=sym('u(x)'); » v=sym('v(x)'); n Create f as the product of u and v n Differentiate f and verify the Product Rule » f=u*v f = u(x)*v(x) » dfdx=diff(f,x); » pretty(dfdx) /d \ /d \ |-- u(x)| v(x) + u(x) |-- v(x)| \dx / \dx /

Calculus:Differentiation 15 Chain Rule Example n The Chain Rule is used to differentiate a function of a function and is defined as: 2)Differentiate f(x) with respect to x 3)Use Matlab to verify the result 1)Given f(x) where a and b are constants:

Calculus:Differentiation 16 Perform Chain Rule n Break into sections and differentiate n Use the chain rule to differentiate f(x)

Calculus:Differentiation 17 Verify Chain Rule Result n The result is easily verified in Matlab » syms a b x » f=(a+b*x^3)^2; » dfdx=diff(f) dfdx = 6*(a+b*x^3)*b*x^2

Calculus:Differentiation 18 n To signify that a derivative is with respect to one variable that another variable exists use the notations: First Partial Derivative of f(x,y) with respect to x: (y held constant) First Partial Derivative of f(x,y) with respect to y: (x held constant) Partial Differentiation n Used to determine the rate of changes for functions of multiple changing variables n Consider a function f(x,y) which is dependent on two variables x and y

Calculus:Differentiation 19 Second Partial Derivatives n Second partial derivatives of f(x,y) can be defined as: n Provided that the second partial derivatives are continuous at the point of question, the following relationship holds true:

Calculus:Differentiation 20 Partial Derivative Example n Given the function: n Use Matlab to determine: 1) The first partial derivatives: 2) The second partial derivatives: 3) Verify the relationship:

Calculus:Differentiation 21 » syms x y; » f=2*x^3*y^2 + y^3; First Derivatives The standard diff command is used to determine the first partial derivatives in Matlab » dfdy = diff(f,'y') dfdy = 4*x^3*y+3*y^2 » dfdx = diff(f) dfdx = 6*x^2*y^2

Calculus:Differentiation 22 Second Derivatives The second derivatives with respect to the same variable can be found by instructing setting the n parameter to 2 » d2fdx2 = diff(f,2) d2fdx2 = 12*x*y^2 » d2fdx2 = diff(f,'y',2) d2fdx2 = 4*x^3+6*y

Calculus:Differentiation 23 Second Derivatives n The second derivatives with respect to different variables must be calculated from the first derivatives » d2fdxy = diff( dfdy, 'x') d2fdxy = 12*x^2*y » d2fdyx = diff( dfdx, 'y') d2fdyx = 12*x^2*y Verified!

Calculus:Differentiation 24 Total Difference Approximation n Given a function f(x,y) dependent upon the two variables x and y Suppose that small changes  x in x and  y in y occur simultaneously As a result, f changes to f +  f which can be approximated as:

Calculus:Differentiation 25 n A common application of sensitivity analysis is to examine the change in a digital filter’s frequency response and stability due to coefficient quantization Sensitivity Analysis n The total difference approximation can be extended to a function of N variables where: n The total difference approximation can be used to perform sensitivity analysis of analog and digital systems

Calculus:Differentiation 26 Sensitivity Analysis Example Given a circuit with a resistance R=1k  and initial current I=100mA flowing through it: 1)Approximate the total change in power if : u Current may increase by 2% u Resistance may increase by 5% 2)Calculate the approximate new power and actual new power when both I and R change by the above percents n The power, P, in Watts, absorbed by the resistor can be calculated using the equation:

Calculus:Differentiation 27 Sensitivity Equations n Create symbolic expressions to determine the approximate change in power given known changes in resistance, R, and current, I. » syms I R Idelta Rdelta » P=I^2*R; » dPdI=diff(P,'I') dPdI = 2*I*R » dPdR=diff(P,'R') dPdR = I^2 » Pdelta = Rdelta*dPdR + Idelta*dPdI Pdelta = Rdelta*I^2+2*Idelta*I*R

Calculus:Differentiation 28 Determine Initial Power n Create symbolic variables to represent the desired conditions to analyze Describe  R and  I in terms of percent changes » I1 = sym(0.1);% I=100mA » R1 = sym(1000);% R=1k Ohms » Idelta1 = sym(0.02*I1);% I changes 2% » Rdelta1 = sym(0.05*R1);% R changes 5% » P1_sym = subs(P,{'R','I'},{'R1','I1'}) P1_sym = I1^2*R1 » P1initial= double(eval(P1_sym)) P1initial = 10

Calculus:Differentiation 29 Sensitivity Approximation Substitute the desired parameters into the general symbolic expressions to determine approximate  P » P1delta_sym = subs(Pdelta,... {'R','I','Rdelta','Idelta'},... {'R1','I1','Rdelta1','Idelta1'}) P1delta_sym = Rdelta1*I1^2+2*Idelta1*I1*R1 » P1delta_approx = double(eval(P1delta_sym)) P1delta_approx = 0.9

Calculus:Differentiation 30 New Power Calculations n Evaluate approximated new total power n Calculate the actual new power » P1final_approx = double(eval(P1_sym+P1delta_sym)) P1final_approx = » P1final_sym = subs(P,{'R','I'},... {'(R1+Rdelta1)','(I1+Idelta1)'}) P1final_sym = (I1+Idelta1)^2*(R1+Rdelta1) » P1final_act = double(eval(P1final_sym)) P1final_act =

Calculus:Differentiation 31 Compare Results n Notice that the approximated power and actual new power are very close n Although this is a simplistic example, it demonstrates how the total difference approximation can be used to predict the response of more complicated systems without performing complex simulations The smaller the values of  R and  I are, the more accurate that  P will be

Calculus:Differentiation 32 Summary n Differentiation is used to determine the rate at which a function changes with respect to a changing variable The symbolic diff command can be used to differentiate functions. The user can specify the variable to differentiate with respect to and the number of times to differentiate n Partial differentiation is used to determine the rate of changes for functions of multiple changing variables n Total difference approximation and sensitivity analysis are used to approximate changes in a function based partial derivatives and on fixed changes in variables