A Very Long Straight Line

I’ve been multitasking in an interesting way. Sort of. I’ve reached a certain point with some computations I am doing that I cannot go beyond by analytic means. LinePlotThis means that I can’t extract the physics I need by doing algebra and other exact manipulations on paper any more. Progress can continue however by using numerical means, employing a computer to solve the highly non-linear equations and extract the juice. There are several steps involved, and ultimately, I want to determine how a certain physical quantity depends on another physical quantity. (I’m sparing you the trouble of knowing what the details of the physical quantities are, since it does not matter for the thing I am trying to tell you. It relates to quantum field theory, gravity, and string theory, which connects the two.)

I can see that dependence quite clearly if I simply plot a graph of one versus the other, and in this case I need the computer to work out what the points on that graph are. I actually don’t know the answer for the cases I really am interested in, nobody does (that’s why it is research!), and so that’s what I want to find. I want lots of points to get a nice smooth graph, so the computer has to compute a lot of points, and I need to run it for a long time since I want it to compute the points very accurately. So I wrote a program (in Maple) to work on the problem, studying just one point initially. That allowed me to delicately find the best paramaters I needed to set up the computer solving a messy non-linear (differential) equation with certain boundary conditions (including one of the physical quantities I am inputting into the system). After a while it finds the solution, giving me the result in a giant set of lists of numbers. Those numbers are then fed into another part of the program that builds another quantity out of them that is then integrated over a certain range, producing one number. That’s the physical quantity that corresponds to that number that went into the boundary conditions of the other problem. This is one point on the graph.

I’ve now written a larger program that embeds the above operation in a loop that simply keeps doing the same operation for several different values of the input parameter, building up a table of results that then at the end gets plotted on a graph. I’ve built in operations for generating the graph and everything, and I’ve tested the program. So of course, I’ve got to test the whole thing on a known problem. I want to benchmark it, as it were, using a version of the problem for which I know the answer. It turns out that this known version has as a result that the dependence that results is simply a straight line. So I’ve set the program running, at full desired accuracy, on this known problem that I’ve already solved fully by hand. The slope of the line should come out right, as well as that it is a straight line, and not some other shape. (This is not a total waste of time – in addition to checking that my program is running correctly, the numbers from this will be useful as a reference for the new situations I want to explore which will have this case sort of lurking in the background. I’ll be able to subtract these numbers off from those results to see the new physics.)

I’ve asked the computer to compute 50 points, and I set it going yesterday evening. Every time it finishes a cycle of the loop I can see when it is done since it dumps data to a file and I can see that the file is updated. From this I can see that it is taking roughly an hour for each point! (I may have overdone the accuracy a bit, but the non-linear diffy is very delicate for Maple to handle, it seems) So this is what I mean by a very long straight line, in the title. Long in time, not space. I check in every hour from other tasks (building a wall in the garden, household tasks of various sorts, preparation for class tomorrow, maybe a little drawing later) to see how it is doing, and kick myself for not setting it to draw the graph-in-progress as it goes along (the example above left is a sample from an earlier test). So I simply have to wait until the end to see the final result.

(A technical note for those of you who might find it interesting. I’ve been doing all this on my work computer, which is faster than my computer at home. I’ve found it very convenient to use the program called Teamviewer, which allows me to open up a screen on my laptop (and ipad) which is in fact the entire desktop of my computer in my office. I can then do things like operate Maple with the full user interface as though I am right there at the desk. It works very well, and is a good substitute for the usual Unix remote displaying of X windows, which does not work here since Maple is not using X.)

I hope that in the morning some time I have the results. I can’t wait to plug in the cases I actually want the answers to!

-cvj

Bookmark the permalink.

13 Responses to A Very Long Straight Line

  1. Pingback: News from the Front, X: Smoother Transition « Asymptotia

  2. Pingback: Something’s not quite right, perhaps? « Asymptotia

  3. Pingback: Lines of Thought « Asymptotia

  4. Clifford says:

    Hi,

    Thanks. I don’t think that’s the thing for me for this project, but maybe some other time.

    -cvj

  5. Anonymous Snowboarder says:

    C – you should look into the CUDA capability of Matlab if there is parallelism to exploit.

  6. Clifford says:

    Hi Carol,

    It depends upon your starting point. It took me a short while to get it to do what I needed, and I found it very clear and fun to use… The online help is good, although I found it useful to initially read through the first few chapters of a handbook/guide (there are many) and play with the examples. That’s the quickest way to get up to speed on any program, I find.

    Cheers,

    -cvj

  7. Carol says:

    Hi, just want to know if Matlab requires a big learning curve? Thanks

  8. Clifford says:

    Hi,

    Yes, I am enjoying it a lot already, and hope to write a program tomorrow that is of some use. It reminds me of the days when I used to use the NAG libraries in combination with Fortran, and later, C.

    See you soon!

    Cheers,

    -cvj

  9. Moshe says:

    Thanks for the recommendation of Teamviewer, I will try that over the summer. As for Matlab, I recommend it highly, took me just a few days last summer to get to the point of writing useful code, it is incredibly user friendly and much better suited for numerics. While I was at it, I got myself educated in spectral methods, which seem to speed up this sort of problems quite a bit. I recommend those highly as well.

    Anyhow, good to talk with you, hope we get to meet again soon.

  10. Clifford says:

    Hi Moshe!

    I am in fact switching to Matlab. The Maple thing got to point number 39 after about 3 days, and then I gave up waiting after it got to about 1 point every few hours. As this is the benchmark example, which is easy, I did not hold out hope for the more complicated thing I wanted to do, and in fact as I went to the first point of the more non-linear problem it thought about it for a whole day and never came back…. I’ve been teaching myself Matlab the last 24 hours and it is rather nice! (I’ll either use it in its entirety or somehow use Maple to call it as a supplement when it needs to do the complicated stuff – apparently this is possible.)

    As for Teamviewer usage… It is *fantastic*. There’s no noticeable delay at all. It seems very nearly as fast as if I was sitting at my desk working directly on the machine. So go for it!

    Good to hear from you.

    Best,

    -cvj

  11. Moshe says:

    Hey Clifford, very mysterious plot, I guess I will find out soon enough…Just wondering about your technical note, I am thinking about doing the same thing, get a powerful CPU to hum and buzz somewhere behind closed doors and control it remotely. I will probably try to run either matlab or mathematica. I am sure it is convenient to run long simulations, but I do that on a grid anyhow (thanks to the folks in westgrid who made it painless). I am wondering rather if this method is fast enough to write code and control the front end while doing that, or is there a noticeable lag when working with an editor.

  12. Clifford says:

    Ha! No. That’s for another day… 🙂

    -cvj

  13. Rick says:

    Are you using string theory to calculate the mass of an electron?