Solving 2D Numerical Quadrature
9 views (last 30 days)
Show older comments
Right now, I am trying to code for 2D Left-Point Rectangular Rule for this equation:
The equation that I am supposed to use is provided (I^LP)
where I_i,j is a double summation (the furtherest right equation)
I know now that i can't increase both variables at the same time, but I can't figure how to do it properly even after I tried nested for loops. I am too burnt out to think properly anymore so if someone could help me, it would be greatly appreciated.
3 Comments
J. Alex Lee
on 4 Dec 2020
How far off is "so far off", and what reason do you have to expect closer answers? The implementation looks right.
Is the purpose of this exercise to understand the numerical quadrature methods? Or how to implement the methods in code? If it's to understand the method, one exercise you can do is plot the error from true solution as a function of n_x (for simplicity set n_y=n_x), and notice the relationship. Then do the same thing for trapezoidal rule and simpson's rule.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!