Applied Numerical Methods W/MATLAB: for Engineers & Scientists
Author: Steven Chapra
3rd Edition
1
,Chapter 1
1.1 You Are Given The Following Differential Equation With The Initial Condition, V(T = 0) = 0,
Dv C
= G − d V2
Dt M
Multiply Both Sides By M/Cd
M Dv M G − V 2
=
Cd Dt Cd
Define A = mg / cd
M Dv
= A2 − V2
Cd Dt
Integrate By Separation Of Variables,
Dv Cd
A 2
−V 2
= M Dt
A Table Of Integrals Can Be Consulted To Find That
Dx 1 X
= Tanh−1
A 2
− X2 A A
Therefore, The Integration Yields
1 V C
Tanh −1 = d T + C
A A M
If V = 0 At T = 0, Then Because Tanh–1(0) = 0, The Constant Of Integration C = 0 And The
Solution Is
1 V C
Tanh −1 = d T
A A M
This Result Can Then Be Rearranged To Yield
gm gc
V= Tanh d
t
m
cd
1.2 This Is A Transient Computation. For The Period From Ending June 1:
2
, 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 Balance
1-May $ 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:
Absolute
Step V(12) Relative
Error
2 51.6008 1.94%
1 51.2008 1.15%
0.5 50.9259 0.61%
Where The Relative Error Is Calculated With
analytical − numerical
Absolute Relative Error = 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 2.5
Thus, Halving The Step Size Approximately Halves The Error.
1.4 (A) The Force Balance Is
3
, Dv C'
=G− V
Dt M
Applying Laplace Transforms,
G C'
Sv − V(0) = − V
S M
Solve For
V= +
V(0) (1)
G
S(S + C' / M) S + C' / M
The First Term To The Right Of The Equal Sign Can Be Evaluated By A Partial Fraction Expansion,
G A B
= + (2)
S(S + C' / S S + C' /
M) M
G A(S + C' / M) +
=
S(S + C' / Bs S(S + C' /
M) M)
Equating Like Terms In The Numerators Yields
A+ B=0
C'
G=
AM
Therefore,
Mg
A=
Mg B=−
C' C'
These Results Can Be Substituted Into Eq. (2), And The Result Can Be Substituted Back Into Eq.
(1) To Give
Mg / C' Mg / C' V(0)
V= +
− S + C' / M S + C' /
S M
Applying Inverse Laplace Transforms Yields
Mg Mg −(C'/ M)T
V= − E + V(0)E −(C'/ M)T
C' C'
4