7,645 reputation
1031
bio website 12000.org
location the great state of Wisconsin
age
visits member for 1 year, 4 months
seen Mar 12 at 19:57
stats profile views 532

Jan
25
comment How to eliminate the need to double evaluate a Manipulate so that a Module in its Initialization section works?
@kguler, Yes, that did it ! very good observation. Please post this as an answer. I will test it more, but so far it seems just changing := to = did the trick. Thanks you. (so many smart people here, it is scary).
Jan
25
comment How to eliminate the need to double evaluate a Manipulate so that a Module in its Initialization section works?
+1, excellent. thanks. I will use this workaround if there is no alternative to do it without having the symbol obj be global. Because now using your solution, "obj" is global, where when I had it before as Control->None, it was not global. That is why I did not try this method. But for me, the benifit of being to able to use this method is more important than this one issue. But in general, WRI demo editor does not like to see global variables in the initialization section, as it will interact with the copy of the Manipulate which one has to make in the process later on. Thanks again.
Jan
25
comment How to eliminate the need to double evaluate a Manipulate so that a Module in its Initialization section works?
The intend is not to make a new instance at each button press, but only to provide a separate context to the variable u to live in and have access functions called to update it. Module is made only one time using the makeObj[] call, which only called once. thanks.
Jan
25
comment I'd like to display field lines for a point charge in 3 dimensions
VectorPlot3D may be? reference.wolfram.com/mathematica/ref/VectorPlot3D.html
Jan
25
comment How can you give a Module a context and have its local variables and Modules belong to that context?
@FaysalAberkane, excellent idea. I like your method also. Small issue where I need to double evaluate the Manipulate cell to fully evaluate the internal Module. I posted a separate question on this here, titled "How to eliminate the need to double evaluate a Manipulate" if you have ideas on how to resolve this, will be good. Thanks for your help.
Jan
25
comment How to Keep Input Cells Hidden After Evaluating Notebook
@Tim, someone asked very similar question 2 days at Mathgroup, here it is groups.google.com/group/comp.soft-sys.math.mathematica/…
Jan
25
comment How to close the front end so I can clear all Global variables?
I see, thanks. So I guess it is the Dynamic that was causing this issue. I understand now.
Jan
25
comment How to close the front end so I can clear all Global variables?
You are right, I forgot I even asked you about this once :), so I guess this is a case where Quit[] does not clear everything!
Jan
25
comment How to close the front end so I can clear all Global variables?
And btw, this happens when I have ONLY one notebook open, with ONE cell, and ONE manipulate in that cell. I simply SHIFT-ENTER the cell to evaluate the Manipulate, then I type Quit[], and see that not all global variables are cleared. I just verified it again. Started M and did it again, same thing. Quit[] is not removing all Global variables, and yes, you are correct, there is a Dynamic in that one cell. But I always thought Quit[] was supposed to clear all Global variables. I was wrong. Now I will type Remove["Global`*"] to be sure. Thanks.
Jan
25
comment How to close the front end so I can clear all Global variables?
Thank you. Just to be clear, are you saying that one should close all open notebooks windows before doing Quit[] (but then I would need at least one window open to type the Quit[] command on?, may be that should be a fresh empty notebook opened just for this command after I closed everything), to make sure that all Global variables are removed? and I do not see this "Quit Mathematica" menu item on my V 8.04 on windows. I only see "Quit kernel". But the help said there is a Quit front end menu item. PLease see edit (1) for screen shot of my setup. thanks
Jan
25
comment How can you give a Module a context and have its local variables and Modules belong to that context?
This is a brilliant idea Ruebenko. It eliminated the need to add the prefix to each state variable or use tags and such. It works very well. The problem that shows up when I make a copy of the code to a new cell is something that can't really be solved by any method, as when making a copy of the Manipulate to a new cell, it will interact with the first Manipulate as now things become global. I'd like to you use your method in my demo, as it simplifies the design I have a lot. I am making edit(6) now to show an example of using this method compared to (edit 4) which used prefix method. thanks!
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
interesting idea. Will study it and try it and will let you know if it work for my setup. thanks!.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
I tried your pair method. But not able to get it to work when the property above is an array and I want to assign to part of the array. I tried to implement what I did in my edit(4), using this method, but got stuck at this one error. Either way, I find the use of [tag] everywhere hard to read actually. But I will post the code now in edit(5) and any one is welcome to see how to resolve this error. I marked the line in error. thanks.
Jan
24
comment Why is FindInstance finding non-instances?
if I do not know any better, I would say you have found a bug.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
hi Rojo; the DynamicModule suggestion does not really help in what I am trying to do. Will look at the pairs[] method to see if it can provide a solution that I can use in a demo. Thanks.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
hi, I see Symbol used also, not allowed. thanks.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
+1, thanks will look at your method, but when you say The idea is to use DownValues for storing properties and UpValues for storing methods., I just to note UpValues and DownValues are not allowed symbols in demo., also Unprotect is not allowed. The demo environment is really a subset of the Mathematica main env. and many things that can work in a normal notebook, will not work due to the restrictions for making a demo. thanks.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
+1 for the idea. The thing is, there are lots of ideas and suggestions, and I have tried many things for more than 1 year now, and nothing yet works once I put them all in the setup I want, which is in a Manipulate, make a copy, and pass the demo filter. I just remember a similar post I had at SO few months ago on similar thing, here it is stackoverflow.com/questions/8624566/… . I think I finally will give up on the idea of making a simple object emulation in Mathematica which I can use in a demonstration :)
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
thanks Ruebenko, I am looking and trying your method now in a manipulate, but even it works, can't use SetAttributes, not allowed, please see my update(1). is it possible to make this work without SetAttributes? I can use Unevaluated[] ok, but not SetAttributes. Thanks.
Jan
24
comment How can you give a Module a context and have its local variables and Modules belong to that context?
hi; I tried the Begin[], End[], but it does not work by extending the context to the modules inside the module. So this does not work for me. Please see edit(3) for an example.