« first day (223 days earlier)      last day (4251 days later) » 

5:00 AM
Can someone please tell me what the keystrokes are to select all of a particular cell type. e.g. select all input cells, all text cells etc. I have had a brain freeze and forgotten!
 
 
4 hours later…
8:42 AM
a few days ago, someone mentioned simplectic integrators. I would like to point out that there is a fair amount of literature/codes in the context of celestial mechanics which you can acces via cdsads.u-strasbg.fr/abstract_service.html typing say Symplectic maps for the n-body problem in the title (e.g. a paper by Wisdom, Jack; Holman, Matthew)
 
 
2 hours later…
10:16 AM
@chris Indeed, celestial mechanics is one of the biggest consumers of symplectic routines.. all those Hamiltonians!
@chris No immediate generalization comes to mind for efficiently searching a cube for roots, but I'll ping you if I find something.
Hmm, I found this; I haven't seen this until now. If anybody could get it working for Mathematica, it'd be the ticket.
 
10:54 AM
@RolfMertig Another thing I forgot to note: compare N[Sin[10^23], MachinePrecision] and N[Sin[10^23], $MachinePrecision].
 
 
1 hour later…
11:58 AM
@J.M. The abstract goes "The result is of some use ..." . Like saying "Read me if you haven't anything better to do ..."
 
@Verde Hmm, I missed that little detail. Good eye.
 
@J.M. It's not good eye, but laziness.
 
@Verde I tend to read "some use" as "could fail spectacularly in a number of cases"...
 
@J.M. Or "We've had to introduce some Eddington variables for the theorems to hold"
 
Ah yes, that too.
 
12:28 PM
@J.M. I am intrigued: doesn't simplectic imply hamiltonian?
 
12:48 PM
@chris No, I meant that the symplectic integration methods are precisely those that respect the Hamiltonian of the system. I remember linking acl to a discussion of these methods.
...and the reason why the CM practitioners use symplectic methods a lot is precisely because the systems they frequently can be described by Hamiltonians.
@chris BTW, I wrote an answer to your old question; see if it suits your needs.
 
 
3 hours later…
3:55 PM
Is there a convenient way to extract element ( such as text and disk ) positions from a graphic once it has been modified using the edit tools ?
 
R.M
@image_doctor From the FullForm...
 
@R.M Thanks, so if I add a FullForm after the modified plot , I should get what I need?
@R.M .. yep that seems to work, thanks :)
 
R.M
yeah, it should all be there.
@image_doctor no problem :)
You might find Cases useful here
Something like Cases[graphics, _Disk, Infinity], for example
 
I have a set of varying sized disks labelled with varying sized text , but the placement isn't easy to automate .. as at some points on the spiral it is better to place the text adjacent to the disk ( left, right, above, below ) and others to place the text inside the disk if it is suitably large. But arbitrarily switching styles looks confused, so some region based approach looks better.
Thanks that extracts the disk elements nicely
 
 
1 hour later…
5:11 PM
Hello, @Yu-Sung!
 
5:48 PM
@image_doctor You don't need FullForm to extract data from graphics, just to see its structure and find out which Part you need.
 
6:00 PM
@SjoerdC.deVries thanks for the tip, by "see" you just mean examine it's list structure ?
 
@image_doctor Right. Graphics may have a complex structure and you have to look for the pieces you need. You end up with things like g[[1,2,1,1,2,3]].
but g in this example is just the raw Graphics
@image_doctor you may find this question interesting in this context
8
Q: Saving plot annotations

Sjoerd C. de VriesYesterday, while adding some timing plots to the "Optimally picking one element from each list" question I was once more remembered of a mathgroup posting I did a couple of years ago ("Keeping plot annotations after regenerating a plot"). I was happily annotating my plots (manually) when I tho...

 
 
2 hours later…
8:01 PM
@SjoerdC.deVries thank you for that, as the responses suggest I'd rather do this algorithmically but finding a suitable method of distributing the text elegantly around the spiral based graph seems non-trivial, so manual it is for now.
 
Please help me test my new CDF demo. Here it is 12000.org/my_notes/mma_demos/solid_pendulum_with_spring_mass Just wanted some experts eyes to try it to make sure it looks correct. i.e. the physics feels correct. It is a solid pendulum with a mass-spring system as the 'bob'. This makes the physics little harder but little more interesting. I want to send this to the WRI demo site. Just wanted someone to play with it to see if it looks and feels right.
I am adding the documenation of the mathematical model also but not completed it.
 
R.M
@image_doctor you might find some ideas from the word cloud question. In Szabolcs' answer, the words are placed along a spiral and you could probably adapt that to find the right spot to place the text in your graph
 
 
2 hours later…
10:38 PM
@R.M Thank you for the pointer, I'll re-visit the word cloud and seek inspiration.
 
acl
10:53 PM
@NasserM.Abbasi have you checked if the energy is conserved? (as a check)
 
@acl, sure. It is. I have a counter there, you see it at the top right corner. PE+KE is constant. (it can be negative, only becuase I measure PE downwards). But it is constant per single initial conditions run. Thanks
 
acl
11:07 PM
@NasserM.Abbasi OK. I can't run it right now that is why I am asking (I am trying to work out what the problem is in your question by thinking :) )
 
