23,177 reputation
13377
bio website
location
age
visits member for 2 years, 10 months
seen 1 hour ago

Jan
16
comment Module and Local variable
This is just a workaround. It is not a good solution to avoid using Module.
Jan
16
comment Slider resistance and Play-Pausing with Manipulate, TabView, and attempt an granular TrackedSymbols?
Note that one of my end goals was to have a fairly large set of control variables all in one tab (ones associated with preCalculateStuff), without cluttering up the rest. you can definitely do that. Here is demo with multiple tabs, each tab has in it many more controls that show up when selected. This is allow more controls to be put on the same screen area. demonstrations.wolfram.com/… This has three layers to have even more controls demonstrations.wolfram.com/…
Jan
16
comment Methods for NSolve
Still why is NSolve so much quicker than just Solve numerical methods in general are faster than symbolic, but not as accurate, everything else being equal.
Jan
16
comment PDE syntax question
my guess it is inconsistent because you are saying P=0 everywhere at time zero, but then say that P at left edge is 100 for any time t. But t=0 is any time t. Hence you have a conflict. is it zero or is it 100 at the left edge when time is zero?
Jan
13
comment Symmetric FrameMargins problem
it works ok on windows 7, V 9.01, screen shot: !Mathematica graphics
Jan
12
comment Using Locators in a non-standard Manipulate code
@LucaM I am not sure I follow you. Lets make sure we are on same page: To make the display move very fast, only way is not to update the stream plot for each mouse movement, right? But user still wants to see the charge moving with the mouse. So, now the charge moves with the mouse, and the fields are updated when the mouse is released. This is a compromise. If you want the field to update as the mouse moves, easy to do, but will be slow again. Unless number of points is reduced or StreamPlot call optimized, which might be possible but I have not looked at this as I do not use this function
Jan
12
comment Using Manipulate with a control variable for selective recalculation
@LucaM added a version much faster, it uses ContinuousAction -> False on the Slider2D. This makes it fast, but you won't see the update until you release the mouse. Kept the old version there.
Jan
12
comment Using Manipulate with a control variable for selective recalculation
@LucaM making dynamics fast and optimized is something that has to be looked at in any method and that is not easy. There are few ways to make it is faster. You can for example make PerformanceGoal->"Speed", you can reduce the numbers/data used by StreamPlot? I am not familiar with StreamPlot and all its options. Also using ControlActive might help.
Jan
12
comment Using Manipulate with a control variable for selective recalculation
@LucaM I was able to reproduce it now. Deleting the cell output, then restarting the kernel. But this is just the initialization part. If you just add SynchronousInitialization -> False then now you will see it come right away, and see it updating on the screen with a nice progress chart, instead of what was happening before. The computation in your initialization has to complete before manipulate display the first time. This only happens once. The above should make it more user friendly. I've added SynchronousInitialization -> False, to the code also.
Jan
12
comment Why to do parentheses change the results of a calculation?
@raxacoricofallapatorius its does If one uses exact numbers. (1 + 1*^20) - 1*^20 gives 1
Jan
11
comment Awkward Two-Point Boundary Value ODE
You ODE syntax is not really right. You write D[uall[x, en, k], x, x], but $u$ is not a function of en and k. These are paramters, not independent variables. Otherwise, you'd be talking about a partial differential equation. You should just write u''[x] and that is it. As for the NDSolve itself, look at Method shooting and startingInitialConditions. See the NDSolve advanced documentations for examples of boundary values for second order ODEs using the shooting method.
Jan
11
comment Breaking up long equations in TeXForm
There is no answer to this, since it is impossible to do what you want, without manual editing of the Latex code generated, and using various Latex packages and methods as needed such as breqn, mathtools and its splitfrac, or amsmath and split env, and many other modification to the generated code. This is a Latex issue and nothing that Mathematica can do about it. If you have Latex code as \frac{very very long line}{x} then there is nothing but manual edit that can break it, including manual splitting if needed. The answer to your question is: There is no solution to this within Mathematica
Jan
10
comment Graphics Function Definition Style (Using SubValues vs. DownValues)
see mathematica.stackexchange.com/questions/544/… and this mathematica.stackexchange.com/questions/7999/…
Jan
10
comment Display functions without dependence?
This rule does not work for all functions of the independent variable. For example a[t] Exp[t] gives a Exp[t]. But may be that is ok with the OP, just wanted to point it out just in case.
Jan
10
comment Fourier Series of “Split” Defined Function
@ErikVesterlund For that, you can simply convert it to real. Like this: FourierSeries[x, x, 2]; ExpToTrig[%] which gives 2 Sin[x] - Sin[2 x]
Jan
10
comment Issues with $MachineEpsilon
The wiki web page linked to above has an implementation for finding $\epsilon$ using many different languages, is it possible to show an implementation using Mathematica as well? May be then it can be added to the wiki page along with all the other languages?
Jan
10
comment Fourier Series of “Split” Defined Function
@ErikVesterlund there are different definitions for the integral used to obtain the Fourier coefficients. In signal processing vs. say control vs. pure math. Different books use different definitions. So, if you are trying to compare results with some book, you need to make sure the same definitions are used in your code, else you'd think M is making a mistake. The help explains all the main 4 definitions and how to change them using FourierParameters->
Jan
10
comment Filling only part of a plot
Do you have a function to use to show how to do it? You can start by looking at Filling
Jan
10
comment Fourier Series of “Split” Defined Function
Yes, there is a way. Do you have an example of a function to use to show you? For your second question: Assuming[Element[n, Integers], Simplify[Cos[n Pi]]] gives (-1)^n and Assuming[Element[n, Integers], Simplify[Sin[n Pi]]] gives 0
Jan
9
comment Is linear interpolation applicable here
@Dr.Java you ask what language did you use?, I am using Mathematica, or now known as Wolfram language. This is a programming language made by company called Wolfram research. They have student version, and also personal version and commerical version. see wolfram.com to buy a copy from the online store there.