Nasser
Reputation
34,833
95/100 score
 Dec 19 comment Initializing FinancialData indices … never finishes @Karsten7. When I installed 10.3.1 I removed 10.3, so I do not know if it worked or not in 10.3 now. Dec 18 comment Looking for an extensive gallery of Mathematica's 2D graphics I always found Trott Graphics book for Mathematica impressive. (even though I do not understand most of the code there as it is too advanced for me) library.wolfram.com/infocenter/Books/5352 also Graphica 1 if you have it. It has amazing Mathematica Graphics, also by same author. Dec 18 comment NDSolve divide-by-zero trouble @SunilS. I do not know how Maple solved it, but here is the solution it gives. There is no numerical anything. it solved the analytical ode. Not numerical. The plots seems similar to what in the above answer: !Mathematica graphics here is plain text of the solution of the ODE itself. 1+5*n(r)^(12/5)*r^4+(-2*r^4-4*r^3)*n(r)^2 = 0 so it is non-linear in n(r) Dec 18 comment NDSolve divide-by-zero trouble good solution you managed to get it. Maple does actually solve this analytically for same initial condition, and I get the same plot as you show. The solution n(r) it gives is in terms of a complicated non-linear function in n(r) Dec 12 comment Display the list of complex roots returned by Solve in their polar form Dec 12 comment How can I pass arguments to Module without being reinterpreted each time they appear inside it? @SimonWoods yes! I definitely missed that they are different types. This explains the difference in performance. Dec 12 comment Styling polar axes in PolarPlot According to help, I think it should have worked. It might be a bug. I do not know. May be someone else would know better what is going on. Dec 12 comment Styling polar axes in PolarPlot I do not know why it does not work. But Will this work for your? PolarPlot[θ, {θ, 0, 3 π}, BaseStyle -> Red, PolarAxes -> True] Dec 12 comment How can I pass arguments to Module without being reinterpreted each time they appear inside it? @Rorschach first of all, I was not answering, just giving an observation. But there is a difference between lm+mat2 and lm+lm. In one case mat2 is global, while in the second case it is local. There could be difference there in how and/or where each is allocated, or some overhead to access local module level heap. But not knowing internals of Mathematica, this is all speculation. Dec 12 comment How can I combine NIntegrate with NDSolve? is this different than your other question how-can-i-perform-nintegrate-with-ndsolve ? Dec 12 comment How can I pass arguments to Module without being reinterpreted each time they appear inside it? The slow down is due to + using the new allocated matrix lm in Module context. You can see this by changing Module[{lm = mat}, lm + lm] to Module[{lm = 2*mat}, lm ] which is the same thing, but now its speed is similar to the second case where the + with with the global mat. So the slow down happens to due to adding, element by element, lm to lm in the module content. It should not really be this much slower. This is strange. With compiled languages, the compiler will see this and will do this at compile time! Dec 11 comment How can I perform NIntegrate with NDSolve? The solution to your ODE is y(t)=0. Dec 9 comment How to know the string data/settings, of some options/functions @MikeHoneychurch It looks like something that could be re-written for this question though? that might be possible. I do not know now. When finals are over, will see if I can change it to do what is being asked here. Unless someone has a better answer meanwhile. Dec 9 comment How to know the string data/settings, of some options/functions @MikeHoneychurch It was this how-to-extract-a-list-of-available-method-s but it does not work on the above examples. I just tried it. Dec 8 comment About a simple differential equation you are right. I have used $y'(0)=1$ and not $y'(0)=-1$ by mistake when I typed the ODE. That is why Maple gave the answer I showed in the screen shot above. Here is the corrected ODE below. Maple now do not solve it. It gives division by zero error. !Mathematica graphics Dec 8 comment About a simple differential equation The solution $y=e^x$ does satisfy the ode and the initial conditions. Dec 8 comment About a simple differential equation @MarcoB the solution $y=e^x$ seems to be correct. Maple gives that answer: !Mathematica graphics Dec 6 comment When slope is undefined, output is undefined instead of error message Why not simply use slope[p_, q_] := Module[{r = run[p, q]}, If[r == 0, Infinity, rise[p, q]/r]]; ? You can change the definition as needed to handle the special case. I do not know what logic you are using. You change the above as needed to check for this special case and return different result if needed. Dec 3 comment Can I emulate Wolfram's automatic package updating in my own packages? I did not know that WRI did this. But this seems to me to be a bad idea. I'd rather get a notification that there is a new package version, and let the user decide when and if they want to update. You can make the update very easy, sure. But I do not want external software to update anything on my PC without me knowing about it. Nov 29 comment Back from transfer function (s-domain) to differential equation (in t-domain) @JanEerland You need to have the function tfToDiff defined first.