#include <stdlib.h>	/* atof */
#include <string.h>	/* strcmp */
#include "de.h"
#define a p[0]
#define x0 v0[0]
#define x1 v1[0]
void logistic_init(double p[], double v0[])
{
  a = 4;
  x0 = 0.1;
}
void logistic_options(int argc, char *argv[], double p[], double v0[])
{
  int i;

  for (i=1; i<argc; i++)
    if (strcmp(argv[i], "-a") == 0 && i+1 < argc)
      a = atof(argv[i+1]);
    else if (strcmp(argv[i], "-x") == 0 && i+1 < argc)
      x0 = atof(argv[i+1]);
}
void logistic_map(double p[], double t, double v0[], double v1[])
{
  x1 = a*x0*(1-x0);
}
struct de logistic_de = {
  1, 1, logistic_init, logistic_options, logistic_map,
};
