Solve Theta: v^2/r=U*g*cos(theta)-g*sin(theta)

  • MATLAB
  • Thread starter hani92
  • Start date
  • Tags
    Matlab
In summary, MATLAB is not able to find a real number that solves your equation for theta. You may need to learn more about complex numbers and trig functions to solve this equation.
  • #1
hani92
3
0
i am trying to type in a function to find theta, but MATLAB keeps saying (The expression to the left of the equals sign is not a valid target for an assignment.) or (is not a valid expression or
equation.) the equation I'm trying to compute to get theta is :
v^2/r=U*g*cos(theta)-g*sin(theta)

v=1.8 ; r=0.3 ; U=0.2 ; g=9.81
i am trying to find theta
i would really appreciate the help
 
Physics news on Phys.org
  • #3
it seems like it worked the way u said, but i had to add the syms command before for MATLAB to know what i am trying to get. when i call the function it seems like it worked it doesn't return any errors, but it doesn't give me an answer. any ideas that can help?
 
  • #4
I only gave you a pointer to the use of solve and hoped that might be enough for you to use that web page to see what you needed to do.

If I do not use your constants for the coefficients I find four solutions-arccos((g*r*U^2*v^2-sqrt(g^2*r^2*U^2*(g^2*r^2*(1+U^2)-v^4)))/(g^2*r^2*(U+U^3))),
-arccos((g*r*U^2*v^2+sqrt(g^2*r^2*U^2*(g^2*r^2*(1+U^2)-v^4)))/(g^2*r^2*(U+U^3))),
arccos((g*r*U^2*v^2-sqrt(g^2*r^2*U^2*(g^2*r^2*(1+U^2)-v^4)))/(g^2*r^2*(U+U^3))),
arccos((g*r*U^2*v^2+sqrt(g^2*r^2*U^2*(g^2*r^2*(1+U^2)-v^4)))/(g^2*r^2*(U+U^3)))

But when you are dealing with things like sin and cos you always have to think about whether each of these is a correct solution, depending on the values of your coefficients and whether there are more solutions.

If I plug in your coefficients then I find

-1.37340 - 0.396247*i
-1.37340 + 0.396247*i

with all the same concerns about checking this and other possible solutions.

See if you can use the help system and Google searches to learn how you can do this and will be able to use that in the future.
 
  • #5
so what does the i variable represent?
 
  • #6
http://www.mathworks.com/help/techdoc/ref/i.html

That means that I did not find a real number for theta that solved your equation with the coefficients that you have, unless I made a mistake.

You can also plot U*g*cos(theta)-g*sin(theta) for -2*pi<theta<2*pi and see if it ever reaches a value of v^2/r for real values of theta. I don't think it does.

You may have not yet learned about complex numbers and you may not have learned about trig functions using complex numbers. If not then there are always new things to learn in mathematics. If you are not going to be using complex numbers for this problem, and that is certainly possible, then that plot may be the simplest way to really see if there are solutions or not or perhaps if there might be an error in one of the numbers you have.
 
Last edited:
  • #7
You can to this algebraically:
Your left hand side is of the form:
[tex]
a\sin\theta +b\cos\theta
[/tex]
This can be written in the form:
[tex]
a\sin\theta +b\cos\theta =R\sin (\theta +\alpha )
[/tex]
For some [itex]R[/itex] and [itex]\alpha[/itex], so expand the RHS of the above equation and compare the coefficients of [itex]\sin\theta[/itex] and [itex]\cos\theta[/itex] to obtain:
[tex]
R\sin (\theta +\alpha )=R\sin\theta\cos\alpha +R\cos\theta\sin\alpha
[/tex]
So [itex]a=R\cos\alpha[/itex] and [itex]b=R\sin\alpha[/itex] and so we can see that:
[tex]
R=\sqrt{a^{2}+b^{2}},\quad \tan\alpha =\frac{b}{a}
[/tex]
So now you can compute [itex]\theta[/itex] with ease and you don't have to use MATLAB to solve equations for you.
 

Related to Solve Theta: v^2/r=U*g*cos(theta)-g*sin(theta)

What is the equation for solving theta in this problem?

The equation is v^2/r=U*g*cos(theta)-g*sin(theta).

What do the variables in this equation represent?

v is the velocity of the object, r is the radius of the circle the object is moving in, U is the coefficient of friction, g is the acceleration due to gravity, and theta is the angle of the incline.

How do I solve for theta?

To solve for theta, you can use algebraic manipulation to isolate the variable. This may involve using trigonometric identities and simplifying the equation.

What are some common mistakes made when solving this equation?

Some common mistakes include forgetting to account for the negative sign in front of the g*sin(theta) term, forgetting to convert units to be consistent (e.g. using meters instead of centimeters), and not simplifying the equation enough before solving for theta.

Can this equation be used for any type of motion?

No, this equation is specifically for motion in a circular path with friction present. It cannot be used for other types of motion, such as linear motion or motion on a curved surface without friction.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
662
  • Calculus and Beyond Homework Help
Replies
6
Views
438
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Introductory Physics Homework Help
2
Replies
38
Views
603
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
Back
Top