Miscellaneous > Programming & Networking

what programming language to do this?

<< < (2/4) > >>

worker201:
The whole thing could be written in PostScript, but god what a pain in the ass.

What's the target platform?  If you want to do something in the browser, that's a very different process than making a Windows executable, which is different than making a shell script that pipes to an interpreter.  Choosing your platform narrows your language choices considerably, so that's the first step I'd take.

TheQuirk:
The easiest solution to this problem is something like Mathematica or Matlab. Both cost money and both have student discounts. (There is also Octave, which is a Matlab clone. I don't know anything about it.)

Another option is to solve your equations of motion numerically in C or FORTRAN (or whatever), save all coordinates to a file every N steps, and then make an animation using gnuplot. This is often not difficult to implement if your field is nice enough (e.g. you have a formula for each component) or if you need to solve a differential equation for which there is a simple numerical recipe (e.g. wave equation).

If you are still working on this, tell me what sort of problem you're dealing with so that I could check if it overlaps with any of the code that I have.

piratePenguin:

--- Quote from: TheQuirk on 29 April 2010, 19:04 ---The easiest solution to this problem is something like Mathematica or Matlab. Both cost money and both have student discounts. (There is also Octave, which is a Matlab clone. I don't know anything about it.)

Another option is to solve your equations of motion numerically in C or FORTRAN (or whatever), save all coordinates to a file every N steps, and then make an animation using gnuplot. This is often not difficult to implement if your field is nice enough (e.g. you have a formula for each component) or if you need to solve a differential equation for which there is a simple numerical recipe (e.g. wave equation).

If you are still working on this, tell me what sort of problem you're dealing with so that I could check if it overlaps with any of the code that I have.

--- End quote ---
Thanks Quirk. I take classes in mathematica/matlab next semester, and I'm not gonna spend time learning them now to satisfy some curiosity. Producing the coordinates in C or Python and plotting using gnuplot, I like that idea if I want to investigate something like this during the summer.

This is more of a thought experiment and I was interested in producing a couple of animations. Basically the idea was, would a transport system (assume only bus, for a start) work better if it didn't do fixed routes at fixed times (I know they have fixed changes too, eg the morning service is entirely different to the evening service), but instead was dynamic, and people could indicate where they wanna go at a bus stop by using a terminal, or as they leave work by using their phones.

Of course there would be a lot of issues with this in real life, but it's still an interesting mathematical problem. I'm sure it would work for some cities better than others, and perhaps wouldn't work for any real life city, with real people who won't fill the system accurately, but maybe it could produce a better, quicker more adaptable transport service? I know in other cities they have great public transport , much better than what I'm used to (one problem I'd love to see solved is why, about 30-50% of the time I'm waiting for a bus to the city center, I could be waiting for an average of 10 minutes (up to 20) and then TWO BUSES come - one right up the arse of the other, it baffles me).

Anways that was something I was thinking about around christmas, and something I might think about more from a mathematical point of view.

Good to see you're still around Quirk.

Kintaro:
I don't know a fucking thing about math but you can use the GD library, which makes animooted gifs and MNGs from any language worth a damn. You could do it in good old php, or even C if its intensive at all.

Refalm:

--- Quote from: piratePenguin on 11 May 2010, 21:51 ---one problem I'd love to see solved is why, about 30-50% of the time I'm waiting for a bus to the city center, I could be waiting for an average of 10 minutes (up to 20) and then TWO BUSES come - one right up the arse of the other, it baffles me

--- End quote ---
Psychology gets a bit involved. It depends on the personality of the bus driver, when the bus will leave.
A lot of bus drivers in my town leave 5 minutes late, so they can justify driving fast with a bus through town.
The rest actually leave 5 minutes earlier, to adjust for the traffic congestion.

It's certainly an algorithm to take into account.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version