MuPAD Misc Chp11: Engr/Math/Physics 25 Bruce Mayer, PE

advertisement
Engr/Math/Physics 25
Chp11:
MuPAD Misc
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
Engineering/Math/Physics 25: Computational Methods
1
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Using Greek Letters
 Can only do ONE
letter at time
 Not ALL std Ltrs
convert to Greek
•
Also Use
Ctrl+G
Engineering/Math/Physics 25: Computational Methods
2
 Some
Letters do
NOT have
conversions
 Spaces do
NOT
Convert
• Select
ONLY
letters;
NOT
letters and
a space
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TypeSetting Symbols
Engineering/Math/Physics 25: Computational Methods
3
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Greek from Command Bar
 Make Expression
h  A cost   
 Use Assignment
Operator → :=
 Next Pick-off the
Greek from the
COMMAND
BAR
 Click the Down
Arrow
 Now type
A*cos( *t+ )
Engineering/Math/Physics 25: Computational Methods
4
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Greek from Command Bar
 Then pick off omega
& phi from the pulldown list with cursor
in the right spot in
the “h” expression
 Some Other
Expressions with
Greek Pulled From
the Command Bar
 Then hit Enter to
create symbolic
expression
Engineering/Math/Physics 25: Computational Methods
5
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
“HashTag” PlaceHolders
 PlaceHolder for
items from the
Command Bar look
Something like: #f,
or #x xx
• Sort of Like
“HashTag” in Twitter
 Let take an AntiDerviative, and
Calculate some
Integrals
Engineering/Math/Physics 25: Computational Methods
6
1
 1  y 
2 2
dy

1
 1  y 
2 2
dy
7
1
 1  y 
3
 Use the
Command
Bar Integral
Pull-Down
 Pick first one to
expose Place
Holders for fcn & var
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
2 2
dy
1
 1  y 
“HashTag” PlaceHolders
 Replace“HashTags”
 For Variable EndPoint Definite
Integral
2 2
dy

1
 1  y 
7
dy
 The symbolic
Definite Integral
 The NUMERIC
Definite Integral(s)
 The HastTags
Engineering/Math/Physics 25: Computational Methods
2 2
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
7
1
 1  y 
3
2 2
dy
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 →
Engineering/Math/Physics 25: Computational Methods
8
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Quick Plot by Command Bar
 Find
Plot
Icon
 The
Template
 The Result after
filling in HashTag
 Then Fill in the
HashTag the the
desired Function;
say
y  x sin x
Engineering/Math/Physics 25: Computational Methods
9
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Adjust Plot
 MuPad picks the
InDep Var limits ±5
 Write out Function
to set other limits
Engineering/Math/Physics 25: Computational Methods
10
 2X-Clik the Plot to
Fine Tune Plot
formatting Using
the Object Browser
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Object Brower (2X Clik Plot)
Engineering/Math/Physics 25: Computational Methods
11
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
delete → early & often
 In MuPAD there is NO WorkSpace
Browser to see if variable has been
used 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
Engineering/Math/Physics 25: Computational Methods
12
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
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
Engineering/Math/Physics 25: Computational Methods
13
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU 11.2-1
 For a A very Good Exercise See file
• ENGR25_TYU11_2_1_Expressions_Functi
ons_1204.mn
Engineering/Math/Physics 25: Computational Methods
14
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU11.3
 Another Good Exercise
• ENGR25_TYU11_3_Expressions_Function
s_1204.mn
Engineering/Math/Physics 25: Computational Methods
15
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
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
Engineering/Math/Physics 25: Computational Methods
16
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU11.5 → Derivatives
 Take Some Derivatives
• ENGR25_TYU11_5_Derivatives_1204.mn
Engineering/Math/Physics 25: Computational Methods
17
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU11.5 → AntiDerivatives
 Do Some Integration
• ENGR25_TYU11_5_Integration_1204.mn
Engineering/Math/Physics 25: Computational Methods
18
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU 11.5 → Sums & Series
 Exercise Taylor’s Series & Sums
• ENGR25_TYU11_5_6789_Taylor_Sums_L
imits_1204.mn
Engineering/Math/Physics 25: Computational Methods
19
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
TYU11.6 → ODEs
 Do an ODE Solution
• file = ENGR25_TYU11_6_ODE_1204.mn
– By: File → Export → PDF
Engineering/Math/Physics 25: Computational Methods
20
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
All Done for Today
It’s All
GREEK
to me…
Engineering/Math/Physics 25: Computational Methods
21
Bruce Mayer, PE
BMayer@ChabotCollege.edu ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx
Download