X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fcomputational_physics.git;a=blobdiff_plain;f=bessel_1.c;fp=bessel_1.c;h=afc0a978f003160165356868429f55e4335fbd09;hp=0000000000000000000000000000000000000000;hb=dbec7a4f63c3acda2e68719cb98d85fd34c91afc;hpb=936dfe8d44eb6beeecb48b201db22bb0d9de9956 diff --git a/bessel_1.c b/bessel_1.c new file mode 100644 index 0000000..afc0a97 --- /dev/null +++ b/bessel_1.c @@ -0,0 +1,56 @@ +#include +#include +#include "g_plot.h" +#include "general.h" + +#define EPSILON .0001 +#define MAX_L 100 +#define R_STEP 0.1 +#define MAX_R 30 + +int main(int argc, char **argv) { + int l; + // int fd; + int i; + double r; + double t; + double delta=2*EPSILON; + double Jl,Jl_1; + + /* + if(argc!=2) { + printf("usage: %s file\n"argv[0]); + return 1; + } + */ + + // for(l=0:lEPSILON) { + t*=-(r*r)/(2*i); + Jl_1+=t; + t*=(1./(2*l+1+i)); + Jl+=t; + delta=absolute_value(t/Jl); + i++; + } + printf("%f %f %f (i=%d)\n",r,Jl,Jl_1,i); + + } + // gp_close(fd); + return 1; +} + +