Preference of outputting sine function

1 view (last 30 days)
Ahmad Madkhanah
Ahmad Madkhanah on 25 Dec 2020
Commented: Ahmad Madkhanah on 25 Dec 2020
Hello, can anybody help me with this:
sympref('FloatingPointOutput',true);
syms theta
F=2*sind(2*theta)
--------------------------
F =
2*sin(0.0349*theta)
--------------------------
I want the sine function to be sine in degrees in the output, I don't want the program to automatically convert it to radians.. Can anyone help ?
Thanks !!
  5 Comments
Ahmad Madkhanah
Ahmad Madkhanah on 25 Dec 2020
No, I just don't wanna have to multiply every theta with 180/pi
Assume I have this:
sympref('FloatingPointOutput',true);
syms w
syms m
syms r
syms L
syms theta
alpha=input('Enter the angle alpha: ');
F1=m*r*w^2*(cosd(theta+alpha)+r/L*cosd(2*theta+2*alpha));
F1=simplify(F1,'Steps',10);
disp(F1)
---------------------------
Enter the angle alpha: 45
m*r*w^2*(cos(0.0175*theta + 0.7854) + (r*cos(0.0349*theta + 1.5708))/L)
---------------------------
I should get an answer like this: F1=m*r*w^2*(0.707*(cosd(theta) - sind(theta)) - r/L*sind(2*theta))
How can I get the to the closest form of this answer ?
the case might require a theta input too, how could I get an expression that is valid for these cases too ?
Ahmad Madkhanah
Ahmad Madkhanah on 25 Dec 2020
The answer is for machine dynamics class, so also yes, the form of the answer matters a bit..

Sign in to comment.

Answers (0)

Tags

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!