Repeat the loop for a few intervals

  • Thread starter Thread starter jiayingsim123
  • Start date Start date
  • Tags Tags
    intervals Loop
Click For Summary
SUMMARY

The discussion focuses on finding the roots of the equation x*Sin[x] + 1.5 x - 3 within the interval from x=0 to x=2∏ using the bisection method in Mathematica 8. The user seeks guidance on implementing a loop to divide the graph into specific intervals, such as from x=1.0 to x=2.0. The proposed solution involves using a For loop to iterate through the intervals, applying the bisection method for each defined range. This approach allows for systematic root-finding across multiple intervals.

PREREQUISITES
  • Understanding of the bisection method for root-finding
  • Familiarity with Mathematica 8 programming syntax
  • Knowledge of trigonometric functions and their properties
  • Basic concepts of interval division in numerical methods
NEXT STEPS
  • Research "Mathematica For loop syntax" for better implementation
  • Learn about "Numerical methods for root-finding" beyond the bisection method
  • Explore "Graphing functions in Mathematica" to visualize roots
  • Investigate "Error analysis in numerical methods" to improve accuracy
USEFUL FOR

Mathematics students, software developers using Mathematica, and anyone interested in numerical methods for solving equations.

jiayingsim123
Messages
24
Reaction score
0
I am trying to find the three roots from x=0 to x=2∏ for this equation: x*Sin[x] + 1.5 x - 3. I want to divide the graph into intervals of say from x=1.0 to x=2.0 as one interval and so on and so forth. How do I go about inserting that code into my existing codes? I am using the bisection method to solve this equation. I thought of just replacing the intervals one by one but I don't think it's very feasible. Could anyone of you guide me on how to go about doing it? I'm using Mathematica 8. Thanks!
 
Physics news on Phys.org
I'm not exactly sure what you need. Will this help?

For[high = 1, high ≤ 7, high++,
low = high - 1;
yourbisectioncodeusinglowandhighendpoints;
]

If that isn't what you need then provide some more detail.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K