Reputation
30,315
Next tag badge:
90/100 score
18/20 answers
Badges
1 41 103
Impact
~293k people reached

May
14
comment $\mathbf L\mathbf D\mathbf L^\top$ Cholesky decomposition
Here is the LAPACK Fortran implemenation using what is called Bunch-Kaufman diagonal pivoting method for LDL^T factorization for real symmetric (not necessarily positive definite) matrix. I think Mathematica should have an LDL special decomposition. Matlab has one here.
May
14
comment Internal coupling of Fortran and Mathematica codes
If the Fortran program is a stand alone, you can generate the output from your Mathematica script and export the output to a text file, then at the end of the script use the RunProcess command to invoke the Fortran executable, but change the Fortran program to read its input from the text file generated by the Mathematica script. Make sure they reside in the same directory to make it easier to locate the file used to communicate between them. direct Fortran function calling would need using mathlink and is more complicated.
Apr
13
comment Drawing nodal lines of wave equation
@Pickett it is not an answer, that is why it is a wiki.
Apr
13
comment string and subscript in label
fyi, I am not sure that using tab "\t" is recommend for spacing, as it might generate different space amount depending on the platform or some other system configuration. I think Spacer[n] is supposed to generate the exact space on all systems. (mac, linux, windows)
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