Reputation
31,641
Next tag badge:
99/100 score
35/20 answers
Badges
1 42 106
Newest
 Enlightened
Impact
~320k people reached

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
Apr
8
comment How to send OUT output to stdout when running a script from command line on widows?
@bobthechemist ok, I see now what the problem was. Using -script "foo.m" was confusing things. I thought one should use -script. It looks from above that just simple "< foo.m" with the AppendTo[$Echo, "stdout"] will solve all the problems. Strange the docs do not show such simple examples for users. Very hard to find such info in documentation.
Apr
7
comment String-manipulation bugs in v10.1
I also get same error , today 4/7/15, screen shot !Mathematica graphics
Apr
7
comment Animation of a geometric transformation
Could you please tell me what you get? the screen shot I pasted in the comment shows what I get. Clicking on it shows the output. I just copied and pasted your input, and the Plot I get, as you can see, is not the same as what you have. Windows 7, 64 bit, V 10.1
Apr
7
comment DSolve response with DSolve
Have you looked at the ODE themselves before passing them to DSolve? You can do this by splitting the cells, and evaluate the equations first to get an idea what is in them. Like this: !Mathematica graphics now one can see that the equations contain other derivatives of other dependent variables c2'[t],c4'[t],phi1'[t],phi3'[t],phi3'[t],phi4'[t]
Apr
7
comment Animation of a geometric transformation
fyi, the screen shot you show above (first one), is not what I get when I run your code under V10.1 !Mathematica graphics
Apr
7
comment What's the meaning of <<19>> in the result
this happens when you have large (long) output, and M shortens it. It is like etc....
Apr
6
comment NDSolve solving problem
You have second order ODE, but you only gave one IC. For numerical solver, it needs more one. (ps. the title of your question suggest it is a plotting problem, but there is no plotting issue here) (ps. actually the error message you get says the reason for the error :)
Apr
6
comment Solve ODE in State-space form
I do not know why the numerical gives these warnings, but your solutions are zero according to DSolve: w = 2; T = 2 Pi/w; a = 0.4; b = 4.0; d = 0.3; x[t_] := {x1[t], x2[t]} A0 = T {{0, 1}, {-a - b Cos[2 t], -d}}; sol = DSolve[{x'[t] == A0.x[t], x[0] == x'[0] == 0}, x[t], t] which gives {{x1[t] -> 0, x2[t] -> 0}} on V 10.1
Apr
6
comment How to stop Mathematica from turning .02 into 0.019999999999999997`
are you saying the correct valuate should be 0.02 exactly and M is not doing so? Could you post the source code to reproduce? hard to see the image, too small and need magnifying glasses to see.
Apr
5
comment Is association in mathematica ordered or not?
I have not used association much, but for me, it makes little sense to talk about "order" of keys. The point is that one gives a key, and gets the value associated with that key by a lookup. Like a hash table. If you depend on an "order" of keys in the lookup table to do something, then I think you are doing something wrong.