simulation

How to depict small charges on a spherical object using vpython library?

How to depict small charges on a spherical object using vpython library? Question: I am working on a project related to charge distribution on the sphere and I decided to simulate the problem using vpython and Coulomb’s law. I ran into an issue when I created a sphere because I am trying to evenly place …

Total answers: 2

Bifurcation diagram of dynamical system

Bifurcation diagram of dynamical system Question: TL:DR How can one implement a bifurcation diagram of a seasonally forced epidemiological model such as SEIR (susceptible, exposed, infected, recovered) in Python? I already know how to implement the model itself and display a sampled time series (see this stackoverflow question), but I am struggling with reproducing a …

Total answers: 1

Demonstrating the Universality of the Uniform using numpy – an issue with transformation

Demonstrating the Universality of the Uniform using numpy – an issue with transformation Question: Recently I wanted to demonstrate generating a continuous random variable using the universality of the Uniform. For that, I wanted to use the combination of numpy and matplotlib. However, the generated random variable seems a little bit off to me – …

Total answers: 1

Calculating Average Performance Measures in M/M/1 System Using SimPy

Calculating Average Performance Measures in M/M/1 System Using SimPy Question: I am seeking to calculate the average waiting times, and average service times in the following M/M/1 queueing system, but I am not able to calculate the averages. It writes down to the console each customer’s arrival, waiting and service times, but I also want …

Total answers: 1

How to terminate simulation in SimPy 4

How to terminate simulation in SimPy 4 Question: Is there a way to terminate the simpy simulation by using a command like env.exit()? I don’t understand how to place an event into env.run(until=event). I want to terminate the simulation when there are no objects left in my certain Simpy Stores. How can I do that? …

Total answers: 2

Python Rand function

Python Rand function Question: Background In Julia programming we have a Rand function which sintaxis is : rand([rng=GLOBAL_RNG], [S], [dims…]) which pick a random element or array of random elements from the set of values specified by S and gives an array of dimension of the third arg. Question I want to apply the same …

Total answers: 1

Emulate Touch Event in Windows 8 using Python

Emulate Touch Event in Windows 8 using Python Question: I am trying to write a sort of driver using python for windows 8. I will be receiving touch coordinates via serial which I then want to use to make it appear as though someone touched those coordinates on the screen (emulate a touch). My first …

Total answers: 2

How to make virtual organisms learn using neural networks?

How to make virtual organisms learn using neural networks? Question: I’m making a simple learning simulation, where there are multiple organisms on screen. They’re supposed to learn how to eat, using their simple neural networks. They have 4 neurons, and each neuron activates movement in one direction (it’s a 2D plane viewed from the bird’s …

Total answers: 6

Modeling a linear system with Python

Modeling a linear system with Python Question: I would like to simulate/model a closed-loop, linear, time-invariant system (specifically a locked PLL approximation) with python. Each sub-block within the model has a known transfer function which is given in terms of complex frequency H(s) = K / ( s * tau + 1 ). Using the …

Total answers: 4