How does one solve these numerically?

  • Thread starter goonking
  • Start date
In summary: There are various methods of "controlled search" which can help you find a solution to a problem faster.
  • #1
goonking
434
3

Homework Statement


These are textbook solutions to sample problems, how would one solve these numerically (they are two different problems)?
1)
upload_2016-3-5_20-16-47.png
and
2)
upload_2016-3-5_20-18-41.png


Homework Equations

The Attempt at a Solution

 
Physics news on Phys.org
  • #2
goonking said:

Homework Statement


These are textbook solutions to sample problems, how would one solve these numerically (they are two different problems)?
1)
View attachment 96911and
2)
View attachment 96912

Homework Equations

The Attempt at a Solution

There aren't any obvious trig identities which apply to either problem, so one is left with either making a plot of each function versus the angle θ and finding an approximate solution, or choosing different values of θ and inserting these into each equation and seeing if a solution is obtained in that manner.
 
  • #3
SteamKing said:
There aren't any obvious trig identities which apply to either problem, so one is left with either making a plot of each function versus the angle θ and finding an approximate solution, or choosing different values of θ and inserting these into each equation and seeing if a solution is obtained in that manner.
so it is just a long process of trial and error?
 
  • #4
goonking said:
so it is just a long process of trial and error?
Pretty much. It's one of the reasons computers were invented, because a lot of problems can be solved only by trial and error, and computers can be programmed to do this until a numerical solution is obtained within a specified tolerance.
 
  • #5
That is what "solve numerically" means.
Ideally you want to be systematic about your trial and error, so you use the result of the last guess to make the next guess better - what have you tried?
 
  • #6
Simon Bridge said:
That is what "solve numerically" means.
Ideally you want to be systematic about your trial and error, so you use the result of the last guess to make the next guess better - what have you tried?
basically what you said, I just start from a degree and go around in intervals of 15 or 30 degrees. Just like playing a game of hot or cold I guess.
 
  • #7
You can use a computer plot or a hand sketch to work out good places to start, and what sort of results to expect.
For the second one you'd plot ##y=\sin(\frac{\pi}{180} x)-(0.703)\frac{\pi}{180}x## (because computers work in radians and you want x in degrees).
Your solution is every value of x where the plot crosses the x axis.
The trivial solution at x=0 should be obvious.

A common systematic approach is called "Newton-Raphson" or "Newton's method" ... look it up.
If this is coursework, then there should have been a discussion of how to get numerical solutions already ... though the course may be set up so your first experience is blind so you will appreciate the systems.
 
  • Like
Likes goonking
  • #8
goonking said:
so it is just a long process of trial and error?
Not quite.
You might try the method of iterations. In case of the first problem, you can write the original equation in form tan(θ)=0.75 + sin(θ), and calculate approximations by the procedure tan(θi+1)=0.75 + sin(θi), that is, θi+1 = atan (0.75+sin (θi)). Assuming solution in the first quarter, θ must be greater than 45°, Try the first approximation θ1=50° and get θ2, then get θ3 from θ2 and so on.
You can apply a similar procedure for the second problem but you have to calculate the angle in rad.
 
  • Like
Likes goonking
  • #9
Not sure that it helps much, but writing ##t=\tan(\theta/2)## you can convert (1) to the quartic ##t^4+\frac {16}3t^3=1##. At least it might be more obvious how to iterate that to converge quickly.
 
  • Like
Likes goonking
  • #10
goonking said:
so it is just a long process of trial and error?

No, not really. Various methods of "controlled search" are available. For more information, use the following terms as search keywords: bisecting search, secant method, regula falsi, Newton's method, etc.
 
  • Like
Likes Chestermiller and goonking
  • #11
tan θ - sin θ = 0.75
For general iteration, rearrange this in as many ways as needed into the form: θ = f(θ)

There are two obvious ways to isolate a θ from the above equation, but in general you may need to look for more (sometimes deviously) before finding arrangements that converge to all the solutions you are looking for.

e.g., your equation is equivalently
sinθ / cosθ - sinθ = 0.75

sinθ (1/cosθ - 1) = 0.75

isolating the red θ leads to a third rearrangement.

Starting with an initial guess of 70° this latter arrangement shows an oscillatory convergence to the solution, whereas the earlier arrangement converged monotonically.

In the absence of a fancy calculator, to see the convergence step-by-step you can code the calculation into one cell of a spreadsheet, so that every time you click on "recalculate" it calculates the next iteration.
 

1. How do you solve a numerical problem?

Solving a numerical problem involves using mathematical algorithms and techniques to find a solution. This often includes breaking the problem down into smaller steps and using equations or computational methods to find the answer.

2. What is the difference between analytical and numerical solutions?

An analytical solution involves finding a precise, exact solution using mathematical equations and formulas. A numerical solution, on the other hand, involves using approximate methods and calculations to find a solution that is close to the exact answer.

3. What is the role of computers in numerical problem solving?

Computers play a crucial role in numerical problem solving by performing complex calculations and executing algorithms quickly and accurately. They can also store and manipulate large amounts of data, making it easier to solve more complex problems.

4. How do you choose the appropriate numerical method for a problem?

The appropriate numerical method depends on the type of problem and the level of accuracy required. Some common methods include the bisection method, Newton's method, and the secant method. It is important to understand the problem and its constraints in order to select the most suitable method.

5. Can numerical solutions be used for all types of problems?

No, numerical solutions may not be suitable for all types of problems. Some problems may have analytical solutions that are more accurate and efficient to solve. Additionally, numerical solutions may be limited by the precision of the computer or the complexity of the problem.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
10
Views
602
  • Precalculus Mathematics Homework Help
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
16
Views
500
  • Precalculus Mathematics Homework Help
Replies
10
Views
936
  • Precalculus Mathematics Homework Help
Replies
2
Views
771
  • Precalculus Mathematics Homework Help
Replies
3
Views
776
  • Precalculus Mathematics Homework Help
Replies
16
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
886
  • Precalculus Mathematics Homework Help
Replies
2
Views
978
  • Precalculus Mathematics Homework Help
Replies
16
Views
2K
Back
Top