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

Sep
21
answered Obtain a stable solution using NDSolve
Sep
21
comment NDSolve and memory usage
My guess is that saving to file will be so slow that the overhead for stop/restart might be less relevant if not neglectable. The art will be to find the right balance between speed and memory consumption by adjusting the intervals between saving/restarting. Honestly it is out of my scope to assess whether the memory consumption of NDSolve for these cases is within the expected range or indicates that something isn't right. The difference to an optimized (less general?) solver written in C might well be the price you pay for all the extras that NDSolve provides...
Sep
20
comment NDSolve and memory usage
I just tried my suggestion to formulate the same system in matrix form and it turns out that it is using about 60% of the intermediate memory (MaxMemoryInUse), about the same final memory (MemoryInUse) but is about a factor 8 slower, which I find hard to understand. Another thing you could try is to stop and restart in ceratin intervals either as described here or manually with a fresh call to NDSolve with the final results as initial conditions.
Sep
20
comment NDSolve and memory usage
I think you should check MaxMemoryUsed to get an idea about how much memory is really used in intermediate steps (that's even worse :-). While I've seen cases where creating the final result for PDEs took a lot of time and memory that doesn't seem to be a problem for ODEs where MaxMemoryUsed isn't much different whether you create the full final result or not (the differece in MemoryInUse seems to result from the 10^4 interpolating functions in sol). One thing you could try is to use a matrix for for your system, but I have no idea how that effects memory usage...
Sep
14
awarded  Enlightened
Sep
14
awarded  Nice Answer
Sep
13
comment WebServices context problem
@Hans: o.k., I just wanted to ensure whether or not you also see the same behavior, which I consider a bug and think should be reported as such (which I probably will do). Your hand-crafted HTTP POST calls are of course a very useful workaround and very appreciated, especially because they show that these are simple enough to make the WebServices package for such purposes almost dispensable. +1 for that...
Sep
13
comment WebServices context problem
@Hans: I can confirm this to not work with several versions on windows. As I understand you didn't see the error, which version/OS do you use?
Sep
13
comment ParallelTable of ParametricNDSolve objects fail
Do these objects with internal state have similar problems at other places, e.g. write to/read from disk, "serializing" via "Compress"/"Uncompress"? Are you thinking about addressing this in the future? There could well be cases where the evaluation of the differential equation(s) on all parallel kernels might be expensive (especially concerning memory usage) und not a practical workaround...
Sep
13
comment Searching linked lists that contain lists?
There is a slightly simpler version of b1 which seems to be just as fast and doesn't need iteration/recursion limits to be touched. It does unlike Mr.Wizards t9 crash the kernel for longer linked lists though (unless it finds a match before the crash). Here it is: b2[x_] := (# //. {{x, _} -> True, {_, r_} :> r, {} -> False}) &
Sep
7
comment How can I transfer mathematical expressions between Mathematica and Maple?
it may well be that other solutions will work much better but I think for this question one should at least mention MathML, which (in its content markup version) is the official standard aiming to make exactly such exchange between programs more easy. Have you tried that (copy/paste or import/export as MathML)? I probably should note that my own experience with MathML is limited and I 'd expect problems when using it in practice, but probably it's worth a try. And both companies were involved in the specification so you could well ask for official support if something won't work :-)
Sep
6
comment Input field that appends to a list
@PlatoManiac: you're welcome. Another advantage of that approach is that you could also do the reset of the list with a keyboard shortcut by adding another rule to the EventHandler, e.g. "EscapeKeyDown":>(val={};y=Null;). Using "ReturnKeyDown" instead (or together) with the tab key might also make the interface more convenient to use (IMHO the desired behaviour is an abuse of the tab key event, but well...)
Sep
6
comment Input field that appends to a list
@Mr.Wizard: it seems that an additional Deploy would make your version with Row instead of Grid also work. I'm not sure whether that is intended, version dependent or documented...
Sep
6
comment Input field that appends to a list
@PlatoManiac: your use of Block is to my understanding not doing anything, especially it doesn't really localize y in any relevant way. Most probably you meant to use DynamicModule instead. It would probably also be more conventional to clear the input field with y=Null instead of Clear[y], but that is more a matter of taste. Other than that I like that your solution unlike the others should work independent on what else is contained in the gui, so +1 anyway...
Sep
6
comment Input field that appends to a list
@Mr.Wizard: I just tried this with version 7.0.1 and it seems to work alright (without the FieldHint of course). What exactly is not working for you?
Sep
6
comment Input field that appends to a list
@Mr.Wizard: it probably should be mentioned that it is just by accident that this will work with Tab. With Tab the input is submitted and focus is moved to the next "focusable" input element. Only if there is no other such element as here focus will be reset to the same element. If you have e.g. another InputField in the same cell, the focus will move to that. For the exact specification of the OP of course that doesn't matter...
Sep
3
comment Script with command line argument
@jorgen: I think it would be best if you provide an answer and accept it. It is common and welcomed to answer one's own questions and also to accept it. You might want to refer to Anons comment in this case...
Sep
1
comment Removing commented lines of text in a string
Although it hasn't been specified clearly I think it might be more robust to use ___ instead of just __ to also discard empty comment lines, which otherwise well might cause problems when trying to interpret the remaining lines. The RE equivalent would be .* instead of .+
Aug
28
comment Remote Kernel and CUDALink
If I remember correctly then /etc/profile is for settings of interactive sessions and might not be read when just executing the script /usr/local/bin/math. You could either try /etc/bashrc or ~/.bashrc (assuming your default shell is bash). I think there might also be differences in initialization whether you explicitly call bash or whether you call justsh, so it might also depend on the shebang in /usr/local/bin/math. I suggest to check the documentation of your shell and linux distribution as I think these things might even slightly differ for various distributions and shells...
Aug
15
answered Mathematica9: NDSolve slows down after repeated calls