Group Abstract Group Abstract

Message Boards Message Boards

[GiF] Simulation of a Camshaft

Posted 9 years ago
POSTED BY: Greg Hurst
4 Replies

Thanks for sharing! Might be useful at some point! Very courageous of using "çã" in a function name!

POSTED BY: Sander Huisman
Posted 9 years ago

Ha, thanks! I just copied the variable name OP used. It looks like it translates to position in Portuguese.

POSTED BY: Greg Hurst

Thanks for the post. Just a quick note for Wolfram beginners, like me, the code listed here will not run as a standalone simulation. First follow the link to Stack Exchange to find the proceeding code blocks then use the code above to generate the animation. I let this code run for about 10 minutes at 98% CPU and 750 MB RAM before I started troubleshooting and actually read the code ...

Edit: Thanks for the update below. I should have clarified that the 10 minutes of waiting was before I grabbed the needed code from Stack Exchange. Basically I had the kernel trying to solve the function without defining any of the variables. After getting the full code, as you say, it was quick to run.

POSTED BY: Timothy Ewing
Posted 9 years ago

Sorry about that! I've added the code from Stack Exchange to this post.

As for the speed and memory consumption, generating the plot takes me about 94 seconds and uses about 12MB of RAM:

AbsoluteTiming[MaxMemoryUsed[Plot[posiçãoVal[?], {?, 0, 2?}, PlotRange -> {15, 66}]]]
{94.1281, 11679216}

Adding the option PerformanceGoal -> "Speed" improves things in a noticeable way and does not seem to make the plots appear any different. I've gone ahead and added that option in the post. On my machine, it's now about 18 seconds and 3MB of RAM:

AbsoluteTiming[MaxMemoryUsed[Plot[posiçãoVal[?], {?, 0, 2?}, PlotRange -> {15, 66}, 
  PerformanceGoal -> "Speed"]]]
{18.4705, 2907720}

Let me know if you're still having issues.

POSTED BY: Greg Hurst
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard