simulation

vivado simulation error: Iteration limit 10000 is reached

一世执手 提交于 2021-02-17 05:17:51
问题 While I was trying to run the simulation in vivado, I got: ERROR: Iteration limit 10000 is reached. Possible zero delay oscillation detected where simulation time can not advance. Please check your source code. Note that the iteration limit can be changed using switch -maxdeltaid. Time: 10 ns Iteration: 10000 I don't have any initial statement in my module being tested. Could anybody point out where the problem could be? `timescale 1ns / 1ps module mulp( input clk, input rst, input start,

Determine waiting times between plane arrivals python

谁说我不能喝 提交于 2021-02-11 14:46:21
问题 I'm writing a program, that takes 200 planes distributed with the poisson distribution over 12 hours and these planes need to land at an airfield that only has 1 runway. I use the reverse CDF method from the exponential distribution to determine the inter-arrival times. However, I can't seem to calculate the waiting time in the air. E.g. a plane arrives at 100 seconds, takes 75 seconds to land and is done at 175 seconds. Plane 2 arrives at 150 seconds and must wait 175-150 = 25 seconds. How

Random systematic movement in pygame

こ雲淡風輕ζ 提交于 2021-02-11 06:18:37
问题 I am making a Covid simulator and need my balls to move around randomly. However, I want them to stay moving in the first random direction that the chose, and only chnage direction if it hits another cell or hits the wall. My current code is as follow: import random import pygame # --- constants --- (UPPER_CASE_NAMES) GREEN1 = (0, 255, 0) # Healthy cells RED = (255, 0, 0) # Infected cells GREEN2 = (0, 100, 0) # Healthy cells not susecptible BLACK = (0, 0, 0) # Dead cells WHITE = (255, 255,

Random systematic movement in pygame

廉价感情. 提交于 2021-02-11 06:18:26
问题 I am making a Covid simulator and need my balls to move around randomly. However, I want them to stay moving in the first random direction that the chose, and only chnage direction if it hits another cell or hits the wall. My current code is as follow: import random import pygame # --- constants --- (UPPER_CASE_NAMES) GREEN1 = (0, 255, 0) # Healthy cells RED = (255, 0, 0) # Infected cells GREEN2 = (0, 100, 0) # Healthy cells not susecptible BLACK = (0, 0, 0) # Dead cells WHITE = (255, 255,

C++ implementing vector field

独自空忆成欢 提交于 2021-02-08 11:38:57
问题 I'm trying to recreate a Plasma Simulation from Lubos Brieda (Plasma Simulations by Example). In doing so, I need to implement a 3D field filled with physical vectors containing the data of the electric field. (I don't want to use the template, I'm referring to vectors in the mathematical/physical sense.) The book shows the creation of a Field and vec3 class, to create fields of certain types and arrays (vectors) with three components. My goal is to find the easiest way to implement a vector

How can I have a process wait for multiple resources?

时间秒杀一切 提交于 2021-02-07 19:53:56
问题 I am currently using SimPy to model and simulate a server process and I would like this process to execute a different action depending on where it receives this message from. The SimPy documentation shows how to wait for multiple events: Ex: yield event1 | event2 However I am currently trying to wait for a resource to become available from multiple Stores. The scenario is as follows: Server S is waiting for messages that can come from various channels. Each of these channels may have

How can I have a process wait for multiple resources?

て烟熏妆下的殇ゞ 提交于 2021-02-07 19:53:26
问题 I am currently using SimPy to model and simulate a server process and I would like this process to execute a different action depending on where it receives this message from. The SimPy documentation shows how to wait for multiple events: Ex: yield event1 | event2 However I am currently trying to wait for a resource to become available from multiple Stores. The scenario is as follows: Server S is waiting for messages that can come from various channels. Each of these channels may have

Fill matrix with loop

我怕爱的太早我们不能终老 提交于 2021-02-07 14:30:33
问题 I am trying to create a matrix n by k with k mvn covariates using a loop. Quite simple but not working so far... Here is my code: n=1000 k=5 p=100 mu=0 sigma=1 x=matrix(data=NA, nrow=n, ncol=k) for (i in 1:k){ x [[i]]= mvrnorm(n,mu,sigma) } What's missing? 回答1: I see several things here: You may want to set the random seed for replicability ( set.seed(20430) ). This means that every time you run the code, you will get exactly the same set of pseudorandom variates. Next, your data will just be

Fill matrix with loop

拟墨画扇 提交于 2021-02-07 14:29:25
问题 I am trying to create a matrix n by k with k mvn covariates using a loop. Quite simple but not working so far... Here is my code: n=1000 k=5 p=100 mu=0 sigma=1 x=matrix(data=NA, nrow=n, ncol=k) for (i in 1:k){ x [[i]]= mvrnorm(n,mu,sigma) } What's missing? 回答1: I see several things here: You may want to set the random seed for replicability ( set.seed(20430) ). This means that every time you run the code, you will get exactly the same set of pseudorandom variates. Next, your data will just be

Buffon's needle simulation in python

我只是一个虾纸丫 提交于 2021-02-05 11:53:17
问题 import numpy as np import matplotlib.pylab as plt class Buffon_needle_problem: def __init__(self,x,y,n,m): self.x = x #width of the needle self.y = y #witdh of the space self.r = []#coordinated of the centre of the needle self.z = []#measure of the alingment of the needle self.n = n#no of throws self.m = m#no of simulations self.pi_approx = [] def samples(self): # throwing the needles for i in range(self.n): self.r.append(np.random.uniform(0,self.y)) self.z.append(np.random.uniform(0,self.x/2