# Regarding units of output value

Posted 7 months ago
937 Views
|
9 Replies
|
3 Total Likes
|
 Hi All, I am using the following command, to find maximum of a function: FindMaximum[Cos[phi Degree] (1 - 0.4 Sin[5 Degree + phi Degree]^2), phi] And getting the following Out put: {0.998309, {phi -> -2.22083}} I know Mathematica by default use the values of an angle in Radians, therefore, I used the Degree with angles in INPUT.Now, I am not sure about the value of output given in Mathematica. Whether its' phi=-2.22083 Degree OR -2.22083 Radians? Answer
9 Replies
Sort By:
Posted 7 months ago
 Regarding units of output value Answer
Posted 7 months ago
 I’d expect the output to be in radians. All the Degree multiplier does is convert the specified value form degrees to radians. Try typing Degree//N to get its numeric value. If you want to retain the units in the output, you could try wrapping the angular variables, x, in Quantity[x,”AngularDegrees”] - tip, you can generate a nicely formatted version of this Quantity expression by typing ctrl= followed by “x Angular Degrees”. This might return a Quantity result (in this case either radians or angular degrees). I’m not sure whether it would have the desired outcome, but might be worth a go to see what you get. Answer
Posted 7 months ago
 Thanks for the reply. Can you elaborate : "you could try wrapping the angular variables, x, in Quantity[x,”AngularDegrees”] "Do you mean I use the command FindMaximum[Cos[phi] (1 - 0.4 Sin[5 Degree + phi]^2), phi "AngularDegrees"] Answer
Posted 7 months ago
 Sorry, haven't been near my computer for a while. Having checked, I don't think my suggestion works, I wasn't sure that it would - see attached notebook. But the value of phi in your output is definitely in radians. Attachments: Answer
Posted 7 months ago
 Thank you for this very nice demonstration. I realised that, in my original function, some of the quantities are in Radians and some are in Degree. Therefore, my results were not consistent.Thanks for your time. Answer
Posted 7 months ago
 The result is in terms of degrees. Plot the input expression with phi ranging from -90 to 90 and you will see this. Answer
Posted 7 months ago
 Yes, you're quite right. My mistake. Answer
Posted 7 months ago
 Yes, you're quite right. My mistake. Answer
Posted 7 months ago
 Regarding units of output value Answer