Exemplo n.º 1
0
void do_sh_range(double *ystart, double *yend) {
  double parlo, parhi, dpar, temp;
  int npar, i, j, ierr;
  int side, cycle, icol, color;
  char bob[50];

  if (set_up_sh_range() == 0)
    return;
  swap_color(&color, 0);
  parhi = shoot_range.phigh;
  parlo = shoot_range.plow;
  npar = shoot_range.steps;
  dpar = (parhi - parlo) / (double)npar;
  side = shoot_range.side;
  cycle = shoot_range.cycle;
  storind = 0;
  icol = 0;
  if (shoot_range.movie == 1)
    reset_film();
  for (i = 0; i <= npar; i++) {
    temp = parlo + dpar * (double)i;
    set_val(shoot_range.item, temp);
    sprintf(bob, "%s=%.16g", shoot_range.item, temp);
    x11_status_bar_set_text(main_status_bar, bob);
    if (shoot_range.movie == 1)
      clr_scrn();

    bvshoot(ystart, yend, BVP_TOL, BVP_EPS, BVP_MAXIT, &ierr, NODE, 0, 0, 0, 0,
            0.0);
    if (ierr == ABORT)
      continue;
    if (ierr < 0) {
      bad_shoot(ierr);

      set_browser_data(storage, storind, NEQ + 1);
      swap_color(&color, 1);
      return;
    }
    storage[0][storind] = temp;
    if (side == 0)
      for (j = 0; j < NODE; j++)
        storage[j + 1][storind] = ystart[j];
    else
      for (j = 0; j < NODE; j++)
        storage[j + 1][storind] = yend[j];
    storind++;
    set_cycle(cycle, &icol);
    get_ic(0, ystart);
    last_shot(0);
    if (shoot_range.movie == 1)
      film_clip();
    ping();
  }
  set_browser_data(storage, storind, NEQ + 1);
  auto_freeze_it();
  swap_color(&color, 1);
}
Exemplo n.º 2
0
four_back()
{
 if(FOUR_HERE){
   set_browser_data(my_four,1);
   /*   my_browser.data=my_four;
	my_browser.col0=1; */
   refresh_browser(four_len);
 }
}
Exemplo n.º 3
0
hist_back()
{
 if(HIST_HERE){
   set_browser_data(my_hist,1);
   /*
   my_browser.data=my_hist;
   my_browser.col0=1; */
   refresh_browser(hist_len);
 }
}
Exemplo n.º 4
0
void view_table(int index) {
  int i;
  int n = my_table[index].n, len;
  double *y = my_table[index].y;
  double xlo = my_table[index].xlo, dx = my_table[index].dx;
  len = n;
  if (len >= MAXSTOR)
    len = MAXSTOR - 1;
  for (i = 0; i < len; i++) {
    storage[0][i] = xlo + i * dx;
    storage[1][i] = y[i];
  }
  set_browser_data(storage, len, 2);
}
Exemplo n.º 5
0
void find_bvp_com(int com) {
  int ishow = 0, iret;
  int iper = 0, ivar = 0, ipar = 0, pflag;
  double sect = 0.0;
  double oldpar;
  double ystart[MAXODE], oldtrans;
  double yend[MAXODE];
  /*  Window temp=main_win; */
  if (NMarkov > 0 || NKernel > 0) {
    err_msg("Can't do BVP with integral or markov eqns");
    return;
  }
  wipe_rep();
  data_back();
  compile_bvp();
  if (FFT || HIST || DelayFlag || BVP_FLAG == 0)
    return;
  STORFLAG = 0;
  RANGE_FLAG = 1;
  POIMAP = 0;
  oldtrans = TRANS;
  TRANS = 0.0;
  get_ic(1, ystart);
  switch (com) {
  case 0:
    do_sh_range(ystart, yend);
    return;
  case 4:
    set_up_homoclinic();
    return;
  case 3:
    if (NUPAR == 0)
      goto bye;
    pflag = set_up_periodic(&ipar, &ivar, &sect, &ishow);
    if (pflag == 0)
      goto bye;
    iper = 1;
    get_val(upar_names[ipar], &oldpar);
    break;

  case 2:
    ishow = 1;
    iper = 0;
    break;
  case 1:
  default:
    iper = 0;
    break;
  }
  if (iper)
    bvshoot(ystart, yend, BVP_TOL, BVP_EPS, BVP_MAXIT, &iret, NODE, ishow, iper,
            ipar, ivar, sect);
  else
    bvshoot(ystart, yend, BVP_TOL, BVP_EPS, BVP_MAXIT, &iret, NODE, ishow, 0, 0,
            0, 0.0);
  bad_shoot(iret);
  if (iret == GOODSHOT || iret == NOCHANGE) {
    get_ic(0, ystart);
    redraw_ics();
    if (ishow) {
      reset_graphics();
    }
    last_shot(1);
    INFLAG = 1;
    set_browser_data(storage, storind, NEQ + 1);
    auto_freeze_it();
    ping();
  } else if (iper)
    set_val(upar_names[ipar], oldpar);

bye:
  TRANS = oldtrans;
}