거듭제곱급수

561 days ago by namy0727

x, i, n = var('x, i, n') @interact def power_series(cn=input_box(1+0*n, label='coefficient', type=SR), x0=input_box(0, label='center', type=SR), radius=input_box(1, label='radius'), order=slider([0..12])): coeff = [cn(n=i) for i in range(order+1)] if order == 0: poly = coeff[0] pretty_print(html('$s_{%s}(x)\;=\;%s$'%(order,latex(poly)))) min_x = x0 - radius max_x = x0 + radius dot = point((x0,coeff[0]),pointsize=80,rgbcolor=(1,0,0)) p = plot(poly, min_x, max_x, rgbcolor=(0,0,1), thickness=2) else: poly = coeff[0] for i in range(1,order+1): poly = poly + coeff[i]*(x-x0)^i pretty_print(html('$s_{%s}(x)\;=\;%s$'%(order,latex(poly)))) min_x = x0 - radius max_x = x0 + radius dot = point((x0,poly(x=x0)),pointsize=80,rgbcolor=(1,0,0)) p = plot(poly, min_x, max_x, rgbcolor=(0,0,1), thickness=2) (dot+p).show() 
       

Click to the left again to hide and once more to show the dynamic interactive window

x, i, n = var('x, i, n') @interact def bessel(radius=input_box(6, label='radius'), order=slider([0..12])): cn = (-1)^n/(4^n*factorial(n)^2) coeff = [cn(n=i) for i in range(order+1)] if order == 0: poly = coeff[0] min_x = -radius max_x = radius dot = point((0,coeff[0]),pointsize=80,rgbcolor=(1,0,0)) p = plot(poly, min_x, max_x, rgbcolor=(0,0,1), thickness=2) else: poly = coeff[0] for i in range(1,order+1): poly = poly + coeff[i]*x^(2*i) pretty_print(html('$s_{%s}(x)\;=\;%s$'%(order,latex(poly)))) min_x = -radius max_x = radius p = plot(poly, min_x, max_x, rgbcolor=(0,0,1), thickness=2) dot = point((0,poly(x=0)),pointsize=80,rgbcolor=(1,0,0)) (dot+p).show(ymin=-1, ymax=2) 
       

Click to the left again to hide and once more to show the dynamic interactive window