MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program...

41
1 MATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The program is user friendly. All students of VŠB-TUO, Faculty of Mechanical Engineering are able 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 better understanding, 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 METHOD 11. EXAMPLES FOR REPETITION

Transcript of MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program...

Page 1: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

1

MATHCAD – Exercise guide

Program MATHCAD is very useful tool for the solution of the technical problems. The program is user friendly. All students of VŠB-TUO, Faculty of Mechanical Engineering are able 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 better understanding, 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 METHOD

11. EXAMPLES FOR REPETITION

Page 2: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

2

1. CHAPTER

Philosophy of MATHCAD is very similar as other Microsoft products, it means saving 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 in MATHCAD and there are simple examples for the better understanding (look at fig. 1.2.)

Fig. 1.2 – Help and its using

Page 3: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 at fig. 1.4.).

Fig. 1.4 – Calculator.

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

Page 4: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 and receive the different numerical results for different numeric entry.

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

Example:

Page 5: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 numerical result is always in SI system.

Example:

Page 6: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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:

Page 7: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 click on 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

Page 8: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 β

Page 9: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 more easy.

Fig. 3.4. Matrix Name

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

Fig. 3.5 Using Help

Determinant matrix A

Matrix inverse

Page 10: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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

Page 11: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 number enough).

Page 12: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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.

Page 13: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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

Page 14: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 be the 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

Page 15: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

15

Page 16: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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.

Page 17: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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

Page 18: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

18

Fig. 5.4. – Symbolic Derivation

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

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

Page 19: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

19

5.2.2 USING ICON “CALCULUS”

The procedure of the derivation is described at fig. 5.6. For the result is necessary 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

Page 20: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

20

Solution of the practical problems is shown bellow.

Practical example:

Determine the function of the velocity and acceleration of the piston of the crank mechanism 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 describe the position of the piston.

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

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

Page 21: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 described above.

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 according to which to integration. (fig. 5.9).

Page 22: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 is necessary to use equal sign for the symbolical operation.

Fig. 5.10 – Symbolic Integration

Page 23: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

23

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

Fig. 5.11 – Numerical Solution

Page 24: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

24

6. GRAPHS – 2D

The Graph toolbar (fig.6.1) button allows to insert 2-D or 3-D graphs. There are several 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 x1 and 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”.

Page 25: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

25

Fig. 6.3 – Creation of the 2-D Graph

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

Fig. 6.4 – Formatting Currently Selected X-Y Plot

Page 26: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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

Page 27: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 i2⋅ 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 to use it for one and more different function in the common graph. The procedure is described bellow (Fig. 6.7).

Page 28: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 of the piston for the crank mechanisms. The timing values of the velocity and acceleration is created bellow. The final graph is at Fig. 6.8.

Given:

T …..time for one turn

R 0.4m⋅:= L 0.8 m⋅:= ω 0.5 s1−⋅:=

Page 29: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 different plots. 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 on the axis X

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

Page 30: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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.

Page 31: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 is for example equation

Page 32: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

32

There is no possibility to solve it by symbolic operation. Using Given-Find, one result is found and value depends on the estimation of the result. There is no information on the number of the correct values of the result (Fig.8.1.). The result depends on the first estimation of 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 better understanding look at Fig. 8.2.

Page 33: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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”.

Page 34: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

34

8.2 ROOTS OF POLYNOMIAL – SOLUTION

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

Given polynomial:

Constants:

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

The procedure of the solution by MATHCAD is described bellow:

Page 35: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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

Page 36: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 in the point A (coordinates xA, yA and zA – look at Fig. 9.3). Determine the moment of the force F to the beginning of the coordinate systém (point 0).

Page 37: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 product radius vector R and force F.

Fx 30 N⋅:= Fy 20 N⋅:= Fz 50 N⋅:=

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

Page 38: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

38

10. EULLER NUMERICAL METHOD

The procedure of the solution will be described on the practical example – Projectile motion 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⋅ sec1−⋅:= φo 40 deg⋅:=

g 9.81 m⋅ sec2−⋅:=

mt 0.1 kg⋅:= b 5 106−⋅ N⋅ sec

2⋅ m2−⋅:=

Page 39: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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 step

vxo…initial velocity in axis x

n 10000:= Tc 75 sec⋅:= ∆tTc

n:= ∆t 7.5 10

3−× s=

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

1−⋅:= ti i ∆t⋅:=

Page 40: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

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⋅+

Page 41: MATHCAD – Exercise guide - fs.vsb.cz · PDF fileMATHCAD – Exercise guide Program MATHCAD is very useful tool for the solution of the technical problems. The ... (Because vector

41