Repeat the loop for a few intervals

  • Thread starter Thread starter jiayingsim123
  • Start date Start date
  • Tags Tags
    intervals Loop
AI Thread Summary
To find the three roots of the equation x*Sin[x] + 1.5x - 3 within the interval from x=0 to x=2π, the bisection method is being utilized. The user seeks to divide the graph into specific intervals, such as from x=1.0 to x=2.0, to apply the method effectively. A suggestion was made to implement a loop in Mathematica to automate the process of applying the bisection method across these intervals. The proposed code snippet iterates through a range of high values, allowing for the definition of low endpoints for each interval, which can then be used in the bisection code. Further clarification on the specific requirements or adjustments to the code may be needed for optimal implementation.
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
1
Views
2K
Replies
4
Views
2K
Replies
12
Views
4K
Replies
6
Views
4K
Replies
2
Views
5K
Replies
3
Views
1K
Replies
4
Views
3K
Back
Top