Sie sind auf Seite 1von 7

Computer Programming Skills MathCad Solution by DF Sozinando Student at the

Vaal University of Technology


ORIGIN 1
t
t
6min := s
t
6km := s
1
0.75km := u
a
0
km
hr
:= v
a
72
km
hr
:=
u
c
v
a
:= v
c
v
a
:= u
d
v
a
:=
v
d
0
km
hr
:=
t
a
1s := t
c
1s := t
d
1s :=
t
5s :=
Given
s
t
t
c
t
t
+
2
|

\
|
|
.
v
a
=
s
1
u
a
v
a
+
2
|

\
|
|
.
t
a
=
t
a
t
c
+ t
d
+ t
t
=
t
a
t
c
t
d
|

\
|
|
|
|
.
Find t
a
t
c
, t
d
,
( )
:= t
a
75s = t
c
240 s = t
d
45s =
a v u , t , ( )
v u -
t
:=
a v
a
u
a
, t
a
,
( )
0.267
m
s
2
=
a v
c
u
c
, t
c
,
( )
0
m
s
2
=
a v
d
u
d
, t
d
,
( )
0.444 -
m
s
2
=
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
Alternative Solution calculating time making use of programming tool:
time V
a
S
a
, S
t
, T
t
, speed ,
( )
"Program aimed to return the time"
"at uniform acceleration"
"at constant acceleration"
"and at uniform deceleration"
T
c
2 S
t

V
a
T
t
- speed "constant" = if
T
a
2S
a
V
a
speed "accelerating" = if
T
d
T
t
2S
a
V
a
-
2 S
t

V
a
T
t
-
|

\
|
|
.
- speed "decelerating" = if
:=
time 72
km
hr
0.75km , 6km , 6min , "accelerating" ,
|

\
|
|
.
75s =
time 72
km
hr
0.75km , 6km , 6min , "constant" ,
|

\
|
|
.
240 s =
time 72
km
hr
0.75km , 6km , 6min , "decelerating" ,
|

\
|
|
.
45s =
speed
1
t
1
( )
a v
a
u
a
, t
a
,
( )
0 t
1
+
( )
:=
t
1
0 0 5s + ( ) , 75s ..
0
5
10
15
20
25
30
35
40
45
50
55
60
65
70
75
s
= :=
0 20 40 60 80
0
5
10
15
20
speed
1
t
1
( )
t
1
speed
1
t
1
( )
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
1.333
2.667
4
5.333
6.667
8
9.333
10.667
12
13.333
14.667
16
...
m
s
=
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
t
2
75s 75s 5s + , 75s 240s + ( ) ..
75
80
85
90
95
100
105
110
115
120
125
130
135
140
145
...
s
= :=
speed
2
t
2
( )
u
c
a v
c
u
c
, t
c
,
( )
t
c
t
2
+
( )
+ :=
100 150 200
19.98
19.99
20
20.01
20.02
speed
2
t
2
( )
t
2
speed
2
t
2
( )
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
20
20
20
20
20
20
20
20
20
20
20
20
20
...
m
s
=
t
3
75s 240s + ( ) 75s 240s + ( ) 5s + , 360s ..
315
320
325
330
335
340
345
350
355
360
s
= := speed
3
t
3
( )
a v
d
u
d
, t
d
,
( )
t
3
t
t
-
( )
:=
speed
3
t
3
( )
1
1
2
3
4
5
6
7
8
9
10
20
17.778
15.556
13.333
11.111
8.889
6.667
4.444
2.222
0
m
s
=
310 320 330 340 350 360
0
5
10
15
20
speed
3
t
3
( )
t
3
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
0 100 200 300
0
10
20
speed
1
t
1
( )
speed
2
t
2
( )
speed
3
t
3
( )
t
1
t
2
, t
3
,
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
Alternative Solution making use of programming tool:
Speed v a , d , t , t , ( ) "Program aimed at plotting a speed vs time graph (v=u+at)"
"v: constant speed "
"a: uniform acceleration "
"d: uniform deceleration"
"time at uniform acceleration v/a"
"time at constant speed t"
"time at deceleration v/d"
t
1
v
a

t
2
t
1
t +
t
3
t
2
v
d
+
a 0 t + ( ) 0 t s t
1
s if
v t
1
t s t
2
s if
v d t t
2
-
( )
- t
2
t s t
3
s if
0 otherwise
:=
Speed 20
m
s
0.267
m
s
2
, 0.444
m
s
2
, 240s , 75s ,
|

\
|
|
.
20
m
s
=
Speed 20
m
s
0.267
m
s
2
, 0.444
m
s
2
, 240s , 240s ,
|

\
|
|
.
20
m
s
=
Speed 20
m
s
0.267
m
s
2
, 0.444
m
s
2
, 240s , 360s ,
|

\
|
|
.
0
m
s
=
0 100 200 300
0
10
20
Speed 20
m
s
0.267
m
s
2
, 0.444
m
s
2
, 240s , t ,
|

\
|
|
.
t
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
5s :=

last first -
n 1 -
=
solve n ,
explicit
1
first last -

-
n first last , , ( ) 1
first last -

- :=
n 0s 75s , 5s , ( ) 16 =
n 75s 315s , 5s , ( ) 49 =
n 315s 360s , 5s , ( ) 10 =
tt
a
t
1
:= tt
c
t
2
:= tt
d
t
3
:=
tt
a
3
10s = tt
c
17
155 s = tt
d
4
330 s =
tt
a
8
35s = tt
c
23
185 s = tt
d
7
345 s =
tt
a
13
60s = tt
c
35
245 s = tt
d
9
355 s =
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
Solution making use of programming tool:
p h p
1
, p
2
, h
1
, h
2
,
( )
"Program aimed to return pressure at any height of the building (y=m.x + c )"
"when the pressure is varying lineally increasing from the bottom to the top"
m
p
2
p
1
-
h
1
h
2
+

c p
1

x h
y m x c +
pressure y
sorting "pressure at the bottom" pressure p
1
= if
"pressure at the top" pressure p
2
= if
"pressure between bottom and top" p
1
pressure < p
2
< if

augment pressure sorting , ( ) return


:=
p 0m 1.8
N
m
2
, 3.2
N
m
2
, 180m , 120m ,
|

\
|
|
.
1.8 "pressure at the bottom" ( )
N
m
2
=
p 200m 1.8
N
m
2
, 3.2
N
m
2
, 180m , 120m ,
|

\
|
|
.
2.73333 "pressure between bottom and top" ( )
N
m
2
=
p 300m 1.8
N
m
2
, 3.2
N
m
2
, 180m , 120m ,
|

\
|
|
.
3.2 "pressure at the top" ( )
N
m
2
=

Das könnte Ihnen auch gefallen