Repeat the loop for a few intervals

  • Thread starter Thread starter jiayingsim123
  • Start date Start date
  • Tags Tags
    intervals Loop
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
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.