[math-fun] Mathematica help sought
I've used Mma on a very elementary basis for years, but often when I try to do the least thing beyond what I'm familiar with, it hangs or gets confused, etc. Case in point: Let f(u,v) = sqrt(5+4cos(u)) + 2.5*sin((u-v)/2) + sqrt(11-6cos(v)-2sin(v)). I wanted it to find the critical points, so I tried: Solve[{D[f[u,v],u] == 0, D[f[u,v],v] == 0}, {u,v}] and it seemed to have no idea what I was talking about. So I figured the partials by hand and confirmed them with Mma, and just used them directly instead of Df[u,v],u], etc. This time Mma canceled the calculation after 10-20 minutes, saying its memory had been used up. (Now I'm trying to get it to at least NSolve for the critical points.) But is there any way to get the original symbolic equation to come up with something useful, or does this just indicate the limits of symbolic computation? Thanks, Dan Sometimes the brain has a mind of its own.
Dan, the Solve routine is meant for nice algebraic functions of not too high degree. You needed the numeric findRoot. I can't speak for Mma versions higher than 4.1 But even FindRoot has a hard time with trigonometric functions, that have zero's all over the place. Your problem isn't a 'simple' one! Analytically speaking. W. ----- Original Message ----- From: "Dan Asimov" <dasimov@earthlink.net> To: "math-fun" <math-fun@mailman.xmission.com> Sent: Friday, May 13, 2011 9:05 PM Subject: [math-fun] Mathematica help sought
I've used Mma on a very elementary basis for years, but often when I try to do the least thing beyond what I'm familiar with, it hangs or gets confused, etc.
Case in point: Let
f(u,v) = sqrt(5+4cos(u)) + 2.5*sin((u-v)/2) + sqrt(11-6cos(v)-2sin(v)).
I wanted it to find the critical points, so I tried:
Solve[{D[f[u,v],u] == 0, D[f[u,v],v] == 0}, {u,v}]
and it seemed to have no idea what I was talking about.
So I figured the partials by hand and confirmed them with Mma, and just used them directly instead of Df[u,v],u], etc.
This time Mma canceled the calculation after 10-20 minutes, saying its memory had been used up.
(Now I'm trying to get it to at least NSolve for the critical points.)
But is there any way to get the original symbolic equation to come up with something useful, or does this just indicate the limits of symbolic computation?
Thanks,
Dan
Sometimes the brain has a mind of its own.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
__________ NOD32 6120 (20110513) Informatie __________
Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem. http://www.nod32.nl
You can usually lose all the trig functions with cos u -> (1 - u^2)/(1 + u^2), sin u -> 2 u / (1 + u^2), and similar for v. The new u has range [-1,1], assuming the original u was real. This is the ancient tan(u/2) -> u substitution. In your case, you also want sin((u-v)/2) to be a rational function, so u & v should be halved: cos(u/2) -> (1-u^2)/(1+u^2) etc. cos(u) -> (1 - 6 u^2 + u^4)/(1+u^2)^2 sin(u) -> (4 u - 4 u^3)/(1+u^2)^2 sin((u-v)/2) = sin(u/2 - v/2) = sin(u/2) cos(v/2) - sin(v/2) cos(u/2) -> [ 2u(1-v^2) - 2v(1-u^2) ] / [(1+u^2)(1+v^2)] The sqrts will still mess up the derivatives. If you are looking for critical points, you can multiply through by (1+u^2)(1+v^2) before differentiating to simplify things a little. Rich -------- Quoting Marc LeBrun <mlb@well.com>:
="Dan Asimov" <dasimov@earthlink.net> f(u,v) = sqrt(5+4cos(u)) + 2.5*sin((u-v)/2) + sqrt(11-6cos(v)-2sin(v)).
Also, computer or not, it might helpful to get rid of the trig here by first substituting s:=sin u, t:=sin v (or something similar) leaving mere algebra.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
You can usually lose all the trig functions with
cos u -> (1 - u^2)/(1 + u^2), sin u -> 2 u / (1 + u^2),
and similar for v. The new u has range [-1,1], assuming the original u was real. This is the ancient tan(u/2) -> u substitution.
Yes, I use that whenever I need to show that two trigonometric expressions are equal, as polynomial expressions are much easier to compare. Sincerely, Adam P. Goucher
participants (5)
-
Adam P. Goucher -
Dan Asimov -
Marc LeBrun -
rcs@xmission.com -
wouter meeussen