ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Chp11: MuPAD Misc
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Using Greek Letters Can only do ONE letter at time Not ALL std Ltrs convert to Greek Also Use Ctrl+G Some Letters do NOT have conversions Spaces do NOT Convert Select ONLY letters; NOT letters and a space
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TypeSetting Symbols
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Greek from Command Bar Make Expression Use Assignment Operator → := Now type A*cos( *t+ ) Next Pick-off the Greek from the COMMAND BAR Click the Down Arrow
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Greek from Command Bar Then pick off omega & phi from the pull- down list with cursor in the right spot in the “h” expression Then hit Enter to create symbolic expression Some Other Expressions with Greek Pulled From the Command Bar
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods “HashTag” PlaceHolders PlaceHolder for items from the Command Bar look Something like: #f, or #x Sort of Like “HashTag” in Twitter Let take an Anti- Derviative, and Calculate some Integrals Use the Command Bar Integral Pull-Down Pick first one to expose Place Holders for fcn & var
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods “HashTag” PlaceHolders Replace“HashTags” For Variable End- Point Definite Integral The HastTags The symbolic Definite Integral The NUMERIC Definite Integral(s)
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Assignment vs. Procedure := does NOT Create a function It assigns a complex expression to an Abbreviation To Create A Function (MuPad “Procedure”) include characters -> Comparing →
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Quick Plot by Command Bar Find Plot Icon Then Fill in the HashTag the the desired Function; say The Template The Result after filling in HashTag
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Adjust Plot MuPad picks the InDep Var limits ±5 Write out Function to set other limits 2X-Clik the Plot to Fine Tune Plot formatting Using the Object Browser
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Object Brower (2X Clik Plot)
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods delete → early & often In MuPAD there is NO WorkSpace Browser to see if a variable has been evaluated and currently contains a value Use “delete(p)”, where “p” is the variable to be cleared in a manner similar to using “clear” in MATLAB When in Doubt, DELETE if ReUsing a variable symbol
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods delete → early & often BOOBY PRIZE → A Variable defined in one WorkBook will CARRY OVER into OTHER WorkBooks The Deleted Assignment in the original WorkBook can be Recovered by using Evaluate When in doubt → DELETE See File: Multiple_Assigns_Deletions_1204
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU For a A very Good Exercise See file ENGR25_TYU11_2_1_Expressions_Functi ons_1204.mn
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU11.3 Another Good Exercise ENGR25_TYU11_3_Expressions_Function s_1204.mn
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Inserting Images into MuPAD Unlike the MATLAB Command Window, IMAGES can be imported into Text Regions of a MuPAD WorkBook Copy the Image then See File Insert-Graphic_1204.mn –Contains some other “tips” on MuPAD as well
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU11.5 → Derivatives Take Some Derivatives ENGR25_TYU11_5_Derivatives_1204.mn
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU11.5 → AntiDerivatives Do Some Integration ENGR25_TYU11_5_Integration_1204.mn
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Power Series General Power Series: A form of a GENERALIZED POLYNOMIAL Power Series Convergence Behavior Exclusively ONE of the following holds True a)Converges ONLY for x = 0 (Trivial Case) b)Converges for ALL x c)Has a Finite “Radius of Convergence”, R
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Functions as Power Series Many Functions can be represented as Infinitely Long PolyNomials Consider this Function and Domain The Geometric Series form of f(x) Thus
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series Consider some general Function, f ( x ), that might be Represented by a Power Series Thus need to find all CoEfficients, a n, such that the Power Series Converges to f ( x ) over some interval. Stated Mathematically Need a n so that:
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series If x = 0 and if f (0) is KNOWN then a 0 done, 1→∞ to go…. Next Differentiate Term-by-Term Now if the First Derivative (the Slope) is KNOWN when x = 0, then
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series Again Differentiate Term-by-Term Now if the 2 nd Derivative (the Curvature) is KNOWN when x = 0, then
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series Another Differentiation Again if the 3 rd Derivative is KNOWN at x = 0 Recognizing the Pattern:
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series Thus to Construct a Taylor (Power) Series about an interval “Centered” at x = 0 for the Function f ( x ) Find the Values of ALL the Derivatives of f ( x ) when x = 0 Calculate the Values of the Taylor Series CoEfficients by Finally Construct the Power Series from the CoEfficients
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Taylor Series for ln(e+x) Calculate the Derivatives Find the Values of the Derivatives at 0
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Taylor Series for ln(e+x) Generally Then the CoEfficients The 1 st four CoEfficients
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Taylor Series for ln(e+x) Then the Taylor Series
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series at x ≠ 0 The Taylor Series “Expansion” can Occur at “Center” Values other than 0 Consider a function stated in a series centered at b, that is: Now the Radius of Convergence for the function is the SAME as the Zero Case:
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Taylor Series at x ≠ 0 To find the CoEfficients need ( x − b ) = 0 which requires x = b, Then the CoEfficient Expression The expansion about non-zero centers is useful for functions (or the derivatives) that are NOT DEFINED when x=0 For Example ln( x ) can NOT be expanded about zero, but it can be about, say, 2
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Expand x½ about 4 Expand about b = 4: The 1 st four Taylor CoEfficients
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 32 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Expand x ½ about 4 SOLUTION: Use the CoEfficients to Construct the Taylor Series centered at b = 4
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 33 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Example Expand x ½ about 4 Use the Taylor Series centered at b = 4 to Find the Square Root of 3
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 34 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Expand About b=1, ln(x)/1 Da1 := diff(ln(x)/x, x) Db2 := diff(Da1, x) Dc3 := diff(Db2, x) Dd4 := diff(Dc3, x) ReCall that ln(1) = 0
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 35 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Expand About b=1, ln(x)/1 ln(x)/x, x f0 := taylor(ln(x)/x, x = 1, 0) f1 := taylor(ln(x)/x, x = 1, 1) f2 := taylor(ln(x)/x, x = 1, 2)
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 36 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Expand About b=1, ln(x)/1 f3 := taylor(ln(x)/x, x = 1, 3) f4 := taylor(ln(x)/x, x = 1, 4) d6 := diff(ln(x)/x, x $ 5)
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 37 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Expand About b = 1, ln(x)/1 plot(f0, f1, f2, f3, f4, f5, x =0.5..3, GridVisible = TRUE, LineWidth = 0.04*unit::inch, Width = 320*unit::mm, Height = 180*unit::mm, AxesTitleFont = ["sans-serif", 24], TicksLabelFont=["sans-serif", 16])
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 38 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 39 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 40 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 41 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU 11.5 → Sums & Series Exercise Taylor’s Series & Sums ENGR25_TYU11_5_6789_Taylor_Sums_L imits_1204.mn
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 42 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods TYU11.6 → ODEs Do an ODE Solution file = ENGR25_TYU11_6_ODE_1204.mn –By: File → Export → PDF
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 43 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today It’s All GREEK to me…