using mathcad scc spring-08 electronic technology wang ng x-2638 [email protected]
TRANSCRIPT
Overview
• About MathCAD• Using MathCAD as an interactive calculator• Using MathCAD with formulas• Equation solver• Convenient features• Advanced features• Example : AC calculations• Conclusion
General features• MathCAD
– WYSIWYG– K to 4-year College level.– Simple, easy to use.– Not intended for heavy-duty number crunching.
• MatLab– Programming style.– Up to M.S. level – Extensive training required.– Suitable for heavy-duty number crunching.
Calculator Mode
• The Calculator Tool Bar
• The “=“ key (It is the output command)
• Examples: 1+1=2 1/3=0.333 sin(1)=0.841 sin(1deg)=0.017 1mi=1931m 1mi=6336ft
Interactive: just edit the numbers sin(45deg)=0.707
Complex Calculations
• Use i or j for the imaginary part (5+3j)+(2-4j)= (5+3j)-(2-4j)= (5+3j)*(2-4j)= (5+3j)/(2-4j)= (5+3j)^2= =
• Polar/Rectangular conversion: |5+3j|= arg(5+3j)= (type deg) 2e^45j*deg=
• “j” can be placed in front by typing: 1j*45deg
j35
Formulas
• You need to provide data: use the “:” key as the input command (it will look like :=).
• Then you need to enter the formula.
• Use the “=“ key to obtain the result.
• Example: Enter the followings E:3V R:2 I:E/R I=
Equation solver
Find(x,y,...)Solves a system of equations.Minerr(x,y,...)Approximate solution to a system of equations.root(f(x),x,a,b)Solves one equation in one unknown.lsolve(M,v)Solves a system of linear equations.polyroots(v)Solves for the roots of the polynomial whose
coefficients are in v.
Example: Using the “root” commandThis QuickSheet can be used to find a solution to the equation f x( ) 0 for a function f(x) you specify, using the built-in root
function.
Enter a function f(x):
f x( ) x3
ex
Enter a guess value for the solution (modify as necessary):
x 3
soln root f x( ) x( )
Note: For a complex solution, input a complex guess value.
Solution:
soln 0.773
Convenient features
• Use the worksheet as handouts.• Specify the unit of the results.• Change the input data and the results will
be updated automatically.Note: Data must be placed above formulas.
• Many built-in functions (root, …)• Comments can be entered after the “ key.• You can save the worksheet.• Resource center: Tutorials, quick sheets, …
Advanced features• Symbolic process: The symbolic menu bar
– Examples: type x^2”space”-1”space” and then select “Factor” from the symbolic menu bar.
• Graphs: see attached Bode Plot example.
• Array and range variables: Use the “;” key. See attached example.
• Programming: The programming menu bar has the basic programming commands.
• Calculus, differential equations, matrices, optimization, statistics, …
Bode Plot Example
T 10
41
j
105
1j
103
1j
104
dB_T 20 log T
_T arg T 180
1 10 1001 1031 10
41 10
51 10
60
1020304050607080
dB_T ( )
1 10 1001 10
31 10
41 10
51 10
6180
135
90
45
0
_T ( )
1 10 1001 1031 10
4504540353025201510
50
20 log1
1j
100
1 10 100 1 10
31 10
490
67.5
45
22.5
0
arg1
1j
100
180
Range Variables
E 0V 3V 9V E0
3
6
9
V R 10 I E( )
E
R I E( )
0
0.3
0.6
0.9
A
f 1Hz 5Hz f1
2
3
4
5
Hz L 10H XL f( ) 2f L XL f( )
62.832
125.664
188.496
251.327
314.159
Examples: RLC circuit impedance
R1 R2
R3C1
C2
L
ZTotal 1.013 103 158.114i ZTotal Z4 R1
Z4 12.579 158.114i Z4 Z31
jXC1( )1
1
Z3 2 103 6.283i Z3 Z2 R2
Z2 0.013 6.283i Z2 Z11
jXL( )1
1
Z1 3 103 79.577i Z1 R3 j XC2
XL 6.283XC2 79.577XC1 159.155
XL 2 f LXC21
2 f C2 XC11
2 f C1
L 1mHC2 2FC1 1F
R3 3kR2 2kR1 1kf 1KHz
Conclusion
MathCAD is a versatile teaching tool:
• Calculation steps (formulas)
• Demonstrate specific effects
• Graphics
• Exam/Homework problems
• Partial credit
• Course note