9,491 reputation
1642
bio website
location
age
visits member for 2 years, 6 months
seen 13 hours ago

21h
comment Mathematica9: NDSolve slows down after repeated calls
just tried it and it looks like the problem still exists in version 10
Jul
15
comment Controlling quality of discretized region meshes
good to see you back alive, user21 :-). Is it possible to refine the grid only near the edge, in one way or another?
Jul
6
comment Why are functions called first-class objects in Mathematica?
@Eric: one more remark about 3=9: for a term rewriting system this might not be that meaningless at all, e.g. it would work perfectly well in a local replace rule: (a+3) /. {3->9}. As far as I understand, the only reason why defining such a rule globally with Set wouldn't work is that Mathematica demands a global replace rule to be attached to a symbol, which in this case isn't possible as the LHS is just an atomic integer ...
Jul
6
comment Why are functions called first-class objects in Mathematica?
@Eric: as has been explained the "miracle" of Set is that it has the HoldFirst attribute. This will make Set see the unevaluated LHS. What the code within Set does with that unev. LHS is up to the programmers at WRI who wrote that code. Obviously it does analyze that LHS-expr. and for some special cases does "the right thing". There is nothing to be understood at the language level here, it really is just an implementation detail which even could change between versions. Unfortunately the documentation of what such functions actually implement is often somewhat vague or incomplete...
Jul
5
comment Why are functions called first-class objects in Mathematica?
I think the statement "{g,h,j}[[1]] = 6 can never work" is not correct. As Set has HoldFirst it would very well be able to extract the (held) symbol g and change its OwnValues, just as it is able to do in something like {g,h}={1,2}. Unlike the latter the former has not been implemented, probably for good reasons, probably just because nobody at WRI bothered about that specific case...
Jul
4
comment Why are functions called first-class objects in Mathematica?
I think that this statement might have had in mind "pure functions" like (#^2)& or Function[x,(1+x)^3]. These quite obviously are normal expressions and functions. "function definitions" like f[x_]:=... in Mathematica are actually definitions for global rewrite rules (as others have explained in more detail) which just happen to have an intuitive interpretation as functions but conceptually are not different from rules which e.g. define variable values.
Jun
8
awarded  Informed
May
28
answered Cell with no form using NotebookWrite
May
28
comment Cell with no form using NotebookWrite
yes, my porposal was that you explain in your answer what exactly it is that you refer to with "text cell". I guess you call a "text cell" one that has a string or TextData as content as opposed to an expression cell which has BoxData as content, which -- as you mentioned -- hasn't anything to do with its style, which can be "Text" or not. It probably also is worth mentioning that some functions (e.g. CellPrint and NotebookWrite) expect low level Cell expression as arguments while others (like CreateDocument) accept higher level stuff like TextCell...
May
27
comment Cell with no form using NotebookWrite
There is a difference between a Cell with no assigned style as the OP wants (for what reason?) and a "Text" cell, which you might make clearer in your answer. You can easily see that with NotebookWrite[nb,Cell["test"]] vs. NotebookWrite[nb,Cell["test","Text"]]. What these two cases look like depends on the active stylesheet, of course...
May
18
comment PDE combined with ODE 1D
After applying the method of line there will be one ODE per discretization point and extra initial conditions for each discretization point. You would just have to insert the corresponding x into each of them. Or do I miss something? Unfortunately I don't have the time to elaborate, but if it is just for inserting an x dependent initial condition, that might make a good extra question (if you provide a otherwise working example)...
May
18
answered Problems with For statement
May
18
revised Are there any cases when For[] loops are reasonable?
added section about numeric errors in loop counter
May
18
comment PDE combined with ODE 1D
NDSolve (up to version 9) uses the method of lines exclusively to solve PDEs and AFAIK can't automatically solve coupled equations of PDE and ODEs. What you can do is to apply the method of lines yourself and then combine the resulting set of ODEs for the PDE with the single ODE to one system which then can be solved to NDSolve. I think there are examples of manual application of the method of lines in the advanced documentation of NDSolve as well as on this site...
May
17
comment Running unit tests while debug session is running in Workbench
The workbench is based on an older version of the MUnit package which was available as a standalone Mathematica package before there was the workbench and which you might be able to use in an extra session as Akater suggested for his package. You can still find it deep in the directory tree of the workbench/eclipse installation (put a Print[$Path] in a test and run it). I have never checked if that MUnit package still works without the workbench but it would be the first place to look at. Maybe you'll find documentation for the older package somewhere to start off...
May
16
answered Inserting a closed section
May
16
answered Treat strings as variables?
May
13
comment How to generate a unique file name similar as that created by CreateTemporary
it probably is worth noting that it is common practice to use such random strings as "global unique identifiers" (GUID). Of course they are not guaranteed to be unique, but only have probabilities of almost 1 to be so. See e.g. the wikipedia article on GUID for details. From the format of the strings I could well imagine that the conventions mentioned there are what Mathematica uses for CreateTemporary, or at least something very close...
May
6
comment NDSolve producing an overdetermined system
for me the error message seems to be very clear: you have 3 differential equations but want to solve for 4 functions. What is em? Why don't you have an equation for it?
May
6
comment Why do NDSolve and OutputResponse not evaluate non-analytic functions numerically?
It probably should be noted that it does help to start from a value larger than zero for NDSolve (at least if one adopts the initial condition), but not for OutputResponse...