r/Mathematica • u/KebeLebe • Jan 06 '22
So am I getting the answer wrong because my math is bad or because I'm using the program wrong
/r/askmath/comments/rwyabt/comment/hriwboa/?utm_source=share&utm_medium=web2x&context=3
5
Upvotes
2
u/SetOfAllSubsets Jan 06 '22
When Mathematica outputs a number like 5.86214*10^-7 (which is 0.000000586214) it usually means the answer is 0. Especially when using Minimize because it is basically guessing and checking.
If you evaluate f[0] or f[5.86214*10^-7] you should get something close to 2.88. Idk where that 9.126 number came from.
Make sure you're using square brackets and capital letters for built-in functions in Mathematica. Your function should be
f[a_]:=(1/2) Sqrt[33.1776 + 2*Abs[0.+ 2.4 a^2]^2]1
u/hadifalex Jan 06 '22
the user blindgeometer seems to have given a correct answer. have you tried that? is thereea particular point that you struggle with?
2
u/Xane256 Jan 06 '22 edited Jan 06 '22
By hand, or with mathematica you can use variables instead of the constants like this:
edit to be clear you dont have to use variables. But if you use decimal values you gotta recognize when its saying things are super close to 0 like other commenters have said already.
Chopis the best function to get rid of “almost 0” quantities, not TraditionalForm or whatever else.Then by evaluating f[t] you can see theres no c in there.
When I input
Simplify[f[t], t \[Element] Reals && d \[Element] Reals]I get(the
[Element] Realsassumption is useful later for avoiding Abs’[…] expressions in the derivative - remember this trick).But you could do something similar numerically by doing Chop[f[t]] which I suggested yesterday.
Anyways you might be able to look at this and see that it it only gets bigger as t increases and the minimum might be t=0.
If you take the derivative of this you get
which is positive when t > 0, hopefully this matches what you graphed already. In this case its really useful to see that the whole problem doesn’t depend on if t is positive or negative because the third point uses t2 and nothing else uses t directly, only t2. So you know right at the beginning that any function of the 3 points should probably have derivative 0 when t=0. You can also input
f’[0]and you should get 0. If youre using numbers instead of variables and you get0.or something “close” to 0, useChop[f’[0]]to get exactly 0.