simulation

I want to make a virtual keyboard. Do I need to send WM_KEYDOWN to the current active window or HWND_BROADCAST?

I am making an app that simulates a keyboard. I will do it by sending WM_KEYDOWN to a window, but I am not sure where to send the message. to the currently active window or to HWND_BROADCAST? Here is an other question I posted, related to this one. http://stackoverflow.com/questions/2089968/if-i-send-a-wmkeydown-message-using-wndproc-wi...

How do you simulate a serial device?

I am working on driver that talks to a device via a serial port in C#. I do not always have the device available to do physical testing with. Is there a way I can simulate a device on a serial port so that it responds in an ideal manner? ...

Matplotlib in Python - Drawing shapes and animating them

So I'm representing a token ring network (doing the simulation in SimPy), I'm a totally newbie to matplotlib, but I was told that it'd be really good for representing my simulation visually. So I googled around and found out how to draw shapes and lines - using add_patch and add_line respectively to the axes (I believe). So now I have t...

Network simulator

Hi, I'm looking for a network simulator that will simulate a single point-tp-point link between two nodes. I want to be able to: 1. define the sequence of elements from 'a' to 'b' (like: 'a'-encoder-wireless medium-decoder-'b'). 2. define the protocol 'a' is using and from that get some sort of estimate on the packet loss rate of the d...

Simple MATLAB/Octave simulation

This should be a very simple question for anyone who has some experience in this area, but I'm still new to this. I have the following system (or here is an image with better resolution): Given the following input: u = min(2 - t/7.5, 2*(mod(t, 2) < 1)); I need to plot the output of system y. I am describing the system with the fo...

factory floor simulation

I would like to create a simulation of a factory floor, and I am looking for ideas on how to do this. My thoughts so far are: • A factory is a made up of a bunch of processes, some of these processes are in series and some are in parallel. Each process would communicate with it's upstream and downstream and parallel neighbors to let t...

What's the difference between emulation and simulation?

In simple understandable terms, what is the difference between the two terms? [I have already looked at this, this and this] ...

modem.oqpskmod for BER

hi can anyone show how to use the modem.oqpskmod for BER. thanks! h = modem.oqpskmod y = modulate(h, values); g = modem.oqpskdemod(h) z = demodulate(g, y) let's assume that i have array called values which contains only 1s and 0s. my question is how would i calculate BER? of course if above my code is correct. ...

What are some algorithms that will allow me to simulate planetary physics?

I'm interested in doing a "Solar System" simulator that will allow me to simulate the rotational and gravitational forces of planets and stars. I'd like to be able to say, simulate our solar system, and simulate it across varying speeds (ie, watch Earth and other planets rotate around the sun across days, years, etc). I'd like to be ab...

comparing modem.oqpsk probability error and ber

hi currently i have the following code in my matlab values = [0;1;0;0;1;0;1;0]; % can contain only 0s and 1s h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = demodulate(g,y); BER = sum(logical(values(:)-z(:)))/numel(values);% thanks to gnovice! now my question ...

How do I generate discrete random events with a Poisson distribution?

I'm aware of Knuth's algorithm for generating random Poisson distributed numbers (below in Java) but how do I translate that into calling a method, generateEvent(), randomly over time? int poissonRandomNumber(int lambda) { double L = Math.exp(-lambda); int k = 0; double p = 1; do { k = k + 1; double u = ...

Tips for reach performance in OpenGL simulations

Hi, i would like to know some tips, articles or books about performance in OpenGL based simulations ...

simulation of oqpsk

hi for the simulation of oqpsk i have written the below values = [0;1;0;0;1;0;1;0]; h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = logical(demodulate(g,y)); BER = sum(values(:)-z(:))/numel(values); my questions are as follows: 1) how can i verify that it does what i expect it to d...

What content have you made/seen made using procedural techniques

Hey S.O. guys, I was looking at some study i have to do in the future to do with procedural generation techniques and i was wondering what type of content you have: Developed Helped Develop Seen implemented Tried to develop and what methods/techniques/procedures you used to develop it. If you feel generous maybe you can even go into spec...

MATLAB: Question about minimizing a function containing an integral

Does anyone know how to minimize a function containing an integral in MATLAB? The function looks like this: L = Int(t=0,t=T)[(AR-x)dt], A is a system parameter and R and x are related through: dR/dt = axRY - bR, where a and b are constants. dY/dt = -xRY I read somewhere that I can use fminbnd and quad in combination but I am not a...

How to throttle network traffic for environment simulation?

Hello! I'm trying to test an application that uses a database connection. What I would like to do is throttling the bandwith to, say, 1 MBit or such to get a better feeling for the application under realistic conditions. I already use Wireshark to have a look at the communication with the DB and I expected Wireshark to have a feature l...

Robot Simulation in Java

Hi Guys, I am doing a project concerning robot simulation and i need help. I have to simulate the activities of a robot in a warehouse. I am using mindstorm robots and lego's for the warehouse. The point here is i have to simulate all the activities of the robot on a Java GUI. That is whenever the robot is moving, users have to see it o...

How do I press and move the mouse in C#?

Hi, I need to send mouse signals in C# so that other applications register them. To be exact, I need to simulate mouse buttons and the move of the mouse. Is there a way to do this in C#? (Windows) ...

Converting a math problem into a discrete-event simulation

I am trying to implement the SIR epidemic model. Basically, the way I understand the model is that at each time step, it tells us how many nodes get infected and how many nodes are recovered. I am now trying to convert this into an discrete-event simulation and am confused at a point. The model is generally solved using Euler's method. ...

Simulation of molecular dynamics in Python

I am searching for a python package that I can use to simulate molecular dynamics in non-equilibrium situations. I need a setup that can handle a fairly large number of molecules in a primarily kinetic theory manner, and that can handle having solid surfaces present. With regards to the surfaces, I would need to be able to create arbitra...