How to set up a system of linear equations with loop and solve it?
2 views (last 30 days)
Show older comments
There is a system of linear equations with 1000 equations and 1000 variables. The 1000 variables are: x(1),x(2),...,x(999),b. The 1000 equations are: 6*x(i)+(1000-i)*(x(i+1)-x(i))-5*x(i+500)=1 (i=0,1,...,499), and x(i)=1+b*(2/3-i*2/3000)^6 (i=500,501,...,999), where x(0)=0.8. How to program this system of linear equations and solve it?
3 Comments
Torsten
on 18 May 2018
Edited: Torsten
on 18 May 2018
If you understood the solution of the two ODEs that are coupled at x=1/3, you should also come up with a solution of this linear system of equations that is coupled at i=500.
Hint:
The "real" unknown is b which can be determined by making x(500) from the first recursion equal x(500) from the second recursion.
Best wishes
Torsten.
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!