ENGR 018 L04
.pdf
keyboard_arrow_up
School
Pasadena City College *
*We aren’t endorsed by this school
Course
018
Subject
Health Science
Date
May 24, 2024
Type
Pages
5
Uploaded by kingchun0313
Name ENGR 018 MATLAB Handout L4. Applications of Arrays: Solving Systems of Linear Equations 1.
Circuit Analysis Problem For the electrical circuit shown at right, with resistance and voltage values as indicated below: R
1 = 150 Ω
R
2 = 250 Ω R
3 = 100 Ω
R
4 = 200 Ω
R
5 = 150 Ω
V
1 = 30 V V
2 = 60 V the following equations can be derived for the mesh currents* i
a
, i
b
, and i
c
: *
Note: the ‘true’ currents are equal to the mesh currents in the outer branches of the circuit, but must be calculated from the mesh currents for inner branches, e.g., the current downward in R
5 is i
b –
i
c
. 450 i
a –
100 i
b –
200
i
c = –
30 –
100 i
a
+ 500 i
b –
150 i
c = 0 –
200 i
a
–
150 i
b + 350 i
c = –
60 a) Write MATLAB statements to define the necessary arrays for this system of equations, and solve for values of the mesh currents (indicate the commands and result). i
a = A i
b = A i
c = A b) Calculate the residual
. Does the solution appear to be valid? (Show command and result) c) Use the rref function on the augmented matrix to convert the system into reduced row echelon form (show result). Is it compatible with your solution for the mesh currents above? V
1 R
1 i
a R
4 i
c R
2 i
b R
5 V
2 R
3
ENGR 018 MATLAB Handout L4. Applications of Arrays: Solving Systems of Linear Equations 2.
Traffic Engineering Engineers often analyze traffic flow patterns in urban areas to determine settings for traffic control devices such as traffic lights. The figure below shows the flow of downtown traffic in a certain city during the rush hours on a typical day. The arrows indicate the direction of traffic flow on each one-way road, and the average number of vehicles per hour entering and leaving each intersection appears beside each road. 5th Avenue and 6th Avenue can each handle up to 2000 vehicles per hour without causing congestion, whereas the maximum capacity of both 4th Street and 5th Street is 1000 vehicles per hour. The flow of traffic is controlled by traffic lights installed at each of the four intersections. a) Arrange this information into a system of equations describing the traffic flow in terms of x
1
, x
2
, x
3
, x
4
. You should have 4 equations (one for each intersection), and not all x
i terms will appear in each equation (in other words, the coefficients will be zero for some x terms in some equations). The intersection at 4
th
St & 5
th
Ave has been done for you as an example.
vehicles in = vehicles out →
300 + 1200 = x
1 + x
4 →
1 x
1 + 0 x
2 + 0 x
3 + 1 x
4 = 1500 b) Write MATLAB statements to define the arrays for this system of equations:
c) Try to solve the system of equations in MATLAB using x = A\b. What is the result?
d) Use the rank and length functions to demonstrate that the system is underdetermined (i.e., has an infinite number of solutions). Show commands and results.
ENGR 018 MATLAB Handout L4. Applications of Arrays: Solving Systems of Linear Equations e) Use the rref function on the augmented matrix to corroborate the fact that the system is underdetermined (show command and result).
f) Use the result for the reduced-row form above to rewrite (by hand) the equations so that x
1
, x
2
, and x
3 could each be calculated from some given value of x
4
. Propose one viable solution to the traffic flow problem; in other words, use trial and error to propose a value of x
4 that leads to values of x
1
, x
2
, and x
3 that all meet the traffic flow requirements (direction and maximum vehicles) described in the last paragraph of the original problem statement.
3.
Nutrition A dietitian wishes to plan a meal around three foods. The meal should include 8800 units of vitamin A, 2160 units of vitamin C, and 1020 units of calcium. Based on laboratory measurements, the number of units of the vitamins and calcium in one ounce of each food is indicated in the table below: Nutrient content of foods (units of nutrient per ounce of food) Nutrient Food 1 Food 2 Food 3 Vitamin A 400 1200 800 Vitamin C 110 570 340 Calcium 90 30 60 a) Arrange this information into a system of equations that would be used to find the appropriate quantity (in ounces) of each food that is needed to meet the nutritional objectives for the meal.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help