Skip to content
Snippets Groups Projects
Verified Commit b0e770f3 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added chaos map

parent 7a81a931
Branches
Tags
No related merge requests found
#include <stdio.h>
double map(double x, double lambda) {
return lambda * x * (1.0 - x);
}
int main() {
const double lambda_min = 0.0;
const double lambda_max = 4.0;
const int N = 100;
const double dl = (lambda_max - lambda_min) / N;
int max_iter = 1000;
for (double lambda = 0.0; lambda < lambda_max; lambda += dl) {
double x = 0.5;
for (int i = 0; i < max_iter; ++i) {
printf("x(%d, %g) = %g\n", i, lambda, x);
x = map(x, lambda);
}
printf("\n");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment