void lcd::set_upper_order_bit(unsigned char data)
{
	set_b4(data & 0x01);
	set_b5(data & 0x02);
	set_b6(data & 0x04);
	set_b7(data & 0x08);
}
Exemple #2
0
double rk_main(double alpha,double epsilon,double h_init){
  double x=0,y=1,y4,y5,h=h_init;
  double a[6][6],b5[6],b4[6],c[6];
  set_a(a);
  set_b4(b4);
  set_b5(b5);
  set_c(c);
  printf("#\t%s\t%s\t%s\t%s\n","x","y","h","dy/dx");
  while(x<10.0){
    rk_step(x,y,h,a,b4,c,&y4);
    rk_step(x,y,h,a,b5,c,&y5);
    if(y4-y5<epsilon){
      printf("\t%f\t%f\t%e\t%f\n",x,y,h,f(x));
      x+=h;
      y=y5;
      h=alpha*h*pow(epsilon/fabs(y4-y5),0.2);
    }else{
      h=h/2;
    }
  }
  return y;
}