/* Antialias=on Antialias_Threshold=0.3 Antialias_Depth=3 Input_File_Name=Lenz.pov Output_File_Name=Lenx Initial_Frame=1 Final_Frame=240 Initial_Clock=0 Final_Clock=14 Cyclic_Animation=off Pause_when_Done=off */ #version 3.6; #include "colors.inc" #include "mrg_misc3.inc" global_settings { assumed_gamma 1.0 ambient_light 1 } background {color rgb .0} // ---------------------------------------- camera { location <0.0, 0.75, -4.0>*8 direction 1.5*z right x*image_width/image_height look_at <0.0, 0.0, 0.0> angle 10 } light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <-30, 70, -30> } #declare lclock=clock+0; #declare B0=.2; #declare DB=.5; #declare Bfield = function(tt) { B0+DB*(trans((tt-1)/3)-trans((tt-5)/3)) } #declare QBA = function(tt) { 2*pi*trans((tt-9)/4)} #declare FLUX= function(tt) {Bfield(tt)*cos(QBA(tt))} #declare dtt=1E-6; #declare EMF = function(tt) {(FLUX(tt+dtt)-FLUX(tt))/dtt} #declare nLoops=6; #declare R1=.8; #declare R2=.05; #declare R2wire=pi*R2/nLoops; #declare Lc=0; // coil union{ #while(Lc+<0,0,0,.0>} //no_shadow no_reflection } #declare Lc=Lc+1; #end cylinder{-y,y,R1 scale <1,.0001,1> pigment{color rgbt <0,0,2,.9>} finish{ambient 1 diffuse 0} no_shadow no_reflection } rotate z*degrees(QBA(lclock)) translate x } // external field lines #declare dxB=.1/Bfield(lclock); #declare xBnow=-22*dxB; #while(xBnow<3) #declare xBnow=xBnow+dxB; cylinder{-5*y,5*y,.01 pigment{color rgb <0,.5,.1>} finish{ambient 1 diffuse 0} translate xBnow*x+.05*z no_shadow no_reflection } cone{0,.05,.1*y,.01 pigment{color rgb <0,.5,.1>} finish{ambient 1 diffuse 0} translate xBnow*x+.05*z no_shadow no_reflection } #end // PLOTS union{ /*basic code snippet for plotting a function */ #declare f_to_plot = function(ss) { 3*Bfield(ss)*cos(QBA(ss))} #declare plot_start=0; #declare plot_end=14; #declare plot_ds=.01; #declare plot_vscale=3; #declare plot_now_s=plot_start; #declare plot_now=plot_now_s*x+f_to_plot(plot_now_s)*y; union{ #while(plot_now_s*2} } #declare plot_now=plot_next; #end text { ttf "symbol.ttf", "F", .01, 0 pigment{color rgb <.0,.5,.5>*2} scale 2 translate -.02*z-2.25*x+.5*y } union{ box{-1,1 scale <.20,.20,.001> rotate z*45 } torus{.45,.05 rotate x*90} pigment{color rgb <.15,.5,.5>*3} translate lclock*x+f_to_plot(lclock)*y-.1*z } cylinder{0,plot_end*x,.10 pigment{color rgb <1,1,1>*2} translate .1*z } cylinder{-plot_vscale*y,plot_vscale*y,.10 pigment{color rgb <1,1,1>*2} translate .1*z} scale .25 } // ---------------------------------------- #declare fp_dx=1E-6; #declare fp_to_plot = function(ss) { -2*(f_to_plot(ss+fp_dx)-f_to_plot(ss))/fp_dx} #declare plot_now_s=plot_start; #declare plot_now=plot_now_s*x+fp_to_plot(plot_now_s)*y; union{ #while(plot_now_s*2} } #declare plot_now=plot_next; #end text { ttf "cmsy10.ttf", chr(69), .01, 0 //"cmmi10.ttf", chr(34) pigment{color rgb <.5,.5,.0>*2} scale 2 translate -.02*z-2.25*x+.5*y } union{ box{-1,1 scale <.20,.20,.001> rotate z*45 } torus{.45,.05 rotate x*90} pigment{color rgb <.5,.5,.15>*3} translate lclock*x+fp_to_plot(lclock)*y-.1*z } cylinder{0,plot_end*x,.10 pigment{color rgb <1,1,1>*2} translate .1*z } cylinder{-plot_vscale*y,plot_vscale*y,.10 pigment{color rgb <1,1,1>*2} translate .1*z} scale .25 translate -2*y } box{-.75*x+y,3.62*x-3.125*y+.01*z pigment{color rgb .025} translate .015*z } scale .5 translate -2.5*x-.2*z-.6*y no_shadow no_reflection finish{ambient 2 diffuse 0} } // End PLOTS // coil field lines nad emf #declare dxbcoil=.06/abs(EMF(lclock)); #if(dxbcoil<=R1) merge{ torus{R1+R2*2.4, .01} cone{0.15*x,.04,-.15*x,0 translate -z*(R1+R2*2.4) scale } pigment{color rgb <1,1,0>} finish{ambient 1 diffuse 0} no_shadow no_reflection rotate z*degrees(QBA(lclock)) translate x } #declare ds=1/150; //the basic current element #declare lx = function(ss) {0} #declare ly = function(ss) {R1*sin(2*pi*ss)} #declare lz = function(ss) {R1*cos(2*pi*ss)} //and ancillaries for the current #declare dlx = function(ss) { lx(ss+ds)-lx(ss) } #declare dly = function(ss) { ly(ss+ds)-ly(ss) } #declare dlz = function(ss) { lz(ss+ds)-lz(ss) } #declare lavx = function(ss) { (lx(ss+ds)+lx(ss))*.5 } #declare lavy = function(ss) { (ly(ss+ds)+ly(ss))*.5 } #declare lavz = function(ss) { (lz(ss+ds)+lz(ss))*.5 } //Bield for one loop at r_fp rel to loop's orign #macro BL1(rfpt) #local sl = 0; #declare BL1_ans = 0; #while(sl<1) #local rloc=rfpt-; //from sourcept to field pt #local dlloc=; #declare BL1_ans=BL1_ans-vcross(dlloc,rloc)*pow(vlength(rloc),-3); #local sl=sl+ds; #end #end #declare fl=union{ #declare yn=0; #while(yn } finish { // (---surface finish---) ambient 1.0 specular 0.0 } } #declare fldir=union{ #declare yn=0; #while(yn translate yn*y+.075*x } #declare yn=yn+dxbcoil; #end } union{ object{fl texture{mrg_green_texture} no_shadow no_reflection} object{fl texture{mrg_green_texture} scale <-1,1,1> no_shadow no_reflection} object{fl texture{mrg_green_texture} scale <-1,-1,1> no_shadow no_reflection} object{fl texture{mrg_green_texture} scale <1,-1,1> no_shadow no_reflection} object{fldir texture{mrg_green_texture} no_shadow no_reflection} object{fldir texture{mrg_green_texture} scale <1,-1,1> no_shadow no_reflection} rotate z*90 rotate z*degrees(QBA(lclock)) translate x } #end