Set degrees as default in Mathematica 8 - wolfram-mathematica

Is it possible to set the trigonometric functions to use degrees instead of radians?

Short answer
No, this is not possible. I'd suggest to define alternative functions, and work with those: sinDeg[d_] := Sin[d Degree]. Or just use Degree explicitly: Sin[30 Degree]. (Try also entering ESC deg ESC.)
Longer answer
You can Unprotect the functions, and re-define them using the Gayley-Villegas trick, but this is very likely to break several things in Mathematica, as I expect it is using these functions internally.
Since this is such a nasty thing to do, I'm not going to give a code example, instead I'll leave it to you to figure out based on my link above. :-)

I think the output is based on the input. So for example Cos[60 Degree] will output in degrees.

Related

How to represent one variable in terms of others in an equation set in Mathematicas?

I have an pretty complex equation set enter image description here
I want to solve Vo in terms of Vin.
But when I clicked Ctrl+Enter (a.k.a Evaluate Cell), nothing happened.
How to fix it? Thanks for your help
Simplify[Reduce[eqn, Vo]]
works.
If you can include any assumptions (as a second argument to Simplify or by giving those along with your equations to Reduce) that you have about some variables not being zero then the result might be simpler. In any case, you look through each of the terms returned from Simplify to try to find the case that matches your real world problem.

Mathematica- Assumptions within Simplify[]

I am using the ratio between two error probabilities in various functions. I want Mathematica to display this ratio in the most simple manner. How do I let Mathematica know that, in this case, the simplest manner is as the top line in the picture below?
(1-e1)/(1-e2) // TraditionalForm
Be aware this is strictly for output formatting, so for example if you do
x=TraditionalForm[(1-e1)/(1-e2)] ! prints nice
x === (1-e1)/(1-e2) -> False
That said, as a general principle you'll get much more done if you quit loosing sleep over mathematica's sometimes unusual formatting..

Pascal : What's the difference between random(); and random;

Whether I use random or random(), I 'seem' to get the same results. Now, coming from a Python background, using random() seems more natural and convenient to me, but I've seen random being used plenty a times.
Neither statements produce a hint or a warning using FPC's appropriate flags.
So, is there a difference, and if yes, what is it?
There's no difference. Pascal doesn't require the parentheses when calling functions without parameters. You can use them to make your code more clear when reading it, but they're entirely optional.
since i have seen a bit of scala code ,so here i am guessing.
There is a no difference between random and random(),If function takes no parameters,
you can omit parenthesis in the code.

how to set round-off precision in mathematica

I want to illustrate the stability of some numerical algorithms. I want to use Mathematica to round floating point numbers according to the usual rule, for example:
myRound[3/80.]=0.038 if I specify the precision to be 2-digit.
Another one
myRound[89/47.]=1.89
So given a precision number, how to write the myRound function? Please help. Many thanks.
You should look into NumberForm. For example:
NumberForm[89.0/47.0, 3]
Returns 1.89.
Acutally, it occurs to me that if you really want to illustrate round off issues, you should look into the ComputerArithmetic package. It's well documented, so I'll leave it at that.
I am not sure is this is what you would like:
In[34]:= customRound[x_Real] :=
Round[x, 10^Round[RealExponent[x]]*0.01]
In[35]:= customRound[3/80.]
Out[35]= 0.038
In[36]:= customRound[89/47.]
The function actually changes the number, as opposed to merely changing the way it is displayed.

Correct use of Simplify in Mathematica (with multiphase trig)

I just started working with Mathematica (5.0) for the first time, and while the manual has been helpful, I'm not entirely sure my technique has been correct using (Full)Simplify. I am using the program to check my work on a derived transform to change between reference frames, which consisted of multiplying a trio of relatively large square matrices.
A colleague and I each did the work by hand, separately, to make sure there were no mistakes. We hoped to get a third check from the program, which seemed that it would be simple enough to ask. The hand calculations took some time due to matrix size, but we came to the same conclusions. The fact that we had the same answer made me skeptical when the program produced different results.
I've checked and double checked my inputs.
I am definitely . (dot-multiplying) the matrices for correct multiplication.
FullSimplify made no difference.
Neither have combinations with TrigReduce / expanding algebraically before simplifying.
I've taken indices from the final matrix and tryed to simplify them while isolated, to no avail, so the problem isn't due to the use of matrices.
I've also tried to multiply the first two matrices, simplify, and then multiply that with the third matrix; however, this produced the same results as before.
I thought Simplify automatically crossed into all levels of Heads, so I didn't need to worry about mapping, but even where zeros would be expected as outputs in the matrix, there are terms, and where we would expect terms, there are close answers, plus a host of sin and cosine terms that do not reduce.
Does anyone frequent any type of technique with Simplify to get more preferable results, in contrast to solely using Simplify?
If there are assumptions on parameter ranges you will want to feed them to Simplify. The following simple examples will indicate why this might be useful.
In[218]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2]]
Out[218]= a Sqrt[1 - x^2] - Sqrt[-a^2 (-1 + x^2)]
In[219]:= Simplify[a*Sqrt[1 - x^2] - Sqrt[a^2 - a^2*x^2],
Assumptions -> a > 0]
Out[219]= 0
Assuming this and other responses miss the mark, if you could provide an example that in some way shows the possibly bad behavior, that would be very helpful. Disguise it howsoever necessary in order to hide proprietary features: bleach out watermarks, file down registration numbers, maybe dress it in a moustache.
Daniel Lichtblau
Wolfram Research
As you didn't give much details to chew on I can only give you a few tips:
Mma5 is pretty old. The current version is 8. If you have access to someone with 8 you might ask him to try it to see whether that makes a difference. You could also try WolframAlpha online (http://www.wolframalpha.com/), which also understands some (all?) Mma syntax.
Have you tried comparing your own and Mma's result numerically? Generate a Table of differences for various parameter values or use Plot. If the differences are negligable (use Chop to cut off small residuals) the results are probably equivalent.
Cheers -- Sjoerd

Resources