@acl, OK. from what I've seen before, if the physics is correct, then singularity should not happen in the numerical solution. singularity tells me the physics is wrong? stiffness is ok. can get stiff ode from correct phyiscs ofcourse. But singularity means the model is wrong. But I am not a physics person either. So I am not sure really.
 
acl
@NasserM.Abbasi I just popped over to another machine and ran your code quickly; x'[t] and theta'[t] diverge, which looks a bit strange (how is energy conserved?). i don't have time to write out the lagrangian/hamiltonian and work out what's going on right now so, if nobody answers by tomorrow, I'll play with it and see if I can help
 
@acl, I have all the derivations there in the link I showed. The Lagrangian is there. Energy is constant, since PE+KE do not change?
 
acl
@NasserM.Abbasi yes of course, but I mean, to check if they don't change in the actual numerics, which would be an indication of numerical error
 
@acl, yes, I calculate PE+KE after each time step. I solve using NDSOlve, get the solution, and evaluate PE+KE. I see it does not change.
 
acl
11:15 PM
@NasserM.Abbasi ok I see (I can't run the thing right now as I am running other things on all the machines I have access to, so missed that)
well, earlier I plotted x'[t] and it diverged, as did theta'[x]. so...
 
acl, x'[t] is the relative speed of the bob, not the absolute speed of the bob. the x coordinate is the local frame of reference for the bob. x is measured from the middle of the tube there. the bob can be speeding up relative to its base and also the pendumum can be speeding up. no problem. as long as PE+KE is constant
 
acl
@NasserM.Abbasi a) I didn't understand how x'[t] can diverge, but let me take a look at the html page (could you link to the html notebook directly from here, so I don't bog down my machine with the cdf trying to start?) b) if x'[t] diverges, isn't it natural that NDSolve is in trouble? (this was what I thought was the problem, but I have not yet played more)
 
@acl here is the html for the model 12000.org/my_notes/mma_demos/solid_pendulum_with_spring_mass/… thanks,
@acl, x'[t] does not diverge. the bob is attached to a spring.
 
acl
OK I don't understand how theta'[t] can diverge in a physical situation. wouldn't the thing be rotating infinitely fast?
@NasserM.Abbasi I plotted x'[t] from t=0 to the point where NDSolve chokes, and it seemed that both x'[t] and theta'[t] did diverge (they'd both have to do it at the same time for the energy to be conserved)
 
@acl, it is just a standard pendulum system. I simply replaced the bob with a bob attached to spring.
 
acl
11:26 PM
I thought it looked like a sign error somewhere, but didn't have time to pursue
@NasserM.Abbasi ok if you do plot x'[t], does it or does it not diverge?
maybe I plotted something else
 
@acl 2 things: the bob is attached to a spring. It will eventually be pulled back. There is a force pulling it back.
 
acl
@NasserM.Abbasi I'm not talking about the physics but about your equation
ok in a couple of minutes one of my runs will finish and I'll try to look at your results
looks like ithis
wait, I just saw your comment. is this just for $M_0=0$?
 
@acl, the issue with singularity is the case I show in my post at stackexchange. The main post.
@acl, i.e. the issue with singulairy only shows up when the pendulum is made massless, and only under specific IC. this is when $m_0$=0 (small m. the big M is for the mass of the bob, which is never zero).
 
acl
@NasserM.Abbasi I am getting lost. a) do you get the same plot I get above? this is with your code. b) if I want to understand your code in the SE question in terms of physics, is it for a pendulum with no mass?
@NasserM.Abbasi well, the CDF also chokes if I put $M_0=0$ and some ic that I forget.
 
11:42 PM
@acl, it is the same when pendulum mass is zero, not bob mass is zero. here is screen shot
 
acl
@NasserM.Abbasi OK I think we're going in circles. anyway with the code you have, both x' and theta' diverge at the point you have a problem (and that is the reason you have a problem, I'd guess)
 
@acl, when you make the pendulum mass zero, which is small m zero in the derivation I have in the report, this means the bar is massless
 
acl
@NasserM.Abbasi so what's the question? is it why NDSolve chokes, or why you get a diverging angular velocity?
 
@acl, OK. But the question why? If the model is correct, there should not be singularity. That is the whole point of the question.
Unless the physics model is wrong. But I do not see where the model is wrong.
 
acl
@NasserM.Abbasi if thats the point then it's a question on physics...
 
11:46 PM
@acl, but I think the physics is correct, so I think the problem is with NDSolve :)
 
acl
@NasserM.Abbasi this is getting circular. suppose you have an equation in which the correct answer would diverge at some t. what should ndsolve do?
 
@acl, but there can not be divergence. Where is the divergence coming from? The is mass attached to a spring.
 
acl
@NasserM.Abbasi I don't know. mathematica is otherwise occupied, I am sitting with my legs on my desk and I am not going to get up and get pencil and paper to work it out :)
at least not tonight
so basically you expect that NDSolve is completely wrong and all the smoothness of the solutions is misleading? that it's just doing the wrong thing?
 
@acl, I do not know what is wrong and where. All what I know is that I think the equations are derived OK, and I get singularity. That is all. But no problem for the demo. I simply now only allow the pendulum to be solid pendulum, and this problem goes away. So not a critical issue for me now. Wanted just to see why I get the singularity, may be I learn something.
@acl and also the singularity ONLY happens under some very specific IC. Most of the time it runs for long time with no problem. Only when it hits that one specific initial conditions when NDSolve complains.
 

« first day (223 days earlier)      last day (4251 days later) »