This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parameters | |
int N = 500; // Grid size | |
float lambda = 10; // Wavelength | |
float k = 2 * PI / lambda; // Wave number | |
float A = 1; // Amplitude | |
float speed = 0.1; // Speed of the animation | |
// Source positions | |
int[] source1 = {N/4, N/2}; | |
int[] source2 = {3 * N/4, N/2}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parameters | |
int N = 500; // Grid size | |
float lambda = 10; // Wavelength | |
float k = 2 * PI / lambda; // Wave number | |
float A = 100; // Amplitude | |
// Source position | |
int[] source = {N/2, N/2}; | |
// Grid and wave array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float amplitude1 = 100; // Amplitude of the first wave | |
float amplitude2 = 50; // Amplitude of the second wave | |
float wavelength1 = 200; // Wavelength of the first wave | |
float wavelength2 = 400; // Wavelength of the second wave | |
float frequency1 = 2*PI/wavelength1; // Frequency of the first wave | |
float frequency2 = 2*PI/wavelength2; // Frequency of the second wave | |
float phase1 = 0; // Phase of the first wave | |
float phase2 = 0; // Phase of the second wave | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Abstract: | |
* Using the ATMEGA328/Arduino in this post, we will use a naive method to generate normally distributed random numbers. | |
* Our first step was to implement density and cumulative normal distribution functions. After that, in order to obtain | |
* an approximate inverse cumulative density function, a lookup table is used and z-values are obtained using linear interpolation. | |
* Using the Shapiro-Wilki test, we validated the normality of a generated number list. | |
*/ | |
#include "support.h" | |
/** |