Questions tagged [simulation]

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviours of a selected physical or abstract system.

5194 questions
1
vote
1 answer

Grouping data points into a cluster

I am trying to follow a cluster of data points and investigate the rms radius of the cluster over time. However, I am unsure how to go about doing this if I am only looking trying to group some of my data into 1 cluster. I am trying to group…
Oliver Moore
  • 317
  • 1
  • 12
1
vote
0 answers

Electrostatic Force - Simulate Trajectory of Test Particle using Runge Kutta - Force always Repels

In the center of a 2D-Plane a positive static charge Q is placed with position r_prime. This charge creates a static electrical Field E. Now i want to place a test particle with charge Q and position vector r in this static E-Field and compute its…
tester931
  • 47
  • 4
1
vote
1 answer

Calculating rms Radius of a Globular Cluster

I am coding a simulation of a globular cluster in python, starting with particles of the same mass and 0 initial velocity in a random spherical distribution. I am trying to investigate the root-mean-square radius of the system over time and trying…
Oliver Moore
  • 317
  • 1
  • 12
1
vote
1 answer

R: Understanding the Differences Between Two Plots

I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/3d-line-plots/ I copy and pasted the following code and successfully created this plot: library(plotly) data <-…
stats_noob
  • 5,401
  • 4
  • 27
  • 83
1
vote
2 answers

Random Walk Simulation in R

I'm trying to plot multiple simple Random Walks in R, but am having problems doing so. Please be aware that by simple Random Walk I mean the Sum of Random Variables that can either be {-1} or {1} with each values having the same probability, not…
user82931
  • 13
  • 3
1
vote
1 answer

Generate simulated data in Python while meeting a range of correlations with respect to a predefined variable

Let's denote refVar, a variable of interest that contains experimental data. For the simulation study, I would like to generate other variables V0.05, V0.10, V0.15 until V0.95. Note that for the variable name, the value following V represents the…
Amilovsky
  • 397
  • 6
  • 15
1
vote
1 answer

YOSYS simulating a combinatorial circuit with a specific input

I have a very simple combinatorial circuit written in .blif, such as: .model circuit .inputs a b .outputs c .names a b c 11 1 .end Now I'd like to simulate it with yosys, and I'd like to specify the input. Basically, I am trying to replicate…
Eelah
  • 11
  • 1
1
vote
1 answer

Any Logic Road traffic Simulation

Hy, I am making a AnyLogic Road traffic simulation. I want to add an event i.e., when an Ambulance cames in road traffic, all the cars lower their speed and came on low lane to give Ambulance space. Any help on how to control cars vehicles speed and…
1
vote
1 answer

run function recursively over table

Every call to function fx left-joins a new column to x based on some data in table t and integers p and q. I show desired iteration over values of p and q below but do not know how to do it properly using KDB+ iterators. Sample data and…
Gerry
  • 606
  • 6
  • 16
1
vote
1 answer

Quarter Time While Loop

For my Python text based basketball sim, I am trying to figure out the best way to sim the time for the game. Currently I have this: time_runoff = random.randrange(10,24) quarter_clock = quarter_clock - time_runoff After every play, the…
1
vote
0 answers

Simulating power for multilevel models (lme/lmer) in R: issue with broom::tidy

last year around August I wrote the following code to simulate power for multilevel models. It worked fine for a long time, but now it seems that broom::tidy() has been deprecated for multilevel models. I don't understand how this impacts my code…
1
vote
0 answers

Can I create and store a snapshot of a simpy simulation?

I am building a simulation of a production process using simpy and an agent (Heuristic or Reinforcement Learning via tensorforce) that allocates orders to stations in the production system. Every simulation starts with an empty production system…
OPFx
  • 11
  • 1
1
vote
1 answer

N-body simulation python

I am trying to code an N-body simulation code in python and have successfully managed to produce a system involving the Sun, Earth and Jupiter as below using a leapfrog approximation method. However, when I try and extend the same code for N bodies…
1
vote
2 answers

Generate data with simsem package in R

I would like to generate data with the simsem package in R. So far, I've done this: # create data with simsem package ## factor loadings loading <- matrix(0, 7) loading[1,1] <- NA LY2 <- bind(loading, 1) ##…
Tabea
  • 47
  • 5
1
vote
2 answers

Random sample from another table's column

I am trying to figure out how to populate a "fake" column by choosing randomly from another table column. So far this was easy using an array and the rantbl() function as there were not a lot of modalities. data want; set have; array values[2] $10…
Kermit
  • 3,112
  • 2
  • 10
  • 34
1 2 3
99
100