Approximation for Unknown Variable

Click For Summary

Discussion Overview

The discussion revolves around solving for an unknown variable, theta, in a physics-related equation involving projectile motion. Participants explore various methods for finding theta given specific parameters (v, g, h, d) and express interest in more efficient techniques beyond the Bisection method used in the original assignment.

Discussion Character

  • Homework-related
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant describes their approach using the Bisection method and seeks alternative solutions.
  • Another participant questions the values of the variables involved, indicating a need for clarity on inputs.
  • Concerns are raised about a potential units mismatch in the provided equation, suggesting that it may not yield physically meaningful results.
  • A participant critiques the equation's formulation, asserting that it contains errors and mismatched brackets, which could affect the validity of the solution.
  • Suggestions are made for more efficient methods, including the Bisection method and Monte Carlo techniques, to improve the accuracy of solving for theta.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the equation and its formulation. There is no consensus on the validity of the equation or the best method to solve for theta, as some participants challenge the initial formulation while others defend their approach.

Contextual Notes

Participants highlight potential limitations in the equation's formulation and the assumptions made regarding the physical interpretation of the variables. The discussion reflects uncertainty about the accuracy of the methods proposed and the validity of the equation itself.

KingBigness
Messages
94
Reaction score
0

Homework Statement


Firstly sorry if this is in the wrong place. I have never submitted a question on this forum about a comp sci question.

I got an assignment that asked me to solve for a variable using Bisection of successive approximations. This however is not why I am here as I know you do not give answers to assignments.

I have done the assignment properly and submitted it so this is just for general knowledge. I was wondering if anyone could come up with a more efficient solution to this problem using other techniques that I may not have heard of before.


Homework Equations


d = \frac{vcos(\theta)}{g}(vsin(\theta)+\sqrt{v^{2}sin^{2}(\theta)-2gh}

Given v, g, h and d solve for theta.

Thanks for any ideas =D
 
Physics news on Phys.org
What are the values of those 4 variables?
 
NascentOxygen said:
What are the values of those 4 variables?

Inputted by the user.

I forgot to to say that theta will lie in the range

arctan(\frac{v^{2}}{g*d})\le \theta \le 90 degrees
 
KingBigness said:

Homework Statement


Firstly sorry if this is in the wrong place. I have never submitted a question on this forum about a comp sci question.

I got an assignment that asked me to solve for a variable using Bisection of successive approximations. This however is not why I am here as I know you do not give answers to assignments.

I have done the assignment properly and submitted it so this is just for general knowledge. I was wondering if anyone could come up with a more efficient solution to this problem using other techniques that I may not have heard of before.


Homework Equations


d = \frac{vcos(\theta)}{g}(vsin(\theta)+\sqrt{v^{2}sin^{2}(\theta)-2gh}

Given v, g, h and d solve for theta.

Thanks for any ideas =D

Could you please post your solution? We need to see that before we can be of much help.
 
berkeman said:
Could you please post your solution? We need to see that before we can be of much help.

Assumed you meant my code.

http://pastebin.com/X0Ni4ebz
 
KingBigness said:

Homework Equations


d = \frac{vcos(\theta)}{g}(vsin(\theta)+\sqrt{v^{2}sin^{2}(\theta)-2gh}

Given v, g, h and d solve for theta.

There's something fishy with the given equation... given the usual physical interpretation of the variables there is a units mismatch in the expression. Since the trig functions yield unitless results (so we can ignore them for purposes of unit analysis), both "d" and "v2/g" terms yield meters, but the radical term yields m/s.
 
gneill said:
There's something fishy with the given equation... given the usual physical interpretation of the variables there is a units mismatch in the expression. Since the trig functions yield unitless results (so we can ignore them for purposes of unit analysis), both "d" and "v2/g" terms yield meters, but the radical term yields m/s.

The equation was written by a computer scientist and it producing a real world value is beside the point.

The way I wrote my program to solve for theta was start with the lower limit of theta, trial it and see how much it deviated from d and if this deviation was more than 0.0001 then increment theta and try again until the deviation is less than 0.0001.
To me this doesn't seem very accurate in a real world situation (fine here because the answer only needs to be to two decimal places).

That's why I am here to ask you guys if you can think of a better method of solving it eg monte carlo etc.
 
KingBigness said:
The equation was written by a computer scientist and it producing a real world value is beside the point.
On the contrary, if you wish for help here then the onus rests with you to ensure you are not a cavalier waste of other's time.

The equation you provided is wrong. That's indisputable. Even blind Freddie can see it has mismatched brackets. So before you make yourself look a complete goose, go back and fix it to how it should be.

A lesson you should take from this is to learn to better proof-read your own posts.

Thanks to gneill for taking the time to highlight your oversight.
 
KingBigness said:
The equation was written by a computer scientist and it producing a real world value is beside the point.

The way I wrote my program to solve for theta was start with the lower limit of theta, trial it and see how much it deviated from d and if this deviation was more than 0.0001 then increment theta and try again until the deviation is less than 0.0001.
To me this doesn't seem very accurate in a real world situation (fine here because the answer only needs to be to two decimal places).

That's why I am here to ask you guys if you can think of a better method of solving it eg monte carlo etc.

There is a significant hint in the problem statement as you've written it: Bisection.

Do a search on "Bisection method". It'll be a lot more efficient than creeping up on the solution by fixed steps as you're doing.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
32
Views
3K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K