I see now… :)
Well, that doesn't solve my problem: I now have a function of this angle (I use this ArcTan[] to calculate an angle, obviously) which is discontinuous at one point… I'll have to make a specific test to avoid this very point.
Thanks :)
Result : 0
Alternative form : -1.5708
:confused:
WTF ?! This is clearly broken, no ? :biggrin:
Edit: Haha :biggrin:
Compare http://www.wolframalpha.com/input/?i=ArcTan%5B1.%2B0+I%2C+0.%5D and http://www.wolframalpha.com/input/?i=ArcTan%5B1.%2B0.+I%2C+0.%5D
Difference is subtle…
Like I said : http://reference.wolfram.com/mathematica/ref/ArcTan.html
Click the “More Information” and have a look at the last bullet :)
ArcTan[x,y] is simply ArcTan[y/x]. If x or y are complex, y/x is a complex number… No problem here.
The help page of ArcTan[x,y] indicates that it can handle complex arguments. It then uses the expression which involves the Log[] I gave.
Problem is: my quantities x and y are not complex according to the tests I make… Which is strange because I thought that the number 0.` is different from 0...
Hello all,
I'll try to make myself clear... My goal here is to plot a function f(x,y) in 3D. But, instead of using the Plot3D[] function, I made a table of Plot[] for, say, several values of the x variable.
So I'm now with a list which looks like this ...
Thank you for your answer, I'll try that.
And thanks for your warnings : I better define my own square root function and leave the built-in one untouched :)
Hello all :)
I would like to redefine the built-in square root function.
I have written this :
mySqrt[z_]:=√z;
Unprotect[Sqrt];
Sqrt[z_]:=If[Re[mySqrt[z]]+Im[mySqrt[z]]>0,mySqrt[z],-mySqrt[z]];
Protect[Sqrt]
This works fine and redefine Sqrt[] as I want it to be. But, the symbol √ (by typing...
OK, thanks :)
Well, at least for my purpose, using the f[x_]:=body notation solves the issue…
@Simon_Tyler: I can reproduce this issue both in 7.0.1 and 8 on a Mac.
I think the bottom line is that there must be a difference between defining a function using the notation f=Function[x,body] and the notation f[x_]=body. But I don't know, I thought those two notations were equivalent...
Hello all,
There's something I don't understand when using Return[]…
Take this input :
f := Function[{x}, (If[x > 5, Return[a]]; x + 3)];
g[x_] := (If[x > 5, Return[a]]; x + 3);
and this output :
In[25]:= f[6]
g[6]
Out[25]= Return[a]
Out[26]= a
In one case, it returns...
Indeed there is a closed form for numbers (1x1 matrices) which necessarily commute. I'm wondering if that can be somehow generalized for non commuting matrices quantities.
I know that if a closed form exists, it will indeed involve the dilogarithm of a matrix :biggrin: I'll think of what this...
True. So let me be more specific because, in my case, how my matrices depend on x is known :smile:
In reality I have a product of 4 matrices :
R1.Exp[-k x].R2.Exp[-k x]
Let me explain each terms :
• R1 and R2 do not depend on x but are not symmetric (hence the no commutation in all those...
Hello all :)
I have two square matrices whose elements are functions of a variable x, let's call them A(x) and B(x).
Those two matrices do not commute : A(x).B(x)≠B(x).A(x)
I then define the quantity Log det(1-A(x).B(x)) where 1 is the identity matrix.
I'm interested in a closed form for...