Please help with this

조회 수: 4 (최근 30일)
Victor
Victor 2013년 12월 17일
답변: Roger Stafford 2013년 12월 18일
hi i need help writing a code that will allow the user to choose which of each of the intersections the user wants to solve for. these are the equations:
1: 100 + 200 = f1 + f3 or f1 + f3 = 300 (1)
2: 300 + f1 = f2 + f4 or −f1 + f2 + f4 = 300 (2)
3: f5 + f2 = 100 +500 or f2 + f5 = 600 (3)
4: f3 + f6 = 100 +300 or f3 + f6 = 400 (4)
5: f4 +f7 = f6 +200 or f4 − f6 + f7 = 200 (5)
6: 200 + 400 = f5 + f7 or f5 +f7 = 600 (6)
  댓글 수: 2
Roger Stafford
Roger Stafford 2013년 12월 17일
Victor, you have seven unknowns and only six equations, so even if you use all six equations, they do not uniquely determine a solution - that is, there will be an infinite continuum of solutions. You need one more equation before you can obtain a unique solution.
Victor
Victor 2013년 12월 17일
편집: Walter Roberson 2013년 12월 18일
this is what it asks:
Assume that there is no traffic jam or stopped car anywhere. Then, at each intersection, the net traffic flow is zero. For example, at intersection 1, we have all the incoming traffic must be equal to the out going traffic: 100 + 200 = f1 + f3. Write down the equations for all the intersections. You can use MATLAB to study the following questions.
a) Is there enough number of equations to determine all the unknown traffic flows f1 to f7?
b) If not enough, you can suggest to add traffic sensors to measure some traffic flows such that you can determine all other traffic flows through the equations. Which traffic flows to measure? How many?
Assume that you have measured the necessary traffic flows you need and you know how to compute other traffic flows.
Program Requirement:
Your MATLAB program should ask for the measurements of the traffic flows that the user chooses, decide if they are the appropriate ones to measure (according to the dimension and rank of the matrix), and output the rest of traffic flows if the measurements are appropriate, otherwise, ask for the measurements of different traffic flow.
You should allow the user to install more than one traffic sensor. Your program should inform the user what the nature of the solution would be. Make sure that you review the part of lecture on solving linear algebraic equations for non-rectangular matrix. The program should also check for the repeated choices made by the user, and provide messages to inform the user that the choice was made before

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2013년 12월 17일
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 12월 18일
As I read it, you need to allow the user to indicate a list of flows (each f1 to f7) and corresponding traffic volumes. Then, list entered, analyze to see whether the user has given enough information to solve the flows exactly; if not, say so and go back to the beginning. If the user gave too much information or gave flow measurements that make the whole system impossible, then say so and go back to the beginning. If the user gave just the right amount of information and it is not contradictory, spit out the list of all of the traffic flows; and then go back to the beginning.

댓글을 달려면 로그인하십시오.


Roger Stafford
Roger Stafford 2013년 12월 18일
I will give you one more hint on your problem, Victor. The part of the problem statement that says " according to the dimension and rank of the matrix " is an important indication of how you should proceed in writing your requested program. You need to figure out what matrix they are referring to and write your program to proceed accordingly.

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by