CFLAGS = -O3 -Wall
LIBS = -L/usr/lib -lm
-API = g_plot.o
-OBJS = newton zentral homogen integral-1_2 integral-2_2 polynom_interpolation kettenbruchentwicklung
+API = g_plot.o general.o
+OBJS = newton zentral homogen integral-1_2 integral-2_2 polynom_interpolation kettenbruchentwicklung bessel_1
all: $(OBJS)
kettenbruchentwicklung: $(API)
$(CC) $(CFLAGS) -o $@ $(API) $(LIBS) kettenbruchentwicklung.c
+bessel_1: $(API)
+ $(CC) $(CFLAGS) -o $@ $(API) $(LIBS) bessel_1.c
+
clean:
rm $(API) $(OBJS)
--- /dev/null
+#include <stdio.h>
+#include <math.h>
+#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:l<MAX_L;l++)
+ l=1;
+
+ for(r=0;r<MAX_R;r+=R_STEP) {
+
+ /* fd */
+ // fd=gp_init(argv[1]);
+
+ i=1;
+ t=1/(fak2(2*l-1));
+ Jl_1=t;
+ t=t/(2*l+1);
+ Jl=t;
+ delta=2*EPSILON;
+ while(delta>EPSILON) {
+ 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;
+}
+
+