Math I22 Sec S08N03 - Test 3
Mar 31 2008
Question 1:
^ut" fn ,F*
to
rule on four subintervals, approxi
Use,Sa,
Simpson's
v
(") [r points]
frx) =
t'r
rl"' (")
Jn
A r= V
I + st,tlrrx)
=l
+
1 L ' ' t ( o
Notice that the PDE of Exercise 1 is the one that we encountered for density waves. It
also describes the ow of trac in a very simple model for which the speed of all vehicles is
c. In this case, the
Integrating the last equation with respect to t from t = 1 to t = 2 gives
2
N(2 ) N(1 ) =
1
q(X1 , t) q(X2 , t) dt.
Combining this with Equation (1), we see that
X2
X1
X2
(x, 2 ) dx
2
(x, 1 ) dx =
X1
{7)
K) Q3712 {W rwxjé J W:
{){Xsc\
2k «v§\
.m
m
Kw UL >
{X é 1%
:3}
m. a, (gfjfgét? (E 5 c
\
km, lam-é (gain
{7 5
E >
g f f
3 f.
if A 5/
m. W W M» VVVVV
J
3.
C
\j /
l Jwa
m W2. Himaa 55 int.
G
3.3
Running and plotting the solution
Here is how the program is run from the command window. Also shown is a method for
plotting the solution for a specic time; in this case t = 2.5 seconds:
>godunov
Numerical Solution of Trac Flow PDEs
Maths 367: Advanced Applied and Computational Mathematics
1
Introduction
In most of our examples involving the trac ow PDEs (e.g.the green light and red light
prob
% Specify the x gridpoints:
x = transpose(0:h:L);
% Initialise R as a M+1 by N+1 matrix:
R=zeros(M+1,N+1);
% Compute the first column of R:
R(:,1) = x.*exp(-x);
% Compute the first row of R:
R(1,:) =
CSC 230 Fall 2017
Lab 7: Interrupts
I. What is an interrupt?
An interrupt is a signal that can interrupt and alter the flow of current program execution. It is a
method that allows programs to
3r ( Wag? Mk: m £3714
s * , rzv ;( w
{ 6M: Mk: 1,: {Mg fbwwg
g' ; » \ {1 it]?
«NR I]
y Eh L «E xxx
39> 6 £119.93; Mk Ln K i k
i
E
f,
mi
a
F
xi}
2m (2m m Vi. m if} (1" (31%
170 W M7U 1;»;
GIL]
1:5