Areacircle( r ) := r
Areacircle( 5) = 78.54
text if x < 5
Areacylinder ( r , h ) := 2 r h + 2 r
= "this is me"
fun otherwise
Areacylinder ( 2 , 2) = 50.265
ORIGIN:= 1
0
20
5
Mat :=
9
13
6 7 8
10 11 12
14 15 16
2
0
1
2
3
1, 1
:= 1
1
5
Mat =
9
13
10 11 12
14 15 16
2
5, 1
1, 5
:= 1
Mat
:= 1
Mat
5, 2
2, 5
:= 1
Mat
:= 1
Mat
5, 3
3, 5
:= 1
Mat
:= 1
Mat
5, 4
4, 5
:= 1
Mat
:= 1
Mat
5, 5
5, 5
:= 1
:= 2
1
5
Mat = 9
13
Mat
6, 6
4 1
8 1
4 1 0
8 1 0
10 11 12 1
14 15 16 1
1 1 1 2
:= 66
1
5
9
Mat =
13
1
10 11 12 1
14 15 16 1
1
1 2
0 0
0
0
66
Range Variable
S1 := 1 , 2 .. 10
S2 := 1 , 0 .. 10
the increment
the decrease
S1 =
S3 := 1 .. 10
if no second value then it will be 1
S2 =
rija
:= S3
-1
3.142
-2
12.566
S3
rija
S3
-3
28.274
-4
50.265
-5
rija =
78.54
-6
-7
153.938
10
-8
201.062
-9
254.469
-10
314.159
113.097
1
1
3.142
12.566
28.274
50.265
78.54
113.097
153.938
201.062
254.469
10
314.159
Array
S1
:= S1 + 1
rija
10 , 1
Array
S1
10
10
17
17
26
Array = 5
26
37
37
50
50
65
65
82
82
101
10
101
k := 1 .. 4
Ahmad
k+ 2n
= 314.159
n := 1 .. 4
:= k + 2n
1
1
5
Ahmad = 6
10
10
11
11
12
12
Example Problem
Array
10 , 1
= 101
Density := 997.1
kg
3
NetPressure( d ) := Density g d
g = 9.807
m
2
1
2
4
Depths := 5 m
7
17
33
kPa = 1000 Pa
Pressures := NetPressure( Depths)
9.778
19.556
39.113
Pressures = 48.891 kPa
68.447
166.23
322.681
5kg
6lb
M :=
3mg
2oz
1
2
4
Depths = 5 m
7
17
33
3 m
s2
ft
5
s2
A :=
2 m
s2
4 ft
s2
F := M A = 19.217 N
F1 := M A
15
4.15
F1 =
N
0
0.07
F1
= 4.15 N
2, 1
1
5
9
Mat =
13
1
0
0
66
4 1 0
8 1
10 11 12 1
14 15 16 1
1
1 2
0 0
4
v := Mat
4
8
12
v=
16
1
0
Text := max( v) = 16
Text1 := min( v) = 0
Va1 := 3.49
Va2 := 3.51
T1 := floor Va1 = 3
T1 := floor Va2 = 3
T2 := ceil Va2 = 4
T2 := ceil Va1 = 4
T3 := trunc Va1 = 3
T3 := trunc Va2 = 3
T4 := round Va1 = 3
1
2
V1 :=
3
4
T4 := round Va2 = 4
V1 = 10
Ctrl + 3 ()
2 = 62
2 + 2 + 2 + 2 + 2 = 62
i=1
y := 1
f ( y) := 2
f ( y) = 6
2 + 2 + 2 = 24
j =1
1
2
V1 =
3
4
V1
:= 5
5, 1
1
2
V1 = 3
4
5
6
12
3
Sum :=
( V1 L) = 18
24
L =1
30
1400
1200 3
Volume :=
m
1200
1000
TotalMass :=
700
700 kg
Density :=
700 4
500 m
kg
6
(VolumeFirstFloorDensityFirstFloor) = 3.16 10 m
FirstFloor
M n := 1
M u := 2
Page223
Interpolation Function
vx :=
1
2
vy :=
4
8
x.T :=
vx :=
0.125
0.25
vy :=
24.3
26.6
linterp x.T , T ,
1
2
Time := 3 s
4
5
2.1
3.9
m
Velocity := 5.9
7.8 s
10.1
1.5
2.2
xValues :=
s
0
6
3
4.3 m
IntResult := linterp( Time , Velocity, xValues ) =
0.3 s
12.4
MathCad Programing
0.5 < Factor < 2.0
Factor( x) :=
2 if x > 2
x if 0.5 < x < 0.5
0.5 otherwise
0.125
0.25
IntResult = 3
1
m
s
FS( d ) :=
BB( x , y) :=
( )
Test x , y :=
if x 0
100 if y 0
200 otherwise
if x < 0
300 if y 0
400 otherwise
Test ( 4 , 2 ) = 300
i := 1 , 2 .. 4
i =
3
4
x :=
7
10
1
2
3
4
Test :=
i
100 if
2
1
y :=
3
2
200 if
300 if
400 otherwise
Test =
i
100
200
300
400
T :=
p
5
Result := 0
5
T = "Fails-Retry"
T = "Result is Zero"
Zero otherwise
T = "Passes-Solution Works"
1
2
3
v := stack( 1 , 2 )
w := stack( 1 , "a" , 3 )
v=
1
2
1
w = "a"
3
Plotting a Range over a Log Scale
Low := 0.001
log
Step :=
High := 10000
Intervals := 20
High
Low = 0.35
Intervals
log
High
=7
Low
r := 1 , 2 .. ( Intervals + 1 )
X := Low 10
( r 1) Step
Function ( z) := z
s := 0.001 ,
10000 0.001
20
.. 10000
s=
110-3
110-3
4
1 10
500
999.999
1 10
1.5103
100
2103
10
Function( s )
2.5103
3103
0.1
3.5103
0.01
4103
4.5103
5103
1 10
1 10
4
1 10
0.01
100
5.5103
1 10
6103
6.5103
7103
...
4
1 10
X =
r
1 10
110-3
100
2.23910-3
10
5.01210-3
0.011
0.1
0.025
Function( X )
0.056
0.01
0.126
1 10
0.282
1 10
4
1 10
0.01
1
X
100
1 10
0.631
1.413
3.162
7.079
15.849
35.481
79.433
...
m := 2kg
v := 200
cm
s
m v
2
= 4 J
T :=
24.3
26.6
, 0.2 = 25.68