Ing.Mecanico
to accompany
Applied Numerical Methods
With MATLAB for Engineers and Scientists
Steven C. Chapra
Tufts University
CHAPTER 1
1.1 You are given the following differential equation with the initial condition, v(t = 0) = 0,
c
dv
= g − d v2
dt
m
Multiply both sides by m/cd
m dv m
=
g − v2
c d dt c d
Define a = mg / c d
m dv
= a2 − v2
c d dt
Integrateby separation of variables,
dv
cd
∫ a 2 − v 2 = ∫ m dt
A table of integrals can be consulted to find that
∫a
2
dx
x
1
= tanh −1
2
a
a
−x
Therefore, the integration yields
1
vc
tanh −1 = d t + C
a
am
If v = 0 at t = 0, then because tanh–1(0) = 0, the constant of integration C = 0 and the solution
is
1
vc
tanh −1 = d t
a
am
This result can then berearranged to yield
v=
⎛ gc d ⎞
gm
tanh ⎜
t⎟
⎜ m⎟
cd
⎠
⎝
1.2 This is a transient computation. For the period from ending June 1:
1
Balance = Previous Balance + Deposits – Withdrawals
Balance = 1512.33 + 220.13 – 327.26 = 1405.20
The balances for the remainder of the periods can be computed in a similar fashion as
tabulated below:
Date
Deposit
Withdrawal
1-MayBalance
$ 1512.33
$ 220.13
$ 327.26
1-Jun
$ 1405.20
$ 216.80
$ 378.61
1-Jul
$ 1243.39
$ 350.25
$ 106.80
1-Aug
$ 1586.84
$ 127.31
$ 450.61
1-Sep
$ 1363.54
1.3 At t = 12 s, the analytical solution is 50.6175 (Example 1.1). The numerical results are:
step
2
1
0.5
v(12)
51.6008
51.2008
50.9259
absolute
relative error
1.94%
1.15%
0.61%
wherethe relative error is calculated with
absolute relative error =
analytical − numerical
× 100%
analytical
The error versus step size can be plotted as
2.0%
1.0%
relative error
0 .0%
0
0.5
1
1.5
2
Thus, halving the step size approximately halves the error.
1.4 (a) The force balance is
2
2.5
dv
c'
=g− v
dt
m
Applying Laplace transforms,
sV − v(0) =g c'
−V
sm
Solve for
V=
g
v ( 0)
+
s ( s + c ' / m) s + c ' / m
(1)
The first term to the right of the equal sign can be evaluated by a partial fraction expansion,
g
A
B
=+
s ( s + c ' / m) s s + c ' / m
(2)
g
A( s + c' / m) + Bs
=
s ( s + c ' / m)
s ( s + c ' / m)
Equating like terms in the numerators yields
A+ B=0
g=
c'
A
m
Therefore,
A=
mg
c'B=−
mg
c'
These results can be substituted into Eq. (2), and the result can be substituted back into Eq.
(1) to give
V=
mg / c'
mg / c'
v ( 0)
−
+
s
s + c' / m s + c' / m
Applying inverse Laplace transforms yields
v=
mg mg −( c '/ m )t
−
e
+ v ( 0) e − ( c ' / m ) t
c'
c'
or
3
v = v(0)e −( c '/ m )t +
(
mg
1 − e −( c '/ m )t
c'
)
where thefirst term to the right of the equal sign is the general solution and the second is the
particular solution. For our case, v(0) = 0, so the final solution is
v=
(
mg
1 − e −( c '/ m )t
c'
)
(b) The numerical solution can be implemented as
12.5 ⎤
⎡
v(2) = 0 + ⎢9.81 −
(0) 2 = 19.62
68.1 ⎥
⎣
⎦
12.5
⎡
⎤
v(4) = 19.62 + ⎢9.81 −
(19.62)⎥ 2 = 6.2087
68.1
⎣
⎦
Thecomputation can be continued and the results summarized and plotted as:
t
0
2
4
6
8
10
12
v
0
19.6200
32.0374
39.8962
44.8700
48.0179
50.0102
dv/dt
9.81
6.2087
3.9294
2.4869
1.5739
0.9961
0.6304
60
40
20
0
0
4
8
12
Note that the analytical solution is included on the plot for comparison.
4
1.5 (a) The first two steps are
c(0.1) = 10 −0.2(10)0.1 = 9.8 Bq/L
c(0.2) = 9.8 − 0.2(9.8)0.1 = 9.604 Bq/L
The process can be continued to yield
t
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
c
10.0000
9.8000
9.6040
9.4119
9.2237
9.0392
8.8584
8.6813
8.5076
8.3375
8.1707
dc/dt
-2.0000
-1.9600
-1.9208
-1.8824
-1.8447
-1.8078
-1.7717
-1.7363
-1.7015
-1.6675
-1.6341
(b) The results when plotted on a semi-log...
Regístrate para leer el documento completo.