Message Boards Message Boards

[✓] Plot roller coaster mathematics?

GROUPS:

Hi,

I found an article on Roller Coasters in Mathematica http://library.wolfram.com/infocenter/Articles/1217/#downloads But unfortunately I do not succeed in getting any graphical output, nothing is shown...

u = 0; While[u <= 4 \[Pi], u = u + uStep[u];
 Show[tube[u], track,
  Axes -> False, 
  PlotRange -> {{-2.25, 2.25}, {-1.1, 1.1}, {-2.25, 2.25}},
  Boxed -> False, DisplayFunction -> $DisplayFunction]]; Clear[u]

I suppose as this code was made back in 1999 that in Mathematica 11.2 the commands must be given differently. Who can make this code display something?

Kind regards, Bert

POSTED BY: Bert Aerts
Answer
2 months ago

I should think it would require a definition for tube[]. Other than that, probably the DisplayFunction -> $DisplayFunction can be removed.

POSTED BY: Daniel Lichtblau
Answer
2 months ago

Dear Bert,

the code seems to work just fine form me (MMA11.2).

You might want to modify the last lines like so:

Monitor[list = {}; u = 0; While[u <= 2 \[Pi], u = u + uStep[u];
AppendTo[list,Show[tube[u], track, ViewPoint -> {3, -2, 1}, Axes -> False, PlotRange -> {{-3.6, 3}, {-3.3, 3.3}, {-2.1, 2.4}}]]], u]

If you then run

ListAnimate[list]

you get

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Answer
2 months ago

Thank you very much Marco !!

POSTED BY: Bert Aerts
Answer
2 months ago

Group Abstract Group Abstract