+ All Categories
Home > Documents > Mathcad Text

Mathcad Text

Date post: 07-Aug-2018
Category:
Upload: flavia
View: 248 times
Download: 0 times
Share this document with a friend

of 16

Transcript
  • 8/20/2019 Mathcad Text

    1/41

      1

    MATHCAD – Exercise guide

    Program MATHCAD is very useful tool for the solution of the technical problems. Theprogram is user friendly. All students of VŠB-TUO, Faculty of Mechanical Engineering areable to solve the technical problems using this software in the faculty computer rooms. The

    program is suitable for dealing with team or individual projects.In this guide, there are clarified the basic mathematical operations. For the betterunderstanding, the text is supplemented practical examples.

    CONTENT 

    1.  CHAPTER – BASIC MATHEMATICAL OPERATIONS

    2. 

    CHAPTER – CREATION OF TEXT

    3. 

    CHAPTER – MATRIX

    4. 

    CHAPTER – SYSTEM OF EQUATIONS

    5.  CHAPTER – SYMBOLIC OPERATION

    6.  CHAPTER – GRAPHS -2D

    7.  CHAPTER – GRAPHS – 3D

    8.  CHAPTER – FUNCTION “ROOT”

    9.  CHAPTER – VECTORS

    10. 

    CHAPTER – EULEROVA NUMERICAL METHOD11. EXAMPLES FOR REPETITION

  • 8/20/2019 Mathcad Text

    2/41

      2

    1.  CHAPTER

    Philosophy of MATHCAD is very similar as other Microsoft products, it meanssaving of files, opening of files, print of files and so on. All information on using

    MATHCAD are in English language in “Help”, look at fig.1.1

    Fig. 1.1 – Help

    In Help, there are clearly describe mathematical operations which is possible to do inMATHCAD and there are simple examples for the better understanding (look at fig.1.2.)

    Fig. 1.2 – Help and its using

  • 8/20/2019 Mathcad Text

    3/41

      3

    Fig. 1.3 – Help and Its Using

    1.1  BASIC MATHEMATICAL OPERATION

    There is possibility to do the basic mathematical operation using “calculator” (look atfig. 1.4.).

    Fig. 1.4 – Calculator.

    Types of the equal signs and their using is at fig. 1.5..

  • 8/20/2019 Mathcad Text

    4/41

      4

    Fig. 1.5. Types of the Equals Signs

    If the wrong equal sign is used, it is not possible to receive the numerical result.

    If the Assigned sign is used, it is possible to solve the problem symbolically andreceive the different numerical results for different numeric entry.

    It is necessary to choose the letters for the variables carefully. Some letters arepredefined in MATHCAD.

    Example:

  • 8/20/2019 Mathcad Text

    5/41

      5

    If in expression is red color, it means “mistake”.

    If “click” on the expression, the explanation of the mistake appears.

    There is possibility to use the right of the keyboard for the input.

    1.2  UNITS

    Basic information on units are in help (look at fig.1.6.) icon “scoop”.

    Fig. 1.6 – Units

    During the numerical solution, there is not necessary to transfer units. The numericalresult is always in SI system.

    Example:

  • 8/20/2019 Mathcad Text

    6/41

      6

    If is necessary to receive the result in the different units, it is possible to transfer it by“click” on the unit and to the black place holder to write the request unit.

    The red color signalizes the mistake.

    Example:

    Angles

    If the value is given in angles, it is necessary to add unit “deg” …..degree.

    Otherwise, the value is given in radians.

    Example:

  • 8/20/2019 Mathcad Text

    7/41

      7

    Multiple units

    In MATHCAD, there are not given multiple unites. It is necessary to predefine it.

    Example:

    2.  CHAPTER – CREATION OF TEXT

    Text is input to the file by“click” on the space bar. It means, write the text and clickon the space bar. Text is possible to edit by the same way as in Word and so on.

    If the text is ready in Word and after that is input to MATHCAD, it is possible to “re-open” input text and edit it by double click on the right button of the mouse.

    Edit the text is possible by opening the icon “Format” on the scroll bar (look at fig.2.1.).

    Fig. 2.1 – Text Editor

    Greek letters

    Greek letters is possible to input:

    1. 

    Using the icon with Greek letters (look at fig. 2.2)

    Fig. 2.2. – Greek Letters

  • 8/20/2019 Mathcad Text

    8/41

      8

    2. Hot-key - write letter and press key “ctrl g”.

    It is possible to input “pictures” to the MATHCAD file without any restriction.

    3.  MATRIX

    3.1. CREATION OF THE MATRIX

    1. Matrix is created by click to icon “Matrix” (look at fig. 3.1)

    Fig. 3.1. Creation of the Matrix_1

    2. The second click to the opened window Matrix to icon matrix again (fig. 3.2)

    Fig. 3.2 Creation of the Matrix_2

    3. Fill the requested dimension of the matrix to the window “Insert Matrix” (fig. 3.3)

    a α 

    b β 

  • 8/20/2019 Mathcad Text

    9/41

      9

    Fig. 3.3 Creation of the Matrix_3

    3.2. OPERATION WITH MATRIX

    For the work it is better to name the matrix (fig. 3.4). After that, the work is moreeasy.

    Fig. 3.4. Matrix Name

    All operation possible to do in MATHCAD with matrix are described with simpleexamples in Help (fig. 3.5.)

    Fig. 3.5 Using Help

    Determinant matrix A

    Matrix inverse

  • 8/20/2019 Mathcad Text

    10/41

      10

    Matrix transponse

    Extract of the one element from

    the matrix

    Extract is done by one instruction

    The first row and the fist column have the index “0”.

    Matrix addition

    Adding the number

    Symbolic operation with matrix.

    All operations is possible to do by symbolic way (fig. 3.6.).

    Fig. 3.6. Symbolic Operation with Matrix

  • 8/20/2019 Mathcad Text

    11/41

      11

    4.  SYSTEM OF EQUATIONS

    4.1. SYSTEM OF LINEAR EQUATIONS

    If it is linear system of equations, it is possible to solve it using matrix operations.

    A - matrix of constants

    X – matrix of “unknown”

    V – matrix of result

    The way is described in the following example.

    System of equations

    The first row of the vector X is unknown x

    The second row of the vector X is unknown y

    The third row of the vector X is unknown z

    (Because vector has one column, for the identification of one element is one numberenough).

  • 8/20/2019 Mathcad Text

    12/41

      12

    Checking of the results:

    Practical example:

    Determine the force in the all beam of the truss as shown in the fig.3.7.

    h = 4 m, b = 6 m, Q = 10 kN

    Fig. 4.1. – Truss System

    System of equilibrium equations for every joint.

  • 8/20/2019 Mathcad Text

    13/41

      13

    A – matrix of constant

    X – matrix of unknowns

    V – matrix (vector) of results

    Reaction in the support B

    4.2 

    SYSTEM OF THE EQUATIONS (LINEAR, NON-LINEAR SYSTEM)

    It is possible to solve the system of equations in MATHCAD using Given-Find.

    Solution procedure will be illustrated on the example.

    System of equations:

    1.  step - estimation result

    2.  step - given

    3.  step - system of equations

    4.  step - find

  • 8/20/2019 Mathcad Text

    14/41

      14

    Checking of the results:

    The result is not zero but the number is very small. The result has sufficient accuracy.

    Warning: If the system is linearly dependent (infinitely solutions) , the results will bethe nearest value to the first guess result.

    If the unknowns have units, it is necessary to solve the problems with respect to it.

    It will be explain in example.

    Determine the force in the all beam of the truss as shown in the picture bellow.

    h = 4 m, b = 6 m, Q = 10 kN

  • 8/20/2019 Mathcad Text

    15/41

      15

  • 8/20/2019 Mathcad Text

    16/41

      16

    5.  SYMBOLIC OPERATION

    5.1  SYSTEM OF THE QUADRATIC AND CUBIC EQUATIONS –

    SYMBOLIC SOLUTION

    The way of solution is explained on the picture bellow (fig. 5.1.).

    Fig. 5.1. – Way of Solution

    Procedure:

    •  Write equation with “bold” equal sign (fig. 5.2.).

    • 

    Click by cursor to unknown what is needed to solve•  Click by cursor to icon “Symbolics – Variable - Solve” .

    •  For quadratic equation there are two results.

    Fig. 5.2. – Equal Sign

    Procedure for the cubic equation is the same.

  • 8/20/2019 Mathcad Text

    17/41

      17

    There are three results (Fig. 5.3.)

    Fig. 5.3. – Way of Soulution

    5.2  SYMBOLIC DERIVATION

    5.2.1 USING ICON SYMBOLIC DERIVATION

    The way of solution is described at fig. 5.4.

    The procedure is following:

    •  Write the function

    •  Click by cursor to the variable

    •  Click by cursor to the icon Symbolice-Variable-Differentater

  • 8/20/2019 Mathcad Text

    18/41

      18

    Fig. 5.4. – Symbolic Derivation

    If the function has two variable, it is necessary to click by cursor to variableaccording to which to derivation (fig. 5.5).

    Fig. 5.5 – Symbolic Derivation Function with Two and More Unknowns

  • 8/20/2019 Mathcad Text

    19/41

      19

    5.2.2  USING ICON “CALCULUS”

    The procedure of the derivation is described at fig. 5.6. For the result isnecessary to use equal sign for the symbolical operation.

    Fig.5.6 –

    Symbolic Derivation.

    Procedure for the numerical result is described bellow:

    •  All values have to be given

    •  Function

  • 8/20/2019 Mathcad Text

    20/41

      20

    Solution of the practical problems is shown bellow.

    Practical example:Determine the function of the velocity and acceleration of the piston of the crankmechanism as shown in the scheme 5.7.

    5.7. Scheme of the Crank Mechanism

    Procedure of solution:

    •  Find the function of the angle ψ as the function of the time ψ= ψ(t) 

    •  Find the function of the angle φ  as the function of the time φ= φ  (t)

    • 

    Find the coordinate x as the function of the time x=x(t). Coordinate x describethe position of the piston.

    •  Velocity of the piston v(t)  - [m/s] – velocity is the first derivation of thecoordinate x with respect time t. 

    •  Acceleration of the piston a(t) - [m/s2] - acceleration is the first derivation ofthe velocity function with respect to time t  or the second derivation of thecoordinate x with respect time t (fig. 5.8).

  • 8/20/2019 Mathcad Text

    21/41

      21

    Fig. 5.8 - Solution of Kinematics Values of the Crank Mechanism

    5.3  SYMBOLIC INTEGRATION

    The procedure of the integration is very similar as procedure of the derivation describedabove.

    5.3.1 USING ICON SYMBOLIC INTEGRATION

    The procedure of the integration is described at fig. 5.9.

    Procedure

    •  Write the function

    •  Click by cursor to the variable

    •  Click by cursor to the icon Symbolic-Variable-Integrate

    •  If the function has two variable, it is necessary to click by cursor to variable accordingto which to integration. (fig. 5.9).

  • 8/20/2019 Mathcad Text

    22/41

      22

    Fig. 5.9 – Symbolic Integration

    5.3.2  USING ICON “CALCULUS”

    The procedure of the derivation is described at fig. 5.10. For the result isnecessary to use equal sign for the symbolical operation.

    Fig. 5.10 – Symbolic Integration

  • 8/20/2019 Mathcad Text

    23/41

      23

    The procedure for the numerical result of integration is the same as the procedure forthe derivation. It is described at fig. 5.11.

    Fig. 5.11 – Numerical Solution

  • 8/20/2019 Mathcad Text

    24/41

      24

    6.  GRAPHS – 2D

    The Graph toolbar (fig.6.1) button allows to insert 2-D or 3-D graphs. There areseveral way of the procedure of the graph creation.

    Fig. 6.1 – Graph Toolbar

    6.1. CREATING AN X-Y PLOT

    1.  step – creation the plot of the variable x

    x   0 1,   10..:=   The step of the variable is given by difference between value x1and x2. “Two dots” is necessary to insert from the icon Matrix (Fig. 6.2)

    Fig. 6.2 – Creation of the Plot

    2.  f x( )   3   x2

    ⋅   2   x⋅+   1+:=   Function of the variable x

    3.  Choose the type of the graph from the icon Graph (Fig. 6.3) and fill the variable to

    the placeholder in axis “x” and function in axis “y”.

  • 8/20/2019 Mathcad Text

    25/41

      25

    Fig. 6.3 – Creation of the 2-D Graph

    Using double click on the graph, the table Formattin Currently Selected X-Y Plot isopened (Fig. 6.4).

    Fig. 6.4 – Formatting Currently Selected X-Y Plot

  • 8/20/2019 Mathcad Text

    26/41

      26

    There is possible to change the type, the colour and the weigh of the curve (Fig.6.5_1).

    Fig. 6.5 – Formatting Currently Selected X-Y Plot _1

    There is possible to describe the graph (Fig. 6.5_2).

    Fig. 6.5 – Formatting Currently Selected X-Y Plot _2

  • 8/20/2019 Mathcad Text

    27/41

      27

    6.2. CREATING OF THE GRAPH – 2ND

     WAY

    The procedure is described bellow and the graph is at fig. 6.6.

    • 

    ORIGIN  0

    :=   It has to done on the beginning•  n   10:=   number of steps

    •  i   0   n..:=   plot for the variable

    • xi   3   i

    2⋅   2   i⋅+   1+:=   function

    •  Open icon „Graph“ ( fig.6.1 – Graph Toolbar)

    •  Choose the type of the graph

    • 

    On axis x – variable•  On axis y – function value

    Fig. 6.6 – Graph – 2nd Way

    6.3. CREATING OF THE GRAPH – 3RD

      WAY

    There is possibility to create the graph using icon “PROGRAMMING. It is possible touse it for one and more different function in the common graph. The procedure is described

    bellow (Fig. 6.7).

  • 8/20/2019 Mathcad Text

    28/41

      28

    •  Write the name of the function with assigned sign (look at fig. 1.5)

    •  Open the icon PROGRAMMING

    •  Write the first unction

    • 

    Click at “Add line” and write the second function•  Other steps are the same as described above in chap. 6.1 and 6.2

    Fig. 6.7 – Graph – 3rd Way

    Practical example.

    At chapter 5.2.2 there are derived the equations for the velocity and acceleration ofthe piston for the crank mechanisms. The timing values of the velocity and acceleration iscreated bellow. The final graph is at Fig. 6.8.

    Given:

    T …..time for one turn

    R 0.4 m⋅:=   L 0.8 m⋅:=   ω 0.5 s 1−⋅:=  

  • 8/20/2019 Mathcad Text

    29/41

      29

    Fig. 6.8. – Final Graph

    6.4. CREATION THE GRAPH OF THE MORE FUNCTIONS

    The way the creation is described bellow for three functions in the three differentplots. The functions have to have different “name”. The plot can be the same.

    •  Write the functions and their plots

    •  Open icon Graph and fill the placeholders. The different domains are onthe axis X

    •  The functions are on axis Y. The other functions give on the axis Y whenwriting comma after the previous function (Fig. 6.9).

  • 8/20/2019 Mathcad Text

    30/41

      30

    •  The next steps are the same as described in chapter 6.1 and 6.2.

    •  The result is at Fig. 6.10.

    Fig. 6.10 – Final Graph

    7.  GRAPH – 3D

    The procedure is described bellow.

    •  Write the function

    •  Create the domain

    •  Write the formula for the creation of the matrix of the function value - M i,j 

    •  Creating of the graph from the icon “Graph”. The final graph is at Fig. 7.1.

  • 8/20/2019 Mathcad Text

    31/41

      31

    It is possible to read the all members the matrix M.

    Fig. 7.1 – Final Graph

    8.  FUCTION “ROOT”

    8.1 FUNCTION ROOT USING FOR SOLUTION OF EQUATIONS

    In special occasion, the equations is no possible to solve as mentioned in the chapter 4. It isfor example equation

  • 8/20/2019 Mathcad Text

    32/41

      32

    There is no possibility to solve it by symbolic operation. Using Given-Find, one result isfound and value depends on the estimation of the result. There is no information on thenumber of the correct values of the result (Fig.8.1.). The result depends on the first estimationof the uknown x.

    Fig. 8.1. – Way of the Solution

    Solution of the equation

    is value x  so that the left and right side of the equation has the same value. For the betterunderstanding look at Fig. 8.2.

  • 8/20/2019 Mathcad Text

    33/41

      33

    Fig. 8.2. – Number of the Results

    The procedure for the solution of the equation using „Root“ is described at Fig. 8.3.

    Fig. 8.3. – Solution by Using “Root”.

  • 8/20/2019 Mathcad Text

    34/41

      34

    8.2  ROOTS OF POLYNOMIAL – SOLUTION

    The procedure for the solution of the polynomial root is described bellow on the practicalexample.

    Given polynomial:

    Constants:

    The cubic polynomial has three roots. It is possible to check, if the graph of the function forthe polynomial is drawn (Fig. 8.1).

    The procedure of the solution by MATHCAD is described bellow:

  • 8/20/2019 Mathcad Text

    35/41

      35

    Checking:

    9.  VECTORS

    Vector in 2-D is given by 2 parts, in 3-D is given by 3 parts.

    Vector A in 3-D is given

    Value of A is:

    In 3-D problems, the orientation of the vector is determined by three angles (α,β,γ), as shown

    in the picture (Fig. 9.1)

    Fig. 9.1. – Orientation of the Vector

  • 8/20/2019 Mathcad Text

    36/41

      36

    9.1. SCALAR PRODUCTS OF 2 VECTORS

    2 vectors A and B are given.

    Scalar product of the 2 vectors is scalar C.

    9.2. VECTOR PRODUCT OF 2 VECTORS

    2 vectors A and B is given. The result of the

    vector product is vector D. The mark for the vector

    product is given from icon MATRIX ( Fig. 9.2.)

    Fig. 9.2. – Mark for Vector Product

    Practical example:

    Find the resultant of force F. F is given by 3 parts Fx,Fy,Fz. Point of acction of force F is inthe point A (coordinates xA, yA and zA – look at Fig. 9.3). Determine the moment of theforce F to the beginning of the coordinate systém (point 0).

  • 8/20/2019 Mathcad Text

    37/41

      37

    Fig. 9.3. – Force in 3-D

    Given:

    zA 4 m⋅:= 

    Value of the force F:

    Determine of the position vector R

    (radius vector R).Value of  R – it is length between

    points 0-A [m] .

    Mo – moment of the force F to the point 0. Moment of the force to the point is vector productradius vector R and force F.

    Fx 30 N⋅:= 

    Fy 20 N⋅:= 

    Fz 50 N⋅:= 

    xA 2 m⋅:=   yA 3 m⋅:=  

  • 8/20/2019 Mathcad Text

    38/41

      38

    10. EULLER NUMERICAL METHOD

    The procedure of the solution will be described on the practical example – Projectilemotion in an environment that resists.

    Given:

    Projectile with mass mt motions from the point O (Fig.10.1). Initial velocity is vo initial angle

    is the force φφφφo .... The force acting against motion is Fb  and the value of the force is the

    function of the constant b - Fb= b*v2.

    Find the range of the projectile.

    Fig. – 10.1. – Description of the Problem

    The velocity v is vector and in every positioon of the projectile has two parts (vx and vy).

    For angle φ is dependence:

    vo 800 m⋅   sec  1−

    ⋅:=   φo 40 deg⋅:=  

    g 9.81 m⋅   sec  2−

    ⋅:=  

    mt 0.1 kg⋅:= 

    b 5 10  6−

    ⋅   N⋅   sec2

    ⋅   m  2−

    ⋅:= 

  • 8/20/2019 Mathcad Text

    39/41

      39

    The force Fb acting against the motion depends:

    - in axis x

    - in axis y

    The equilibrium of the motion:

    - in axis x

    Acceleration a in axis x as the function velocity vx and vy 

    - in axis y

    Procedure for Euler method of the numerical integration

    i 1 n..:=  

    n…....number of steps

    Tc….time of the solution

    ∆t…..time for one stepvxo…initial velocity in axis x

    n 10000:= 

    Tc 75 sec⋅:= 

    ∆t

    Tc

    n:= 

    ∆t 7.5 10

      3−

    ×   s= 

    i 0 n..:=   xi   0 m⋅:=   yi   0 m⋅:=   vxi   0 m⋅   sec  1−

    ⋅:=   vyi   0 m⋅   sec  1−

    ⋅:=   ti   i ∆t⋅:=  

  • 8/20/2019 Mathcad Text

    40/41

      40

    vyo…initial velocity in axis y

    The equations are based on the equations for the moition with constant acceleration.

    The result is graf (fig. 10.2 – Trajectory of the projectile)

    Fig. 10.2 – Trajectory of the Projectile

    s so vo t⋅+1

    2a⋅ t

    2⋅+  

    v vo a t⋅+ 

  • 8/20/2019 Mathcad Text

    41/41


Recommended