Reputation
Next tag badge:
91/100 score
18/20 answers
Badges
1 41 104
Impact
~309k people reached

Apr
13
comment Writing a circular matrix
+1 just for the coloring part :)
Apr
13
comment How can I perform this integration in Mathematica?
@Dimitrios I updated answer
Apr
13
comment Time series package in mathematica 9
If you mean this time series, then it is third part app, that you need to buy. So it is separate. I did not know about a time series package. Do you have a link?
Apr
12
comment Problems solving/plotting a differential equation
It's just the good ol' mass-spring-damper system. Well, it is a special spring you have and not the good old one. You have non-linear spring, so this makes it hard to find closed form solution. Are you saying Mathematica solved this analytically before?
Apr
12
comment How to map over inner keys of nested Associations?
Your code has syntax errors
Apr
12
comment How to switch from array to string?
Nice. Btw, this does not give the same form the OP wanted due the "," being there between the numbers. May be just need small modification?
Apr
12
comment Function in Mathematica 10.1, but not in CDF Player 10.0.2
But I have been using a function of that name for many years That is one of the reason why one should not define user level functions that starts with UpperCase !
Apr
12
comment Create an array with certain conditions and use it to fill a matrix
Are we talking about this part: (2*math.pi*k*sigma/L)*(2*math.pi*k*sigma/L) ? Is this not the same as (2*math.pi*k*sigma/L)^2? This is what I mean. As for the table command index, yes, I see you have it going to int(n/2+1) and I used n so you just need to change the index. to one that corresponds to rounding n/2 and adding 1 to it. See help on Round, Ceiling, Floor etc..
Apr
12
comment Create an array with certain conditions and use it to fill a matrix
You should not be translating code as is from Python to M. You should try to translate the algorithm itself if possible. Many operations in M can be done with one or 2 lines, instead of using For and so on. M is functional programming language, while Python is procedural build in an OO framework (like Java is).
Apr
12
comment Animator not always working under 10.0/1
I think there was such an error, I saw it on one or 2 of my demos. But now it is gone, at least I tried your code in 10.1 and it works with no problem on my windows 7. But the error message you show, I've seen before and even reported it. I had no idea why it came from. Code used to work ok before 10, and then on some demos I saw the above message.
Apr
12
comment Create an array with certain conditions and use it to fill a matrix
You mean you want to translate power_spectrum_k = np.zeros(n, float) to Mathematica? I would use Table command, as in Table[0,{n}], for the whole thing, may be n=10; Table[Exp[-(2 Pi k w/L0)^2], {n}] ps. why not use ^2 instead of writing the same expression 2 times?
Apr
12
comment Calculating functions of sounds
@belisarius thanks for the link. I had no idea human can make sound with such low frequency.
Apr
11
comment How to make a 3D plot of $(x^2+y^2-1)^2+(y^2+z^2-1)^2+(x^2+z^2-1)^2=0$
@UnitedKingdom I updated the answer for your comment reply
Apr
10
comment Why does a comma insert a line break in a comment?
yes, turning off line breaking, will make big mess of the code formatting? is it like writing in a code cell basically, instead of input cell. I think. Never tried it. But the second option you show is not really practical. Having to keep pressing ESCnbsESC each time one wants to make a , or ;. These are comments, and they should just be written freely and as is. This problem should be fixed at the source by WRI.
Apr
10
comment Fix my code to return a table of values
how did you figure how to call it with no example given? very good. But I see no DO LOOP in your answer like the teacher code? ;)
Apr
10
comment Fix my code to return a table of values
A call example to the function defined is needed
Apr
9
comment Plot roots of polynomial system of equations in 3 variables
@user27616 I am not following you exactly, but there are lots of Contour related functions in Mathematica, and also options to control what they show and how. If you have problem or question with specific implementation or how to use it, it would be better to post that as separate question.
Apr
9
comment Plot roots of polynomial system of equations in 3 variables
@user27616 here is screen shot from my notebook !Mathematica graphics make sure you type your equations as shown in the screen shot and above, not like you had them
Apr
9
comment How to get the modulus of following complex number
@Ben, the help reference.wolfram.com/language/ref/ComplexExpand.html really explains it well. Basically, if you type Abs[x + I y], then M can't do Sqrt[(x^2+y^2)] since x and y themselves can be complex numbers, each with real and imaginary parts. If that was the case, then x^2 will contains a complex value in it. So someone came up with a function to tell M to assume all symbols are real.
Apr
8
comment Result about Context is inconsistent with the description of “Power Programming with Mathematica”
I remembered now, this was asked before I posted an answer now, but deleted it. Will make community answer instead, just for documentation