1 / 26

PH15720

PH15720. Laboratory Techniques - An Introduction to MATHCAD. Introduction. The if() function Complex Numbers Symbolic Algebra. The if() function. if(condition,Tval,Fval) condition evaluated True ( 0)  returns Tval False (=0)  returns Fval. Conditional Operators.

tyme
Download Presentation

PH15720

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. PH15720 Laboratory Techniques - An Introduction to MATHCAD

  2. Introduction • The if() function • Complex Numbers • Symbolic Algebra

  3. The if() function • if(condition,Tval,Fval) • condition evaluated • True (0)  returns Tval • False (=0)  returns Fval

  4. Conditional Operators • From evaluation palette • = (bold, logical equals) <ctrl => • > greater than • < less than •  greater than or equal to •  less than or equal to

  5. Boolean Algebra • False = 0 • True = 1 (or 0) • Use multiplication for AND • Use addition for OR • (x>5)•(x<8) • True if x>5 and x<8 • (x<3)+(x>16) • True if x<3 or x>16

  6. Boolean algebra #2

  7. Magnetic field due to long straight wire #1 • Different equations inside and outside conductor • Inside: • Outside:

  8. Magnetic Field due to long straight wire #2 • Combine two equations using if() function Outside Combined with if() Inside

  9. Magnetic Field due to long straight wire #3

  10. Complex Numbers in MathCAD • Handled same as other numbers • Full range of complex maths • Put i (or j) directly after complex number • Enter i as 1i • Use |x| to get modulus • Use arg() to get argument • Avoid using i as variable when using complex numbers

  11. Complex Numbers #1 • Basic complex maths

  12. Complex Numbers #2 • Principle roots found • Need to get other roots by hand or by using polyroots()

  13. Symbolic Algebra #1 • Manipulate equations rather than numbers • Symbolic Palette • Evaluate  • Simplify simplify  • Expand expand,  • Substitute substitute, =   • Solve solve,  

  14. Symbolic Algebra #2 • Not covered in depth here • Handout gives resource centre references • Worth a look

  15. The tin can problem #1 • From example sheet - solve using mathCAD • A manufacturer of tin cans wishes to maximise the volume contained in a can, whilst minimising the amount of metal used to construct the can. Show that, for given amount of metal, the volume of a can is maximised when the radius is half the height.

  16. The tin can problem Overview of Solution • Assume Area of tin constant • Obtain expression for Volume in terms of Area and radius • Find dVol/dr • dVol/dr will be 0 at max volume so use this to find r • Substitute to find r in terms of h

  17. The tin can problem #2 • Need to find when dVol/dr=0 • Write down expressions for Volume & Area • Use bold, logical equals sign

  18. The tin can problem #3 • Copy & Paste expression for Area & solve for h

  19. The tin can problem #4 • Copy & paste expression for Vol • Substitute expression for h

  20. The tin can problem #5 • Use symbolic differentiation to find dVol/dr • This will be 0 at maximum

  21. The tin can problem #6 • Solve for dVol/dr = 0 to find r • 2 solutions, copy +ve

  22. The tin can problem #7 • Have expression for r in terms of Area • Substitute expression for Area • Now have expression for r in terms of r and h

  23. The tin can problem #8 • Take expression for r in terms of r and h • Add r= • Solve for r to get answer

  24. Summary • Modelling a discontinuous universe with the if() function • Complex Numbers • Symbolic Algebra

  25. Assessment • Next Week • In class • Processing experimental • Data

  26. AssessmentGolden Rules • Comment & Explain • Get paper size right (A4) • Layout/Page breaks • Use MathCAD 8 format • Name/UserID on Header/Footer • Attempt everything

More Related