Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
0 answers
363 views

Animation of an incremental rotary encoder

While reworking my teaching materials for an exercise of an introductory course on mobile robotics, I recently created a animation/simulation of an incremental rotary encoder, e.g. often used for ...
AlexV's user avatar
  • 7,353
9 votes
2 answers
333 views

Simulating surname convergence in a population

I was curious a few weeks ago about how surnames come and go (mostly on the go). I wanted to know how quickly surnames die out, because (in my simplified simulation world) once the last person with a ...
Drise's user avatar
  • 255
2 votes
1 answer
1k views

Compute the probabilities of getting each of the possible sums when throwing 2 dice, n times

I'm struggling with some coding-inexperience. The code I've written below, is extremely inconvenient and ugly to look at. My question to you is: How can this be done more efficiently? The way I've ...
FrenziedMango's user avatar
4 votes
2 answers
2k views

Processing simulation data from power flow analysis

The intro is a bit long. If you're not interested, then please read the update, and have a look at the specific parts I'm highlighting. I'm very interested in any improvements, but you can assume ...
Stewie Griffin's user avatar
2 votes
2 answers
1k views

Random positioning and movement of a rabbit on a table

I was inspired by this: If you would put a rabbit randomly on a circular table with radius r= 1 meter and it moves 1 meter in a random direction, what is the chance it won't fall off? I decided ...
jdrd's user avatar
  • 23
4 votes
2 answers
846 views

Generating a PANDAS DataFrame of simulated coin tosses

It's taking my machine quite a long time to execute 1 billion (1st loop x 10, 2nd loop x 1000, 3rd loop x 100,000) instructions. Suggestions for performance enhancements? Sources of potential concern: ...
compguy24's user avatar
  • 157
11 votes
2 answers
22k views

Dice-rolling simulator

I know there is a better way to store data. What is the most concise way to simplify this script? ...
PythonBeginner's user avatar