Reputation
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
22 50
Newest
 Necromancer
Impact
~113k people reached

Jun
17
comment How do I make a definition/function/method as I would in Java/MATLAB/Python
I think it would not be too hard to combine parallel evaluation with an early exit strategy. If you need that, you could use a combination of ParallelSubmit and WaitNext
Jun
16
comment How do I make a definition/function/method as I would in Java/MATLAB/Python
it certainly is OK if it works for you. I personally would use a Do loop instead of For and probably localize res and (when using For) i as well. Other than that I think there is a typo (v vs. u in the definition of LHS). As Jens has mentioned there are more Mathematica-ish ways to do the same thing but I don't think that these will have strong advantages in this case...
Jun
15
answered How do I make a definition/function/method as I would in Java/MATLAB/Python
Jun
15
revised How to exclusively match in the numerator?
added 379 characters in body
Jun
12
answered How to exclusively match in the numerator?
Jun
12
comment How do I make a definition/function/method as I would in Java/MATLAB/Python
I'm wondering how you define something like Confirm[wavefunction[x_, n_], potential[x_], energy[n_]] in any of the languages you mentioned? It's hard to answer your question with the information you gave, could you provide a minimal example which will show your problem? My guess is that you did make definitions for wavefunction,potential and energy and because these are evaluated the definition of Confirm can never match as the results of the former will not have the Heads you are trying to match anymore...
Jun
12
comment FindMinimum and WhenEvent
Usually all the functions that do some math (be it symbolic or numeric) like functions better which are "mathematical" compared to "programmatical" stuff. So you sometimes get better results faster when you use e.g. UnitStep and similar functions than If or Which, which both are not something that can mathematically understood. I don't think it makes a difference here, at least not if you ensure evaluation only for numeric arguments, but you might try a UnitStep variant and see whether that makes a difference...
Jun
12
answered FindMinimum and WhenEvent
Jun
8
comment How to vary finite difference approximation order in `NDSolve` at boundaries
Sorry, I didn't see that you had that reference in your question. I can not answer your question about boundaries, at least not without reading through the documentation once more, which I have no time for, sorry...
Jun
8
comment How to vary finite difference approximation order in `NDSolve` at boundaries
have you seen the documentation (here)[reference.wolfram.com/language/tutorial/… which is also available in the local documentation center. I think it contains everything you might or might not want to know about the Method of Lines as used in Mathematica :-). To begin, there is the "SpatialDiscretication" option for the MethodOfLines method with which you should be able do what you want (and probably much more). The documentation has some usage examples...
Jun
8
comment What method does NDSolve use for solving PDEs?
I think you should mention that since version 10 there is also the "Finite Element" method, which can solve equations which were not possible to solve with "Methods Of Lines" (as e.g. the mentioned Laplace eq.). Among other things, the finite element method can also be used as an alternative to the methods of lines to discretize the space-like dimensions and create a system of ODEs to solve in time...
Jun
6
comment How can I make Plot show the plot while it's computing it?
have you checked that the kernel crashes don't happen without the dynamic plots? NIntegrate is also a complicated function which might get into trouble.
Jun
6
comment Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction
my suspection is that there is some internal state behind the scenes which is not transfered correctly to the exported expression or not correctly reestablished when importing. I don't know if any of this is documented or meant to be seen by users at all.
Jun
6
comment Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction
as ilian said the documentation sais yes, this should work if both are 64bit. I would try that before relying on that feature, though, especially as you have seen problems with .wdx for this specific case...
Jun
6
revised Why doesn't ParallelTable work on this very simple example?
deleted 22 characters in body
Jun
6
answered How can I make Plot show the plot while it's computing it?
Jun
6
comment Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction
looks like a bug in the relatively new code for interpolating functions on unstructured grids (you might want to report to WRI). You could see whether saving and storing to .mx format would work, that seems to work for me (and would even be faster). AFAIK .mx is nowadays only different on 32bit and 64bit machines so chances should be large that you can load them on another machine. If that wouldn't work you'd probably have to store the pure data (Grid and ValuesOnGrid and probably some derivative info) and reconstruct the interpolating function...
Jun
6
answered Why doesn't ParallelTable work on this very simple example?
Jun
6
answered How to replace element of list by index
Jun
5
comment Diverging solution to coupled second order ODEs from NDSolve
@xzczd : I'm not sure why you did see other behaviour before, but that is the usual rule: precision will never automatically increase, so if you start out with machine precision numbers only in very limited cases increasing WorkingPrecision higher than MachinePrecision will have any effect, and usually not the desired one (AFAIK). To be on the safe side I do use completely "exact" input if I play around with the precision stuff beyond machine precision and that so far has been free from any surprises...