├── local.h ├── ode ├── hedge.ode ├── bob.ode ├── tstar.ode ├── a.out ├── bob.so ├── e.so ├── efm.so ├── efx.so ├── ex.so ├── iaf.ode ├── t.so ├── anim.gif ├── bobx.so ├── efbl.so ├── efmwn.so ├── efmx.so ├── efmxt.so ├── examw.so ├── examx.so ├── examy.so ├── examz.so ├── nthet.so ├── ai.ode ├── efmble.so ├── efmx64.so ├── efmxgpu.so ├── efnobl.so ├── example.so ├── getmax.so ├── getmin.so ├── rossler.ode ├── test.ode ├── example.dylib ├── example64.so ├── triple.ode ├── lorknead_0.gif ├── wave.ani ├── wavepp.ani ├── dae_ex1.ode ├── dumbbvp.ode ├── testdll.ode ├── chemo.ani ├── crazy.ode ├── gausvolt.ode ├── angela.ode ├── phs.ode ├── dae_ex2.ode ├── lo.ode ├── tstvol3.ode ├── dde.ode ├── nc.ani ├── simplecube.ode ├── pend-cart1.ani ├── vanderpol.ode ├── efm.ode ├── voltex3.ode ├── wcstim.ani ├── voltex1.ode ├── voltex2.ode ├── elaspen.ani ├── dae.ode ├── efmplot.ode ├── forcpend.ode ├── voltex4.ode ├── wcring.ode ├── fish.ani ├── dae_ex3.ode ├── myret.ode ├── bnn.ode ├── V0.tab ├── fhn3d.ode ├── greg.ode ├── nochaos.ode ├── ecofilip.ode ├── delta.ode ├── invpend.ani ├── vdp.ode ├── fhn_noise.ode ├── tstdll2.ode ├── nnet.ode ├── transient.ode ├── nnet2.ode ├── invpend.ode ├── lin.ode ├── pHtools_simple.ode ├── t.c ├── tstvol2.ode ├── kohox.ode ├── efmx.ode ├── geisel.ode ├── kuramot100.ode ├── torus.ode ├── waterwheel.ani ├── julia.ode ├── fhn.ode ├── pp.ode ├── vtst.ode ├── del_log.ode ├── kepler.ode ├── efmxrun.ode ├── tstdel.ode ├── amari.ode ├── junk.ode ├── junk2.ode ├── amari2.ode ├── kuramot100w.ode ├── nthet.ode ├── pend.ani ├── amarig.ode ├── efmxfb.ode ├── kuramot100m.ode ├── doubpend.ani ├── pendx.ode ├── wcstim.ode ├── borcol.ode ├── getfrefm.ode ├── duck2.ani ├── tstdelsp.ode ├── 6x6.ani ├── getmin.c ├── henhei.ode ├── lamprey.ode ├── sine-circel.ode ├── wave.ode ├── getmax.c ├── chemotax.ode ├── lorenz.ode ├── delay.ode ├── lorenz.ani ├── coaster2D.ani ├── duck.ani ├── ev1.ode ├── evelyn.ode ├── wta.ode ├── doubpend.ode ├── cable.ode ├── osc.ode ├── r3b.ode ├── fieldnoy.ode ├── lor2.ode ├── lamomeg.ode ├── toy.ani ├── pend2.ani ├── pendx.ani ├── duck3.ani ├── jcoaster.old.ani ├── atcoaster.ani ├── minode.ode ├── acoaster.ani ├── tsthomi.ode ├── vlsi.ode ├── ielaspen.ani ├── lecwave.ode ├── gill_bruss.ode ├── lorknead.ode ├── pend.ode ├── idoubpend.ani ├── elaspen.ode ├── pend-cart1.ode ├── itoy.ani ├── logbif.ode ├── jcoaster.ani ├── jcoaster1.ani ├── mlvolt.ode ├── waterwheel.ode ├── lecdiff200.ode ├── lorenz2.ode ├── ielaspen.ode ├── idoubpend.ode ├── ml1.ode ├── lecsimp2.ode ├── efmxplot.ode ├── pend-cart1-kick.ode ├── fancylorenz.ode ├── example.c ├── examx.c ├── efmxplott.ode ├── kohonen.ode ├── tstheti.ode ├── cuplamdif.ode ├── ml-range.ode ├── cobweb2.ode ├── lecar.ode.pars ├── osc1.ani ├── osc.ani ├── junk1.fig ├── bob.dat ├── coaster2D.ode ├── duck.ode ├── duckx.ode ├── koho.ode ├── hhred.ode ├── lamvolt.ode ├── nthet.c ├── acoaster.ode ├── fr.ode ├── atcoaster.ode └── clustor.ode ├── tstauto ├── dumb.ode ├── bigaut.ode ├── simplefold.ode ├── tsthom.ode ├── dumbvp.ode ├── lo.ode ├── exp.ode ├── lamom.ode ├── phs2.ode ├── phssimp.ode ├── ab.ode ├── lamom2.ode ├── phsmod.ode ├── brper.ode ├── pp2.ode ├── tsthom3.ode ├── wcbiwave.ode ├── bistable.ode ├── frcp.ode ├── pf.ode ├── pen.ode ├── tsthom2.ode ├── torx.ode ├── eiz-hom.ode ├── san.ode └── she.ode ├── tree.pdf ├── install.pdf ├── xpp_doc.pdf ├── xpp_sum.pdf ├── XppBetty-1.2.6.jar ├── XppBettyGui-1.2.6.jar ├── canonical ├── 10x10.ani ├── huygens.ani ├── tyson.ode ├── mackey.ode ├── wcfun.ode ├── sine-circle.ode ├── swindale.ode ├── ratchet.ode ├── exdaebvp.ode ├── qif-noise.ode ├── gb_wnet.ode ├── cgl.ode ├── huygens.ode ├── gberg.ode ├── gberga.ode ├── 10x10.ode └── fp.ode ├── help ├── odes │ ├── volt4.ode │ ├── dae.ode │ ├── volt1.ode │ ├── volt3.ode │ ├── bvp1.ode │ ├── front.ode │ ├── volt2.ode │ ├── mg.ode │ ├── singint.ode │ ├── third.ode │ ├── del_log.ode │ ├── frontx.ode │ ├── tyson.ode │ ├── ppdll.ode │ ├── ratchet.ode │ ├── wc.ode │ ├── pp.c │ ├── front.c │ ├── wcnet.ode │ ├── schnak.ode │ └── schnak2.ode ├── xpprestore.html ├── xppcont.html ├── xpperase.html ├── xppxivst.html ├── xpppara.html ├── xppphase.html ├── xpp3d.html ├── xppkine.html ├── xppwind.html ├── xppview.html └── xpphalf.html ├── help_defs.h ├── getvar.h ├── my_pars.h ├── run_auto.h ├── d_imag.c ├── shoot.h ├── abort.h ├── autlim.h ├── endfile.h ├── derived.h ├── rubber.h ├── storage.h ├── d_sign.c ├── Makefile.s2x ├── z_abs.c ├── pow_dd.c ├── i_nint.c ├── r_lg10.c ├── i_dnnt.c ├── d_lg10.c ├── volterra.h ├── torus.h ├── Makefile.lib ├── toons.h ├── dialog_box.h ├── mykeydef.h ├── z_exp.c ├── kinescope.h ├── z_log.c ├── calc.h ├── extra.h ├── newhome.h ├── default.opt ├── xpplim.h ├── dae_fun.h ├── txtread.h ├── cv2.h ├── delay_handle.h ├── choice_box.h ├── my_rhs.h ├── cuda ├── mlgpu.ode ├── mlgpueul.ode ├── mlcpu.ode ├── ml_noc.ode └── README ├── menu.h ├── cabs.c ├── pow_di.c ├── color.h ├── userbut.h ├── pow_ii.c ├── home.bitmap ├── linedn.bitmap ├── lineup.bitmap ├── pagedn.bitmap ├── pageup.bitmap ├── xppaut-stylesheet2.css ├── eig_list.h ├── xppaut-stylesheet.css ├── comline.h ├── read_dir.h ├── pp_shoot.h ├── tabular.h ├── alert.bitmap ├── auto_def2.h ├── info.bitmap ├── start.bitmap ├── axes2.h ├── lunch-new.h ├── filebrowse.bitmap ├── simplenet.h ├── volterra2.h ├── my_ps.h ├── my_svg.h ├── bc.bitmap ├── ic.bitmap ├── auto.bitmap ├── eqns.bitmap ├── array.bitmap ├── delay.bitmap ├── graph.bitmap ├── param.bitmap ├── aniwin.bitmap ├── browse.bitmap ├── equilib.bitmap ├── txtview.bitmap ├── stiff.h ├── changes.txt ├── newpars.h ├── xAuto.h ├── numerics.h ├── autevd.h ├── main.h ├── worker2.c ├── markov.h ├── del_stab.h ├── myfonts.h ├── adj2.h ├── phsplan.h ├── histogram.h ├── tutor.h ├── diagram.h └── scrngif.h /local.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ode/hedge.ode: -------------------------------------------------------------------------------- 1 | x'= 2 | y'=eps*x 3 | -------------------------------------------------------------------------------- /ode/bob.ode: -------------------------------------------------------------------------------- 1 | x'=y 2 | y'=-x 3 | done 4 | -------------------------------------------------------------------------------- /ode/tstar.ode: -------------------------------------------------------------------------------- 1 | x[0..20]'=-x[j]+[j 2 | done 3 | -------------------------------------------------------------------------------- /tstauto/dumb.ode: -------------------------------------------------------------------------------- 1 | x[1..195]'=-x[j]+p 2 | par p=0 3 | d 4 | -------------------------------------------------------------------------------- /tstauto/bigaut.ode: -------------------------------------------------------------------------------- 1 | x[1..350]'=-x[j]+p 2 | par p=0 3 | d 4 | -------------------------------------------------------------------------------- /tstauto/simplefold.ode: -------------------------------------------------------------------------------- 1 | x'=a*x+b-x^3 2 | par b=1,a=1 3 | done 4 | -------------------------------------------------------------------------------- /ode/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/a.out -------------------------------------------------------------------------------- /ode/bob.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/bob.so -------------------------------------------------------------------------------- /ode/e.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/e.so -------------------------------------------------------------------------------- /ode/efm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efm.so -------------------------------------------------------------------------------- /ode/efx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efx.so -------------------------------------------------------------------------------- /ode/ex.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/ex.so -------------------------------------------------------------------------------- /ode/iaf.ode: -------------------------------------------------------------------------------- 1 | v'=-v+i 2 | par i=1.2 3 | global 1 v-1 {v=-.5} 4 | done 5 | -------------------------------------------------------------------------------- /ode/t.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/t.so -------------------------------------------------------------------------------- /tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/tree.pdf -------------------------------------------------------------------------------- /tstauto/tsthom.ode: -------------------------------------------------------------------------------- 1 | x'=y 2 | y'=x*(1-x)-a*y+b*x*y 3 | par a=0,b=0 4 | done -------------------------------------------------------------------------------- /install.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/install.pdf -------------------------------------------------------------------------------- /ode/anim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/anim.gif -------------------------------------------------------------------------------- /ode/bobx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/bobx.so -------------------------------------------------------------------------------- /ode/efbl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efbl.so -------------------------------------------------------------------------------- /ode/efmwn.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmwn.so -------------------------------------------------------------------------------- /ode/efmx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmx.so -------------------------------------------------------------------------------- /ode/efmxt.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmxt.so -------------------------------------------------------------------------------- /ode/examw.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/examw.so -------------------------------------------------------------------------------- /ode/examx.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/examx.so -------------------------------------------------------------------------------- /ode/examy.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/examy.so -------------------------------------------------------------------------------- /ode/examz.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/examz.so -------------------------------------------------------------------------------- /ode/nthet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/nthet.so -------------------------------------------------------------------------------- /xpp_doc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/xpp_doc.pdf -------------------------------------------------------------------------------- /xpp_sum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/xpp_sum.pdf -------------------------------------------------------------------------------- /ode/ai.ode: -------------------------------------------------------------------------------- 1 | br'=0 2 | iapp'=0 3 | phi'=0 4 | per'=0 5 | v'=0 6 | w'=0 7 | done 8 | -------------------------------------------------------------------------------- /ode/efmble.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmble.so -------------------------------------------------------------------------------- /ode/efmx64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmx64.so -------------------------------------------------------------------------------- /ode/efmxgpu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efmxgpu.so -------------------------------------------------------------------------------- /ode/efnobl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/efnobl.so -------------------------------------------------------------------------------- /ode/example.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/example.so -------------------------------------------------------------------------------- /ode/getmax.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/getmax.so -------------------------------------------------------------------------------- /ode/getmin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/getmin.so -------------------------------------------------------------------------------- /ode/rossler.ode: -------------------------------------------------------------------------------- 1 | x'=-y-z 2 | y'=x+b*y 3 | z'=b+z*(x-a) 4 | par b=.2,a=4 5 | done 6 | -------------------------------------------------------------------------------- /ode/test.ode: -------------------------------------------------------------------------------- 1 | fact(x)=if(x<=0)then(1)else(x*fact(x-1)) 2 | y'=-y 3 | done 4 | 5 | -------------------------------------------------------------------------------- /tstauto/dumbvp.ode: -------------------------------------------------------------------------------- 1 | x'=y 2 | y'=x 3 | b y 4 | b x'-a 5 | par a=0 6 | @ total=1 7 | d -------------------------------------------------------------------------------- /ode/example.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/example.dylib -------------------------------------------------------------------------------- /ode/example64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/example64.so -------------------------------------------------------------------------------- /ode/triple.ode: -------------------------------------------------------------------------------- 1 | x'=y 2 | y'=z 3 | z'=-a*z-b*y-c*x+x^2 4 | par c=1,a=2,b=1 5 | done 6 | -------------------------------------------------------------------------------- /tstauto/lo.ode: -------------------------------------------------------------------------------- 1 | r=x^2+y^2 2 | par a=-1 3 | x'=a*x-r*x+y 4 | y'=a*y-r*y-x 5 | done 6 | -------------------------------------------------------------------------------- /XppBetty-1.2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/XppBetty-1.2.6.jar -------------------------------------------------------------------------------- /ode/lorknead_0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/ode/lorknead_0.gif -------------------------------------------------------------------------------- /ode/wave.ani: -------------------------------------------------------------------------------- 1 | # animated wave 2 | fcircle .05+.04*[0..20];.5*(vv[j]+1);.02;1-w[j] 3 | end 4 | -------------------------------------------------------------------------------- /ode/wavepp.ani: -------------------------------------------------------------------------------- 1 | # wave phaseplane 2 | fcircle .5*(vv[0..20]+1);w[j];.02;[j]/20 3 | end 4 | -------------------------------------------------------------------------------- /XppBettyGui-1.2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ermentrout/xppaut/HEAD/XppBettyGui-1.2.6.jar -------------------------------------------------------------------------------- /ode/dae_ex1.ode: -------------------------------------------------------------------------------- 1 | # dae_ex1.ode 2 | x'=-x 3 | 0= x+y-1 4 | x(0)=1 5 | solv y 6 | aux yy=y 7 | done -------------------------------------------------------------------------------- /ode/dumbbvp.ode: -------------------------------------------------------------------------------- 1 | x'=y 2 | y'=x 3 | b x-y' 4 | b y-a 5 | par a=1 6 | @ total=1 7 | done 8 | 9 | -------------------------------------------------------------------------------- /ode/testdll.ode: -------------------------------------------------------------------------------- 1 | x'=xp 2 | par flag=0 3 | export {x} {xp} 4 | init x=1 5 | xp=0 6 | done 7 | 8 | -------------------------------------------------------------------------------- /canonical/10x10.ani: -------------------------------------------------------------------------------- 1 | frect x([0..99])/10;y([j])/10;x([j])/10+.1;y([j])/10+.1;x[j]/(2*pi) 2 | end 3 | -------------------------------------------------------------------------------- /help/odes/volt4.ode: -------------------------------------------------------------------------------- 1 | # singular integral equation 2 | u(t)=exp(-t)-int[.25]{exp(-t)#sin(u)} 3 | done 4 | -------------------------------------------------------------------------------- /help_defs.h: -------------------------------------------------------------------------------- 1 | #define MAIN_HELP 0 2 | #define NUM_HELP 2 3 | #define FILE_HELP 1 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ode/chemo.ani: -------------------------------------------------------------------------------- 1 | fcircle [0..100]/101;b[j]/10;.01 2 | fcircle [0..100]/101;(a[j]+1)/2;.01;$RED 3 | end 4 | -------------------------------------------------------------------------------- /tstauto/exp.ode: -------------------------------------------------------------------------------- 1 | u0'=u1 2 | u1'=-p0*exp(u0) 3 | par p0=0,p1=0 4 | b u0 5 | b u0'-p1 6 | @ total=1,dt=.01 7 | d -------------------------------------------------------------------------------- /ode/crazy.ode: -------------------------------------------------------------------------------- 1 | x'=-y+sin(1/x)*x^2 2 | y'=x 3 | @ xp=x,yp=y,xlo=-2,xhi=2,ylo=-2,yhi=2 4 | @ nmesh=101 5 | done 6 | -------------------------------------------------------------------------------- /ode/gausvolt.ode: -------------------------------------------------------------------------------- 1 | x'=a*int{exp(-(t-t0)^2)#x*(1-x)} 2 | par a=2.5,t0=1 3 | init x=.2 4 | @ autoeval=1 5 | done 6 | -------------------------------------------------------------------------------- /ode/angela.ode: -------------------------------------------------------------------------------- 1 | k(t)=5*exp(-2*t)-4*exp(-t) 2 | f(u,v)=v+u*(1-u^2-v^2) 3 | u'=f(u,int{k(t)#u}) 4 | init u=.2 5 | done -------------------------------------------------------------------------------- /ode/phs.ode: -------------------------------------------------------------------------------- 1 | x'=1+sin(y-x) 2 | y'=a+sin(x-y) 3 | par a=1 4 | init x=0,y=0 5 | @ total=6.28,dt=.01 6 | done 7 | 8 | -------------------------------------------------------------------------------- /ode/dae_ex2.ode: -------------------------------------------------------------------------------- 1 | # dae_ex2.ode 2 | x'=xp 3 | 0= xp+exp(xp)+x 4 | x(0)=-3.7182 5 | solv xp=1 6 | aux xdot=xp 7 | done 8 | -------------------------------------------------------------------------------- /ode/lo.ode: -------------------------------------------------------------------------------- 1 | r=lam-x^2-y^2 2 | om=1+q*(x^2+y^2) 3 | x'=lam*x-om*y 4 | y'=lam*y+om*x 5 | par lam=-2 6 | par q=0 7 | done 8 | -------------------------------------------------------------------------------- /tstauto/lamom.ode: -------------------------------------------------------------------------------- 1 | ss=x^2+y^2 2 | par a=1 3 | x'=x*(a-ss)-y 4 | y'=y*(a-ss)+x 5 | @ total=6.28 6 | init x=1 7 | done 8 | -------------------------------------------------------------------------------- /getvar.h: -------------------------------------------------------------------------------- 1 | 2 | #define SETVAR(i,x) if((i)i); 10 | } 11 | -------------------------------------------------------------------------------- /help/odes/singint.ode: -------------------------------------------------------------------------------- 1 | # a singular integral equation 2 | u(t)=exp(-t/2)*sqrt(t)+(4/3)*exp(-t)*sqrt(t^3)-int[.5]{exp(-t)#u^2} 3 | # and the true solution 4 | aux utrue=exp(-t/2)*sqrt(t) 5 | done 6 | -------------------------------------------------------------------------------- /help/odes/third.ode: -------------------------------------------------------------------------------- 1 | # third.ode 2 | x'=y 3 | y'=z 4 | z'=x^2-a*z-b*y-c*x 5 | par a=1,b=2,c=3.7 6 | init x=1,y=0,z=0 7 | @ total=200 8 | @ xp=x,yp=y,xlo=-2,xhi=5,ylo=-4,yhi=5 9 | done 10 | -------------------------------------------------------------------------------- /ode/bnn.ode: -------------------------------------------------------------------------------- 1 | f(x)=1/(1+exp(-x)) 2 | u'=k*(-u+f(beta*(w-th)))/c 3 | w'=k*z 4 | z'=k*(w-u) 5 | par beta=30,th=.2,c=1.7453,k=1 6 | @ total=12 7 | @ xp=u,yp=z,xlo=-.1,xhi=1.1,ylo=-.1,yhi=1.1 8 | d 9 | -------------------------------------------------------------------------------- /shoot.h: -------------------------------------------------------------------------------- 1 | #ifndef _shoot_h_ 2 | #define _shoot_h_ 3 | 4 | typedef struct { 5 | int *com; 6 | char *string; 7 | char *name; 8 | int side; 9 | } BC_STRUCT; 10 | 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tstauto/bistable.ode: -------------------------------------------------------------------------------- 1 | # -c v' = f(v) + v'' 2 | # 3 | @ total=20 4 | f(v)=v*(1-v)*(v-a)+p 5 | par c=.56 6 | par a=.1,p=0.0 7 | v'=vp 8 | vp'=-c*vp-f(v) 9 | i v=.995,vp=-.0039366 10 | d 11 | -------------------------------------------------------------------------------- /ode/V0.tab: -------------------------------------------------------------------------------- 1 | 11 2 | -5 3 | 5 4 | 0.0909091 5 | 0.0909091 6 | 0.0909091 7 | 0.0909091 8 | 0.0909091 9 | 0.0909091 10 | 0.0909091 11 | 0.0909091 12 | 0.0909091 13 | 0.0909091 14 | 0.0909091 15 | -------------------------------------------------------------------------------- /ode/fhn3d.ode: -------------------------------------------------------------------------------- 1 | # Forced Fitzhugh-Nagumo fhn.ode 2 | dv/dt = f(v)-w+I 3 | i'=0 4 | dw/dt = eps*(v-gamma*w) 5 | f(v)=v*(1-v)*(v-a) 6 | param a=.25,eps=.05,gamma=1 7 | @ total=100,dt=.2,xhi=100 8 | done 9 | -------------------------------------------------------------------------------- /ode/greg.ode: -------------------------------------------------------------------------------- 1 | #paramters to be varied to see the effect of fitcurve 2 | 3 | param k=1 4 | 5 | #equations 6 | 7 | a'=-k*a 8 | 9 | #intial conditions 10 | 11 | init a=1 12 | 13 | done 14 | -------------------------------------------------------------------------------- /ode/nochaos.ode: -------------------------------------------------------------------------------- 1 | # this map is fractal but not chaotic 2 | x1'=3*tanh(x1)*cos(x2) 3 | x2'=2*pi*mod(x2/(2*pi)+0.618033988749894848,1) 4 | init x1=.1,x2=.1 5 | @ total=30000,meth=disc,maxstor=40000 6 | done 7 | -------------------------------------------------------------------------------- /help/odes/del_log.ode: -------------------------------------------------------------------------------- 1 | # delayed logistic map 2 | x'=y 3 | y'=a*y*(1-x) 4 | par a=2.2 5 | init x=.2,y=.2 6 | # set method to discrete 7 | @ total=100,meth=discrete 8 | @ ylo=-.1,yhi=1,xhi=100 9 | done 10 | -------------------------------------------------------------------------------- /ode/ecofilip.ode: -------------------------------------------------------------------------------- 1 | par p=.3,e=1 2 | par a=1,c=1,d1=1,d2=1,q=1,b=3 3 | x1'=-(a+d1)*x1+b*x2/(c+x2) 4 | x2'=a*x1-d2*x2-heav(x2-p)*q*e*x2 5 | @ xp=x1,yp=x2,xlo=-.2,xhi=2,ylo=-.2,yhi=2 6 | @ nmesh=100,dt=.02 7 | d 8 | -------------------------------------------------------------------------------- /ode/delta.ode: -------------------------------------------------------------------------------- 1 | # delta coupled oscillators delta.ode 2 | x'=1 3 | y'=w 4 | global 1 {x-2*pi} {x=0;y=b*r(y)+y} 5 | global 1 {y-2*pi} {y=0;x=b*r(x)+x} 6 | r(x)=sin(x+phi)-sin(phi) 7 | par b=-.25,phi=0,w=1.0 8 | done 9 | -------------------------------------------------------------------------------- /ode/invpend.ani: -------------------------------------------------------------------------------- 1 | # animation for inverted pendulum 2 | PERMANENT 3 | line 0;.5;1;.5;$BLACK;3 4 | TRANSIENT 5 | line .5;.5;.5+.4*sin(th);.5-.4*cos(th);$BLUE;2 6 | fcircle .5+.4*sin(th);.5-.4*cos(th);.05;$RED 7 | end 8 | -------------------------------------------------------------------------------- /tstauto/frcp.ode: -------------------------------------------------------------------------------- 1 | ss=x*x+y*y 2 | v'=(v*(v-a)*(1-v)-w)/eps 3 | w'=v-d*w-(b+r*x) 4 | x'=x+bet*y-x*ss 5 | y'=y-bet*x-y*ss 6 | par a=.5,b=.5,r=0,eps=.005,bet=100,d=1.0 7 | init v=.5,w=0,x=0,y=1 8 | @ total=.0628,dt=.0001 9 | done -------------------------------------------------------------------------------- /abort.h: -------------------------------------------------------------------------------- 1 | #ifndef _abort_h_ 2 | #define _abort_h_ 3 | 4 | 5 | /* abort.c */ 6 | int get_command_width(void); 7 | void plot_command(int nit, int icount, int cwidth); 8 | int my_abort(void); 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /autlim.h: -------------------------------------------------------------------------------- 1 | /* change 200 to whatever to get the dimensions right */ 2 | #define NAUTO 400 3 | #define N3AUTO (3*NAUTO+2) 4 | #define NxNAUTO (NAUTO*NAUTO) 5 | #define NPAUTO (NAUTO*20) 6 | #define NFAUTO (NAUTO*(2*NAUTO+20)) 7 | 8 | -------------------------------------------------------------------------------- /endfile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _endfile_h_ 3 | #define _endfile_h_ 4 | 5 | #include "f2c.h" 6 | #include "fio.h" 7 | 8 | /* endfile.c */ 9 | integer f_end(alist *a); 10 | int t_runc(alist *a); 11 | 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /ode/vdp.ode: -------------------------------------------------------------------------------- 1 | # The van der Pol Oscillator with a frequuency parameter and 2 | # periodic boundary conditions 3 | p om=6.6 4 | x'=xp*om 5 | xp'=(-x+xp*(1-x^2))*om 6 | x(0)=1 7 | bndry x-x' 8 | bndry xp-xp' 9 | d 10 | 11 | -------------------------------------------------------------------------------- /derived.h: -------------------------------------------------------------------------------- 1 | #ifndef _derived_h 2 | #define _derived_h 3 | 4 | 5 | void free_derived(void); 6 | int compile_derived(void); 7 | void evaluate_derived(void); 8 | int add_derived(char *name, char *rhs); 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /ode/fhn_noise.ode: -------------------------------------------------------------------------------- 1 | # Forced Fitzhugh-Nagumo fhn.ode 2 | wiener n 3 | dv/dt = f(v)-w+I_0+sig*n 4 | dw/dt = eps*(v-gamma*w) 5 | f(v)=v*(1-v)*(v-a) 6 | param a=.25,eps=.1,gamma=1,I_0=.25,sig=.1 7 | @ total=1000,dt=.05,meth=euler 8 | done 9 | -------------------------------------------------------------------------------- /ode/tstdll2.ode: -------------------------------------------------------------------------------- 1 | x'=xp 2 | y'=yp 3 | # these are dummies holding the RHS 4 | xp=0 5 | yp=0 6 | export {x,y,a,b,c,d,t} {yp} 7 | export {} {yp} 8 | par a=1,b=1,c=1,d=1 9 | init x=1 10 | # @ dll_lib=example.so,dll_fun=vdp 11 | done -------------------------------------------------------------------------------- /ode/nnet.ode: -------------------------------------------------------------------------------- 1 | # The Wilson-Cowan neural net equations 2 | # The phaseplane is fun to create 3 | p w11=8,w12=-6,w21=10,w22=-1,tau=3 4 | p s1=-2,s2=-6 5 | f(x)= 1/(1+exp(-x)) 6 | x'= -x+f(w11*x+w12*y+s1) 7 | y'= (-y+f(w21*x+w22*y+s2))/tau 8 | d 9 | -------------------------------------------------------------------------------- /ode/transient.ode: -------------------------------------------------------------------------------- 1 | # a problem with cool transients 2 | x'=-x-5*y-z*y 3 | y'=-y-85*x-x*z 4 | z'=z/2+x*y+1 5 | init x=8,y=2,z=1 6 | @ dt=.002,total=20,bound=1000,maxstor=12000,meth=qualrk 7 | @ xp=x,yp=z,xlo=-125,xhi=125,ylo=-125,yhi=10 8 | done 9 | -------------------------------------------------------------------------------- /ode/nnet2.ode: -------------------------------------------------------------------------------- 1 | # neural network 2 | tabular wgt % 25 -12 12 1/25 3 | f(u)=1/(1+exp(-beta*u)) 4 | special k=conv(even,51,12,wgt,u0) 5 | u[0..50]'=-u[j]+f(a*k([j])-thr) 6 | par c=2,a=4,beta=10,thr=1 7 | aux junk[5..10]=k([j]) 8 | done 9 | 10 | -------------------------------------------------------------------------------- /tstauto/pf.ode: -------------------------------------------------------------------------------- 1 | # load this in XPP 2 | # click File AUTO, in Autom Run Steady ststr 3 | x'=r*x-x^3 4 | p r=-1 5 | init x=0 6 | @ dsmax=.1,parmin=-2,parmax=2 7 | @ autoxmin=-1.25,autoxmax=2 8 | @ autoymin=-2,autoymax=2 9 | @ autovar=x 10 | d 11 | -------------------------------------------------------------------------------- /ode/invpend.ode: -------------------------------------------------------------------------------- 1 | # the inverted pendulum driven periodically 2 | # start at 0 and give it a push 3 | par a=.3,omega=10,k=.1 4 | th'=v 5 | v'=-k*v-(1+a*omega*omega*cos(omega*t))*sin(th) 6 | init th=0,v=3 7 | @ meth=qualrk,total=30 8 | done 9 | 10 | -------------------------------------------------------------------------------- /ode/lin.ode: -------------------------------------------------------------------------------- 1 | # Generic linear equation 2 | # 3 | init x=2,y=0 4 | p a=1,b=0,c=0,d=-1 5 | #f(z)=z/(1+z^2) 6 | f(z)=z 7 | only x,y 8 | x'= a*x+b*y 9 | y'= f(c*x+d*y) 10 | #aux z=if(x>c)then(a*y)else(b*x) 11 | d 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ode/pHtools_simple.ode: -------------------------------------------------------------------------------- 1 | #Demonstrates basic syntax of the module 2 | #We create a buffer calculate its initial pH and then exit 3 | 4 | mksol mysol 5 | addtosol mysol {'Lactic',0.01,'Malic',0.01,'NaBenzoate',0.01} 6 | pHsol mysol pH pHrhs 7 | 8 | done 9 | -------------------------------------------------------------------------------- /ode/t.c: -------------------------------------------------------------------------------- 1 | #include 2 | /* 3 | some example functions 4 | */ 5 | 6 | lv(double *in,double *out,int nin,int nout,double *var,double *con) 7 | { 8 | if(con[2]<.5)printf("Here ya go \n"); 9 | out[0]=-in[0]; 10 | con[2]=1; 11 | } 12 | -------------------------------------------------------------------------------- /canonical/huygens.ani: -------------------------------------------------------------------------------- 1 | # don't have the cart in this one - just the pendulums 2 | line .35;.1;.35;.85;$BLACK;3 3 | line .35;.85;.35+.45*sin(p1);.85-.45*cos(p1);$RED;6 4 | line .65;.1;.65;.85;$BLACK;3 5 | line .65;.85;.65+.45*sin(p2);.85-.45*cos(p1);$BLUE;6 6 | end -------------------------------------------------------------------------------- /help/odes/frontx.ode: -------------------------------------------------------------------------------- 1 | # wave front in bistable RD model 2 | f(u)=u*(1-u)*(u-a) 3 | u[0..80]'=up[j] 4 | up0=f(u0)+d*(u1-u0) 5 | up[1..79]=f(u[j])+d*(u[j-1]+u[j+1]-2*u[j]) 6 | up80=f(u80)+d*(u79-u80) 7 | par a=.1,d=.25,n=81 8 | init u[0..4]=1 9 | done 10 | -------------------------------------------------------------------------------- /ode/tstvol2.ode: -------------------------------------------------------------------------------- 1 | # Volterra example from Peter Linz's book 2 | # solution is f1=1,f2=t but it is unstable 3 | f1(0)=1 4 | f1(t)=exp(-t)-t^2/2 + int{exp(-t)#f1*f1}+int{f2} 5 | f2(t)=t-t^4/24+int{t#f2*f2/(1+f1*f1)} 6 | @ yplot=f2,total=5,xhi=5,yhi=5 7 | d 8 | 9 | -------------------------------------------------------------------------------- /rubber.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _rubber_h 3 | #define _rubber_h 4 | 5 | #include 6 | 7 | 8 | int rubber(int *x1, int *y1, int *x2, int *y2, Window w, int f); 9 | void rbox(int i1, int j1, int i2, int j2, Window w, int f); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /storage.h: -------------------------------------------------------------------------------- 1 | #ifndef _storage_h_ 2 | #define _storage_h_ 3 | 4 | void init_alloc_info(void); 5 | void alloc_meth(void); 6 | void init_stor(int nrow, int ncol); 7 | void free_storage(int ncol); 8 | int reallocstor(int ncol,int nrow); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /d_sign.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double d_sign(a,b) doublereal a, b; 5 | #else 6 | double d_sign(doublereal a, doublereal b) 7 | #endif 8 | { 9 | double x; 10 | x = (a >= 0 ? a : - a); 11 | return( b >= 0 ? x : -x); 12 | } 13 | -------------------------------------------------------------------------------- /tstauto/pen.ode: -------------------------------------------------------------------------------- 1 | par gamma=.175,eps=.1,ri=.4 2 | @ total=1.573879,dt=.01 3 | ph1'=ps1 4 | ph2'=ps2 5 | ps1'=-eps * ps1 - sin(ph1) + ri + gamma * (ph2 - ph1) 6 | ps2'=-eps * ps2 - sin(ph2) + ri + gamma * (ph1 - ph2) 7 | init ph1=1.24,ph2=1.24,ps1=4.078,ps2=4.078 8 | d -------------------------------------------------------------------------------- /Makefile.s2x: -------------------------------------------------------------------------------- 1 | CFLAGS=-g -O -I/usr/local/include -I/usr/local/include/sbml 2 | LDFLAGS=-L/usr/local/lib 3 | SRC=sbml2xpp.c 4 | OBJ=sbml2xpp.o 5 | LIBS= -lsbml -lexpat 6 | CC= gcc 7 | s2x: $(OBJ) 8 | $(CC) -o s2x $(OBJ) $(CFLAGS) $(LDFLAGS) $(LIBS) 9 | 10 | 11 | -------------------------------------------------------------------------------- /canonical/tyson.ode: -------------------------------------------------------------------------------- 1 | # tyson.ode 2 | init u=.0075,v=.48,m=1 3 | p k1=.015,k4=200,k6=2,a=.0001,b=.005 4 | u'= k4*(v-u)*(a+u^2) - k6*u 5 | v'= k1*m - k6*u 6 | m'= b*m 7 | global -1 {u-.2} {m=.5*m} 8 | @ total=1000,meth=8,dt=.25 9 | @ xhi=1000,ylo=0,yhi=2,yp=m 10 | done -------------------------------------------------------------------------------- /help/odes/tyson.ode: -------------------------------------------------------------------------------- 1 | # tyson.ode 2 | init u=.0075,v=.48,m=1 3 | p k1=.015,k4=200,k6=2,a=.0001,b=.005 4 | u'= k4*(v-u)*(a+u^2) - k6*u 5 | v'= k1*m - k6*u 6 | m'= b*m 7 | global 1 {0.2-u} {m=.5*m} 8 | @ total=1000,nout=10 9 | @ yp=m,xhi=1000,ylo=0,yhi=2 10 | done 11 | -------------------------------------------------------------------------------- /ode/kohox.ode: -------------------------------------------------------------------------------- 1 | # kohox.ode 2 | par ntot=100,k=1 3 | z=2*ran(1)-1 4 | h(u)=(.5+.5*cos(2*pi*u*k/ntot))^sig 5 | par sig=20,eps=.1 6 | ihot=flr(ran(1)*100) 7 | w[0..99]'=w[j]+eps*(z-w[j])*h(ihot-[j]) 8 | ip'=ihot 9 | aux zz=z 10 | @ meth=discrete,total=2000 11 | done 12 | -------------------------------------------------------------------------------- /z_abs.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double f__cabs(); 5 | double z_abs(z) doublecomplex *z; 6 | #else 7 | double f__cabs(double, double); 8 | double z_abs(doublecomplex *z) 9 | #endif 10 | { 11 | return( f__cabs( z->r, z->i ) ); 12 | } 13 | -------------------------------------------------------------------------------- /canonical/mackey.ode: -------------------------------------------------------------------------------- 1 | # mackey.ode 2 | # mackey-glass equations 3 | x'=-g*x+b*f(delay(x,tau)) 4 | init x=.5 5 | f(u)=u/(1+u^n) 6 | # delayed value of x 7 | aux xdel=delay(x,tau) 8 | par tau=6,g=.1,b=.2,n=10 9 | @ delay=30,total=600,nout=10 10 | @ xhi=600,yhi=2 11 | done 12 | -------------------------------------------------------------------------------- /ode/efmx.ode: -------------------------------------------------------------------------------- 1 | # 2 | # gcc -fPIC -dynamiclib -arch i386 efmx.c -o efx.so 3 | par ibar=-.5,isig=.3333,nsig=0,tau=10 4 | par nit=200,nn=100,ntr=100 5 | init s=-.25 6 | s'=sp 7 | sp=0 8 | aux spp=sp 9 | export {s,ibar,isig,nsig,tau,nit,ntr,nn} {sp} 10 | @ meth=euler 11 | done -------------------------------------------------------------------------------- /ode/geisel.ode: -------------------------------------------------------------------------------- 1 | # an example due to Geisel with 1/f spectral properties 2 | par a=1.5,b=.5 3 | x'=u 4 | y'=v 5 | u'=(a+b*cos(y))*sin(x) 6 | v'=(a+b*cos(x))*sin(y) 7 | init x=-30,y=-50,u=1,v=.5 8 | @ total=8000,dt=.25,maxstor=100000,bound=100000,meth=qualrk 9 | done 10 | -------------------------------------------------------------------------------- /ode/kuramot100.ode: -------------------------------------------------------------------------------- 1 | # kuramoto with sums 2 | h(phi)=sin(phi+a)-sin(a)+b*sin(2*phi) 3 | par a=.5,b=.2 4 | # linear gradient 5 | par amp=1,k=1 6 | table w % 100 0 99 amp*t/100 7 | x[0..99]'=w([j])+k*sum(0,99)of(h(shift(x0,i')-x[j]))/100 8 | @ total=100,bound=100000 9 | d 10 | -------------------------------------------------------------------------------- /ode/torus.ode: -------------------------------------------------------------------------------- 1 | # A differential equation on the Torus. Use the "phAse spc" option to 2 | # integrate it. 3 | init x=1.5,y 4 | p w1=1,w2=1,beta=1 5 | x'= w1+beta*sin(y-x) 6 | y'= w2+beta*sin(x-y) 7 | @ xp=x,yp=y,xlo=0,ylo=0,xhi=6.3,yhi=6.3,tor_per=6.28318531 8 | @ fold=x,fold=y 9 | d -------------------------------------------------------------------------------- /ode/waterwheel.ani: -------------------------------------------------------------------------------- 1 | # waterwheel animation file 2 | # here is the faucet 3 | frect .39;1;.41;.95;$BLACK 4 | frect .395;.95;.405;.93-.03*ran(1);$BLUE 5 | # 6 | # here is the waterwheel 7 | line .4;.4;x[0..9];y[j];[j]/10 8 | line x[0..9];y[j];x[j];yc[j];$BLUE;4 9 | done 10 | -------------------------------------------------------------------------------- /ode/julia.ode: -------------------------------------------------------------------------------- 1 | # julia set for z -> z^2+c 2 | par cx=0,cy=0 3 | r=sqrt(sqrt((x-cx)^2+(y-cy)^2)) 4 | th=atan2(y-cy,x-cx)/2 5 | s=sign(ran(1)-.5) 6 | x'=s*r*cos(th) 7 | y'=s*r*sin(th) 8 | @ total=2000, meth=disc,transient=100,xlo=-2,ylo=-2,xhi=2,yhi=2,xp=x 9 | @ yp=y 10 | done 11 | -------------------------------------------------------------------------------- /pow_dd.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double pow(); 5 | double pow_dd(ap, bp) doublereal *ap, *bp; 6 | #else 7 | #undef abs 8 | #include "math.h" 9 | double pow_dd(doublereal *ap, doublereal *bp) 10 | #endif 11 | { 12 | return(pow(*ap, *bp) ); 13 | } 14 | -------------------------------------------------------------------------------- /i_nint.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double floor(); 5 | integer i_nint(x) real *x; 6 | #else 7 | #undef abs 8 | #include "math.h" 9 | integer i_nint(real *x) 10 | #endif 11 | { 12 | return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x)); 13 | } 14 | -------------------------------------------------------------------------------- /ode/fhn.ode: -------------------------------------------------------------------------------- 1 | # Forced Fitzhugh-Nagumo fhn.ode 2 | dv/dt = f(v)-w+s(t)+I_0 3 | dw/dt = eps*(v-gamma*w) 4 | f(v)=v*(1-v)*(v-a) 5 | s(t)=al*sin(omega*t) 6 | param a=.25,eps=.05,gamma=1,I_0=.25 7 | param al=0,omega=2 8 | @ total=100,dt=.2,xhi=100 9 | @ nplot=2,xp2=t,yp2=w 10 | done 11 | -------------------------------------------------------------------------------- /ode/pp.ode: -------------------------------------------------------------------------------- 1 | # cts predator prey model 2 | # Test problem from the AUTO manual pp.ode 3 | # Use AUTO with defaults -- just click Run 4 | p p0=0,p1=3,p2=5,p3=3 5 | u0' = p1*u0*(1-u0)-u0*u1-p0*(1-ep0) 6 | u1' = -u1+p3*u0*u1 7 | ep0=exp(-p2*u0) 8 | u0(0)=.33333 9 | u1(0)=2.0 10 | d 11 | -------------------------------------------------------------------------------- /ode/vtst.ode: -------------------------------------------------------------------------------- 1 | # this solves a continuous functional iteration problem 2 | # in the Volterra solver, change MaxPoints to 10 to get fast performance 3 | # 4 | # fool XPP 5 | z=int{0#u} 6 | # 7 | volt u=1.5*sin(t)+.5*delay(u,pi) 8 | aux ut=sin(t) 9 | @ delay=4,total=80 10 | done 11 | -------------------------------------------------------------------------------- /r_lg10.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #define log10e 0.43429448190325182765 4 | 5 | #ifdef KR_headers 6 | double log(); 7 | double r_lg10(x) real x; 8 | #else 9 | #undef abs 10 | #include "math.h" 11 | double r_lg10(real x) 12 | #endif 13 | { 14 | return( log10e * log(x) ); 15 | } 16 | -------------------------------------------------------------------------------- /i_dnnt.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double floor(); 5 | integer i_dnnt(x) doublereal *x; 6 | #else 7 | #undef abs 8 | #include "math.h" 9 | integer i_dnnt(doublereal *x) 10 | #endif 11 | { 12 | return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x)); 13 | } 14 | -------------------------------------------------------------------------------- /ode/del_log.ode: -------------------------------------------------------------------------------- 1 | # illustrates a period 7 continuation for the delayed logistic map 2 | y'=x 3 | x'=r*x*(1-y)+eps 4 | par r=2.177,eps=0 5 | init x=.11,y=.21 6 | @ meth=discrete,total=100,njmp=7 7 | @ autoxmin=2.17,autoxmax=2.21,autoymin=0,autoymax=1 8 | @ dsmax=.025,dsmin=.00001,parmin=2,parmax=2.5 9 | done -------------------------------------------------------------------------------- /ode/kepler.ode: -------------------------------------------------------------------------------- 1 | # Kepler model kepler.ode 2 | 3 | init x1=1.e-4,x2=1.e-4,z=0 4 | p eps=.1,a=1 5 | x1' = x1*(1-x1-z*x2) 6 | x2'= z*(a*x2*(1-x1-x2)+eps*x1) 7 | # the markov variable and its transition matrix 8 | markov z 2 9 | {0} {eps*x1} 10 | {0} {0} 11 | aux dd=x2-x1 12 | done 13 | 14 | 15 | -------------------------------------------------------------------------------- /d_lg10.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #define log10e 0.43429448190325182765 4 | 5 | #ifdef KR_headers 6 | double log(); 7 | double d_lg10(x) doublereal *x; 8 | #else 9 | #undef abs 10 | #include "math.h" 11 | double d_lg10(doublereal *x) 12 | #endif 13 | { 14 | return( log10e * log(*x) ); 15 | } 16 | -------------------------------------------------------------------------------- /ode/efmxrun.ode: -------------------------------------------------------------------------------- 1 | par ibar=-.5,isig=.3333,nsig=0.25,tau=10 2 | par nit=200,nn=128,ntr=128 3 | @ meth=euler,total=50,dt=.2 4 | init s=.5 5 | s'=sp 6 | sdot'=(-sdot+sp)*5 7 | sp=0 8 | @ bound=1000000000 9 | @ xp=s,yp=sdot,xlo=-1,xhi=3,ylo=-.1,yhi=.2 10 | export {s,ibar,isig,nsig,tau,nit,ntr,nn} {sp} 11 | done -------------------------------------------------------------------------------- /ode/tstdel.ode: -------------------------------------------------------------------------------- 1 | @ total=20,delay=6 2 | @ autoeval=0 3 | table w % 100 0 99 ran(1) 4 | table td % 100 0 99 5*ran(1) 5 | special k1=mmult(10,10,w,u0) 6 | special k2=delmmult(10,10,w,td,u0) 7 | f(u)=u/(1+u^2) 8 | u[0..9]'=c0-u[j]-c1*f(k1([j]))-c2*f(k2([j])) 9 | @ total=50 10 | par c0=.5,c1=1,c2=0 11 | d 12 | -------------------------------------------------------------------------------- /ode/amari.ode: -------------------------------------------------------------------------------- 1 | # amari bump 2 | mh(x)=exp(-abs(x))-c*b*exp(-b*abs(x)) 3 | par c=1.05,b=.5 4 | table w % 101 -50 50 mh(dx*t)*dx 5 | par dx=.1 6 | fu[0..199]=heav(u[j]) 7 | special z=conv(even,200,50,w,fu0) 8 | u[0..199]'=-u[j]-h+z([j]) 9 | par h=.15 10 | @ total=100,meth=euler 11 | init u[90..110]=.8 12 | done 13 | -------------------------------------------------------------------------------- /volterra.h: -------------------------------------------------------------------------------- 1 | #ifndef _volterra_h_ 2 | #define _volterra_h_ 3 | 4 | #define KN_OLD 1 5 | #define KN 0 6 | typedef struct { 7 | double k_n1,k_n,sum,betnn,mu,*al,*cnv; 8 | int *formula,flag,*kerform; 9 | char name[20],*expr,*kerexpr; 10 | }KERNEL; 11 | 12 | 13 | #endif 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /help/odes/ppdll.ode: -------------------------------------------------------------------------------- 1 | # pp.ode with dlls 2 | # 3 | # xp,yp are the right-hand sides 4 | x'=xp 5 | y'=yp 6 | # a,b are parameters 7 | par a=.4,c=0 8 | init x=.1,y=.2 9 | # dummies to allocate storage 10 | xp=0 11 | yp=0 12 | # here is the main communication 13 | export {a,c,x,y} {xp,yp} 14 | @ total=50 15 | done 16 | -------------------------------------------------------------------------------- /ode/junk.ode: -------------------------------------------------------------------------------- 1 | # junk.ode 2 | table w % 11 -5 5 1/11 3 | # table w % 11 -5 5 1/11 - .2*heav(3-abs(t)) 4 | special bob=conv(period,51,5,w,v0) 5 | v[0..50]'=-v[j]+f(k*bob([j])-thr-c*delay(v[j],tau)) 6 | par k=3,thr=.5,beta=10,c=2.5,tau=5 7 | f(u)=1/(1+exp(-beta*u)) 8 | v[0..4](0)=1 9 | @ delay=10,total=40 10 | done 11 | -------------------------------------------------------------------------------- /ode/junk2.ode: -------------------------------------------------------------------------------- 1 | # junk2.ode 2 | table w % 255 0 255 .4*ran(1) 3 | table ind % 255 0 255 flr(51*ran(1)) 4 | special bob=sparse(51,5,w,ind,v0) 5 | #v0'=-v0+f(k*bob(0)-thr-c*delay(v0,tau)) 6 | v[0..50]'=-v[j]+f(k*bob([j])-thr-c*delay(v[j],tau)) 7 | par k=3,thr=1,beta=1,c=2.5,tau=5 8 | f(u)=1/(1+exp(-beta*u)) 9 | done 10 | -------------------------------------------------------------------------------- /ode/amari2.ode: -------------------------------------------------------------------------------- 1 | # amari bump 2 | f(upre,upost)=heav(upre) 3 | mh(x)=exp(-abs(x))-c*b*exp(-b*abs(x)) 4 | par c=1.05,b=.5 5 | table w % 101 -50 50 mh(dx*t)*dx 6 | par dx=.1 7 | special z=fconv(even,200,50,w,u0,u0,f) 8 | u[0..199]'=-u[j]-h+z([j]) 9 | par h=.15 10 | @ total=100,meth=euler 11 | init u[90..110]=.8 12 | done 13 | -------------------------------------------------------------------------------- /ode/kuramot100w.ode: -------------------------------------------------------------------------------- 1 | # kuramoto with sums 2 | h(phi)=sin(phi+a)-sin(a)+b*sin(2*phi) 3 | par a=.5,b=.2 4 | # linear gradient 5 | par amp=1,k=1 6 | table w % 100 0 99 amp*t/100 7 | table mm % 10000 0 9999 1/100 8 | x[0..99]'=w([j])+k*sum(0,99)of(mm([j]*100+i')*h(shift(x0,i')-x[j])) 9 | @ total=100,bound=100000 10 | d 11 | -------------------------------------------------------------------------------- /ode/nthet.ode: -------------------------------------------------------------------------------- 1 | c[0..99]=cos(x[j]) 2 | # stot=sum(0,99)of(shift(s0,i'))/100 3 | stot=.25 4 | s[0..99]'=exp(-20*(1+c[j]))*(1-s[j])-s[j]/tau 5 | x[0..99]'=1-c[j]+(1+c[j])*(-a+g*stot+sig*w[j]) 6 | wiener w[0..99] 7 | par a=.05,g=.2,tau=20,sig=.2 8 | aux st=sum(0,99)of(shift(s0,i'))/100 9 | @ meth=euler,total=100 10 | done 11 | -------------------------------------------------------------------------------- /ode/pend.ani: -------------------------------------------------------------------------------- 1 | # animation file for pendulum 2 | line .5;.5;.5+.4*sin(x);.5-.4*cos(x);$BLACK;3 3 | fcircle .5+.4*sin(x);.5-.4*cos(x);.05;$RED 4 | # comet .5+.4*sin(x);.5-.4*cos(x);-6;5;$RED 5 | end 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /torus.h: -------------------------------------------------------------------------------- 1 | #ifndef _torus_h_ 2 | #define _torus_h_ 3 | 4 | #include 5 | 6 | void do_torus_com(int c); 7 | void draw_tor_var(int i); 8 | void draw_torus_box(Window win); 9 | void choose_torus(void); 10 | void make_tor_box(char *title); 11 | void do_torus_events(void); 12 | 13 | 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Makefile.lib: -------------------------------------------------------------------------------- 1 | # 2 | # library 3 | # 4 | MYLIB=example 5 | MYLIB_OBJ=funexample.o 6 | 7 | $(MYLIB): $(MYLIB_OBJ) 8 | $(CC) -shared -o libexample.so $(MYLIB_OBJ) 9 | 10 | 11 | funexample.o: funexample.c 12 | $(CC) -fpic -c funexample.c 13 | 14 | # 15 | # export LD_LIBRARY_PATH=. 16 | # 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /help/odes/ratchet.ode: -------------------------------------------------------------------------------- 1 | # a simple thermal ratchet 2 | wiener w 3 | par a=.8,s=.05,r0=.1,r1=.1 4 | f(x)=if(x 6 | fun(double *in,double *out,int nin,int nout,double *var,double *con) 7 | { 8 | int nmin=(int)in[0],i; 9 | int nmax=(int)in[1]; 10 | double d=var[nmin+1],dnew; 11 | for(i=nmin;i<=nmax;i++){ 12 | dnew=fabs(var[i+1]); 13 | if(dnew 2 | fun(double *in,double *out,int nin,int nout,double *var,double *con) 3 | { 4 | double z=in[0]; 5 | int nmax=(int)in[1]; 6 | int i,ihot=0; 7 | double d=1000,dnew; 8 | for(i=1;i<=nmax;i++){ 9 | dnew=fabs(var[i]-z); 10 | if(dnew 6 | #include "struct.h" 7 | 8 | int get_dialog(char *wname, char *name, char *value, char *ok, char *cancel, int max); 9 | int dialog_event_loop(DIALOG *d, int max, int *pos, int *col); 10 | void display_dialog(Window w, DIALOG d, int pos, int col); 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /mykeydef.h: -------------------------------------------------------------------------------- 1 | #ifndef _mykeydef_h_ 2 | #define _mykeydef_h_ 3 | 4 | #define RIGHT 6 5 | #define LEFT 2 6 | #define UP 16 7 | #define PGUP 22 8 | #define PGDN 21 9 | #define DOWN 14 10 | #define HOME 1 11 | #define END 5 12 | #define DEL 9 13 | #define BKSP 8 14 | #define FINE 13 15 | #define ESC 27 16 | #define TAB 10 17 | #define BADKEY 0 18 | 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ode/chemotax.ode: -------------------------------------------------------------------------------- 1 | # bacterial chemotaxis model 2 | 3 | flux0=0 4 | flux[1..100]=D*(b[j]-b[j-1])-chi*b[j]*(1-a[j-1]/a[j]) 5 | b[0..99]'=flux[j+1]-flux[j]+r*a[j]*b[j]-z*b[j] 6 | b100'=-flux[100] 7 | a[0..100]'=-k*b[j]*a[j]+mu*a[j]*(1-a[j]) 8 | init a[0..100]=1 9 | init b[0..5]=10 10 | aux btot=sum(0,100)of(shift(b0,i')) 11 | par chi=1,d=1,k=.2,mu=.4,r=.05,z=.01 12 | done 13 | -------------------------------------------------------------------------------- /z_exp.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double exp(), cos(), sin(); 5 | VOID z_exp(r, z) doublecomplex *r, *z; 6 | #else 7 | #undef abs 8 | #include "math.h" 9 | void z_exp(doublecomplex *r, doublecomplex *z) 10 | #endif 11 | { 12 | double expx, zi = z->i; 13 | 14 | expx = exp(z->r); 15 | r->r = expx * cos(zi); 16 | r->i = expx * sin(zi); 17 | } 18 | -------------------------------------------------------------------------------- /help/odes/wc.ode: -------------------------------------------------------------------------------- 1 | # wilson-cowan 2 | f(u)=1/(1+exp(-u)) 3 | par aee=10,aie=8,aei=12,aii=3,ze=.2,zi=4 4 | par tau=1 5 | i_e(t)=ie0+ie1*sin(w*t) 6 | i_i(t)=ii0+ii1*sin(w*t) 7 | par ie0=0,ie1=0,w=.25 8 | par ii0=0,ii1=0 9 | init u=.1,v=.05 10 | u'=-u+f(aee*u-aie*v-ze+i_e(t)) 11 | v'=(-v+f(aei*u-aii*v-zi+i_i(t)))/tau 12 | @ total=40,xp=u,yp=v,xlo=-.1,xhi=1,ylo=-.1,yhi=1 13 | done 14 | -------------------------------------------------------------------------------- /ode/lorenz.ode: -------------------------------------------------------------------------------- 1 | # the famous Lorenz equation set up for 3d view 2 | init x=-7.5 y=-3.6 z=30 3 | par r=27 s=10 b=2.66666 4 | x'=s*(-x+y) 5 | y'=r*x-y-x*z 6 | z'=-b*z+x*y 7 | @ dt=.025, total=40, xplot=x,yplot=y,zplot=z,axes=3d 8 | @ xmin=-20,xmax=20,ymin=-30,ymax=30,zmin=0,zmax=50 9 | @ xlo=-1.5,ylo=-2,xhi=1.5,yhi=2 10 | @ maxstor=20000 11 | @ phi=60 12 | @ runnow=1 13 | done 14 | -------------------------------------------------------------------------------- /help/odes/pp.c: -------------------------------------------------------------------------------- 1 | /* pp.c for DLL 2 | */ 3 | #include 4 | 5 | /* some defines for readability */ 6 | 7 | #define a in[0] 8 | #define c in[1] 9 | #define x in[2] 10 | #define y in[3] 11 | 12 | #define xp out[0] 13 | #define yp out[1] 14 | 15 | pp(double * in,double *out, int nin,int nout, double *var,double *con) 16 | { 17 | xp=x*((x+c)*(1-x)-y); 18 | yp=y*(x-a); 19 | } 20 | -------------------------------------------------------------------------------- /ode/delay.ode: -------------------------------------------------------------------------------- 1 | # delayed feedback delay.ode 2 | 3 | # declare all the parameters, initializing the delay to 3 4 | p tau=3,b=4.8,a=4,p=-.8 5 | # define the nonlinearity 6 | f(x)=1/(1+exp(-x)) 7 | # define the right-hand sides; delaying x by tau 8 | dx/dt = -x + f(a*x-b*delay(x,tau)+p) 9 | x(0)=1-t 10 | init x=1 11 | aux si=0 12 | # set maxdelay 13 | @ delay=20 14 | # done 15 | d 16 | 17 | 18 | -------------------------------------------------------------------------------- /kinescope.h: -------------------------------------------------------------------------------- 1 | #ifndef _kinescope_h_ 2 | #define _kinescope_h_ 3 | 4 | void do_movie_com(int c); 5 | void reset_film(void); 6 | int film_clip(void); 7 | int show_frame(int i, int h, int w); 8 | void play_back(void); 9 | void save_kine(void); 10 | void make_anigif(void); 11 | void save_movie(char *basename, int fmat); 12 | void auto_play(void); 13 | void too_small(void); 14 | 15 | #endif 16 | 17 | 18 | -------------------------------------------------------------------------------- /z_log.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double log(), f__cabs(), atan2(); 5 | VOID z_log(r, z) doublecomplex *r, *z; 6 | #else 7 | #undef abs 8 | #include "math.h" 9 | extern double f__cabs(double, double); 10 | void z_log(doublecomplex *r, doublecomplex *z) 11 | #endif 12 | { 13 | double zi = z->i, zr = z->r; 14 | r->i = atan2(zi, zr); 15 | r->r = log( f__cabs( zr, zi ) ); 16 | } 17 | -------------------------------------------------------------------------------- /canonical/swindale.ode: -------------------------------------------------------------------------------- 1 | # swindale.ode 2 | # creates occular dominance stripes 3 | # make a weight matrix - mexican hat 4 | table wa % 31 -15 15 exp(-a*t*t)-c*exp(-b*t*t) 5 | par mu=.5,nu=1.3 6 | par a=.1,b=.025,c=.035 7 | # convolve it 8 | special k=conv(periodic,101,15,wa,n0) 9 | # random initial data 10 | n[0..100](0)=ran(1) 11 | # ODEs 12 | n[0..100]'=n[j]*(1-n[j])*(mu*k([j])-nu) 13 | @ total=50 14 | done 15 | -------------------------------------------------------------------------------- /help/xpprestore.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - RESTORE 4 | 5 | 6 | 7 | Back | Next | Contents 8 |
9 |

Restore

Redraws the most recent data in the browser in accordance with the graphics parameters ofthe active window.

10 | -------------------------------------------------------------------------------- /ode/lorenz.ani: -------------------------------------------------------------------------------- 1 | # shows the waterwheel using the integrated ang velocity 2 | # see Strogatz book use lorenz2.ode 3 | PERMANENT 4 | circ .515;.515;.46;$BLACK;2 5 | TRANSIENT 6 | SPEED 20 7 | frect .5+.45*sin(th[0..7]);.5+.45*cos(th[j]);.55+.45*sin(th[j]);.55+.45*cos(th[j]);$BLACK 8 | # plotting the butterfly and a lagged version of it !! 9 | fcirc .5+x/40;z/50;.02;$GREEN 10 | fcirc .5+x1/40;z1/50;.02;$RED 11 | end 12 | -------------------------------------------------------------------------------- /calc.h: -------------------------------------------------------------------------------- 1 | #ifndef _calc_h_ 2 | #define _calc_h_ 3 | 4 | #include 5 | 6 | 7 | void draw_calc(Window w); 8 | void make_calc(double z); 9 | void quit_calc(void); 10 | void ini_calc_string(char *name, char *value, int *pos, int *col); 11 | void q_calc(void); 12 | int do_calc(char *temp, double *z); 13 | int has_eq(char *z, char *w, int *where); 14 | double calculate(char *expr, int *ok); 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /extra.h: -------------------------------------------------------------------------------- 1 | #ifndef _extra_h_ 2 | #define _extra_h_ 3 | 4 | void load_new_dll(void); 5 | int my_fun(double *in, double *out, int nin, int nout, double *v, double *c); 6 | void auto_load_dll(void); 7 | void do_in_out(void); 8 | void add_export_list(char *in, char *out); 9 | void check_inout(void); 10 | int get_export_count(char *s); 11 | void do_export_list(void); 12 | void parse_inout(char *l, int flag); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /newhome.h: -------------------------------------------------------------------------------- 1 | #ifndef _newhome_h_ 2 | #define _newhome_h_ 3 | 4 | /* This is for the Sparc II running X11 R4 -- 5 | It is not the usual value given in XKeySymbDefs 6 | */ 7 | /* 8 | #define XK_Home 65496 9 | #define XK_End 65502 10 | #define XK_PgUp 0xffda 11 | #define XK_PgDn 0xffe0 12 | 13 | */ 14 | /* This is for an HP */ 15 | #define XK_PgUp XK_Prior 16 | #define XK_PgDn XK_Next 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /tstauto/torx.ode: -------------------------------------------------------------------------------- 1 | x'=(-(be + rn) * x + be * y - a3 * (x * (x * x)) + b3 *((y-x) * ((y-x) * (y-x)))) / r 2 | y'= be * x - (be + ga) * y - z - b3 * ((y-x) * ((y-x) * (y-x))) 3 | z'=y 4 | 5 | par rn=-.9,be=.5,ga=-.6,r=.6,a3=.328578,b3=.933578 6 | @ dsmin=1e-4,dsmax=.01,parmin=-.9,parmax=-.4 7 | @ npr=500,nmax=125 8 | @ epsl=1e-7,epsu=1e-7,epss=1e-5 9 | @ autoymax=1,autoymin=-1,autoxmin=-.9,autoxmax=-.4 10 | @ ds=.001 11 | done 12 | -------------------------------------------------------------------------------- /default.opt: -------------------------------------------------------------------------------- 1 | 9x15 BIG_FONT_NAME 2 | 6x13 SMALL_FONT_NAME 3 | 0 BACKGROUND (1=white,0=black) 4 | 0 IXPLT 5 | 1 IYPLT 6 | 1 IZPLT 7 | 0 AXES 8 | 1 NJMP 9 | 40 NMESH 10 | 3 METHOD 11 | 1 TIMEPLOT 12 | 8000 MAXSTOR 13 | 20.0 TEND 14 | .05 DT 15 | 0.0 T0 16 | 0.0 TRANS 17 | 100. BOUND 18 | 1e-12 HMIN 19 | 1.0 HMAX 20 | .00001 TOLER 21 | 0.0 DELAY 22 | 0.0 XLO 23 | 20.0 XHI 24 | -2.0 YLO 25 | 2.0 YHI 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /help/xppcont.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - CONTINUE 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


9 |

Continue

10 |
    This allows you to continue integrating appending the data to the current curve. Type in the new ending time.

    11 | 12 | -------------------------------------------------------------------------------- /ode/coaster2D.ani: -------------------------------------------------------------------------------- 1 | # animation file for 2D roller coaster 2 | speed 75 3 | dimension -1.25;-1.25;1.25;1.25 4 | PERMANENT 5 | settext 3;rom;$PURPLE 6 | vtext -1.0;1.0;g=;g 7 | ellip 0;0;1;1; 8 | TRANSIENT 9 | comet X;Z;-5;5;Lalt 10 | fcirc X;Z;0.05;$RED 11 | grab x;Z;tol 12 | {X=mouse_x;Z=sqrt(1-mouse_x^2)} 13 | {M=asin(mouse_x);X=mouse_x;Z=sqrt(1-mouse_x^2);Lalt=sign(mouse_vx)*sqrt(mouse_vx^2+mouse_vy^2);runnow=1} 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /ode/duck.ani: -------------------------------------------------------------------------------- 1 | # duck.ani 2 | PERMANENT 3 | rect 0;0;.4;.4 4 | frect 0;0;.4;.3;.3 5 | TRANSIENT 6 | line .5;.5;.5;0;$BLACK;4 7 | line .5;.5;.5+.8*(l1/(l1+l2))*sin(x);.5-.8*(l1/(l1+l2))*cos(x);$RED;4 8 | line .5;.5;.5-.8*(l2/(l1+l2))*sin(x);.5+.8*(l2/(l1+l2))*cos(x);$RED;4 9 | fcircle .5+.8*(l1/(l1+l2))*sin(x);.5-.8*(l1/(l1+l2))*cos(x);.08;mu/mutot 10 | fcircle .5-.8*(l2/(l1+l2))*sin(x);.5+.8*(l2/(l1+l2))*cos(x);.08;1-mu/mutot 11 | done 12 | -------------------------------------------------------------------------------- /xpplim.h: -------------------------------------------------------------------------------- 1 | #ifndef _xpplim_h_ 2 | #define _xpplim_h_ 3 | 4 | #define MAXODE 5000 5 | #define MAXODE1 4999 6 | #define MAXDELAY 50 7 | #define MAXPRIMEVAR (MAXODE-10)/2 8 | #define MAXPAR 400 9 | #define MAXFLAG 2000 10 | #define MAX_SYMBS 10000 11 | #define MAXUFUN 50 12 | #define MAX_TAB 50 13 | #define MAXKER 50 14 | #define MAXNET 50 15 | #define MAXMARK 200 16 | #define MAX_ANI_LINES 2000 17 | #define MAX_INTERN_SET 500 18 | #endif 19 | -------------------------------------------------------------------------------- /dae_fun.h: -------------------------------------------------------------------------------- 1 | #ifndef _dae_fun_h_ 2 | #define _dae_fun_h_ 3 | 4 | int add_svar(char *name, char *rhs); 5 | int add_svar_names(void); 6 | int add_aeqn(char *rhs); 7 | int compile_svars(void); 8 | void reset_dae(void); 9 | void set_init_guess(void); 10 | void err_dae(void); 11 | void init_dae_work(void); 12 | void get_dae_fun(double *y, double *f); 13 | void do_daes(void); 14 | int solve_dae(void); 15 | void get_new_guesses(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /help/xpperase.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - ERASE 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 | 10 |

    Erase

    Erases the contents of the active window, redraws the 11 | axes, deletes all text in the window, and sets the redraw flag to Manual.

    12 | 13 | -------------------------------------------------------------------------------- /ode/ev1.ode: -------------------------------------------------------------------------------- 1 | v'=-gl*(v-el)-(gk*n+gks)*(v-ek)-gna*minf(v)*(v-ena) 2 | #na'=-mu*gna*minf(v)*(v-ena)-(na-namin)/tauna 3 | #sks=na^q/(na^q+nah^q) 4 | par q=4 5 | par nah=20 6 | par namin=1,mu=.001,tauna=200 7 | n'=(ninf(v)-n)/taun 8 | minf(v)=1/(1+exp(-(v-va)/vb)) 9 | ninf(v)=1/(1+exp(-(v-vc)/vd)) 10 | par gks=2 11 | par va=-45,vb=8,vc=-48,vd=4 12 | par gl=.025,gk=7.5,gna=4 13 | par ena=55,ek=-85,el=-70 14 | par taun=.3 15 | # aux ss=sks 16 | done 17 | -------------------------------------------------------------------------------- /ode/evelyn.ode: -------------------------------------------------------------------------------- 1 | v'=-gl*(v-el)-(gk*n+gks*sks)*(v-ek)-gna*minf(v)*(v-ena) 2 | na'=-mu*gna*minf(v)*(v-ena)-(na-namin)/tauna 3 | sks=na^q/(na^q+nah^q) 4 | par q=4 5 | par nah=20 6 | par namin=1,mu=.001,tauna=200 7 | n'=(ninf(v)-n)/taun 8 | minf(v)=1/(1+exp(-(v-va)/vb)) 9 | ninf(v)=1/(1+exp(-(v-vc)/vd)) 10 | par gks=0 11 | par va=-45,vb=8,vc=-48,vd=4 12 | par gl=.025,gk=7.5,gna=4 13 | par ena=55,ek=-85,el=-70 14 | par taun=.3 15 | aux ss=sks 16 | done 17 | -------------------------------------------------------------------------------- /ode/wta.ode: -------------------------------------------------------------------------------- 1 | # a model used by the author to study complex dynamics in winner 2 | # take all neural networks change tau to 1.1 and then .25 3 | p tau=3,aee=14,aei=15,aie=15,c=2,te=1,ti=8 4 | f(x)= .5*(1+tanh(x)) 5 | x1'=-x1+f(aee*x1+c*x2-aie*u-te) 6 | x2'=-x2+f(aee*x2+c*x3-aie*u-te) 7 | x3'=-x3+f(aee*x3+c*x1-aie*u-te) 8 | u'=(-u+f(aei*(x1+x2+x3)-ti))/tau 9 | x1(0)=.3 10 | x2(0)=.2 11 | x3(0)=.1 12 | @ dt=.1,total=200,xhi=200,ylo=0,yhi=1 13 | d 14 | -------------------------------------------------------------------------------- /tstauto/eiz-hom.ode: -------------------------------------------------------------------------------- 1 | u'=k*(-u+f(aee*we-aie*v-aze*z-te))/(c*taue) 2 | v'=k*(-v+f(aei*we-aii*v-ti))/(c*taui) 3 | z'=k*(-z+f(aez*u-tz))/(c*tauz) 4 | we'=k*ve 5 | ve'=k*(we-u) 6 | f(u)=1/(1+exp(-u)) 7 | par c=.528907 8 | par k=1 9 | par aze=12,te=3.8,aee=15,aie=10,taue=2 10 | par taui=5,aei=25,aii=8,ti=8.5 11 | par tauz=50,aez=10,tz=7 12 | init u=.036,v=.0005,z=.0013,we=.0365 13 | @ dt=.002 14 | @ xp=we,yp=ve,xlo=-.05,ylo=-.2,xhi=.5,yhi=.3 15 | dobe 16 | -------------------------------------------------------------------------------- /tstauto/san.ode: -------------------------------------------------------------------------------- 1 | par par0=0,par7=0, par1=1,par2=-2,par3=0,par4=1,par5=0,par6=0 2 | 3 | f0 = par0 * u0 + par1 * u1 - par0 * u0 * u0 + (par7 - par3 * u2) * u0 * (2. - u0 * 3.) 4 | f1 = par1 * u0 + par0 * u1 - par1 * 1.5 * u0 * u0 - par0 * 1.5 * u0 * u1 - (par7 - par3 * u2) * 2. * u1 5 | f2 = par2 * u2 + par6 * u0 + par5 * u0 * u2 + par3 * par4 * (u0 * u0 * (1. - u0) - u1 * u1) 6 | u0'=f0 7 | u1'=f1 8 | u2'=f2 9 | i u0=.00018,u1=.00018,u2=0 10 | done -------------------------------------------------------------------------------- /ode/doubpend.ode: -------------------------------------------------------------------------------- 1 | t1' = t1p 2 | t2' = t2p 3 | t2p' = -mu*t2p+1/(L2*(m1+m2*(sin(t2-t1))^2))*(-(m1+m2)*g*sin(t2)-(m1+m2)*\ 4 | L1*t1p^2*sin(t2-t1)+cos(t2-t1)*((m1+m2)*g*sin(t1)-m2*L2*t2p^2*sin(t2-t1))) 5 | t1p' = -mu*t1p+1/(L1*(m1+m2*(sin(t2-t1))^2))*(-(m1+m2)*g*sin(t1)+\ 6 | m2*L2*t2p^2*sin(t2-t1)+cos(t2-t1)*(m2*g*sin(t2)+m2*L1*t1p^2*sin(t2-t1))) 7 | # parameters 8 | par L1=4,L2=1,m1=2,m2=1,g=9.8,mu=.01 9 | @ total=200,bound=100000 10 | init t1=1.5,t2=0 11 | done -------------------------------------------------------------------------------- /ode/cable.ode: -------------------------------------------------------------------------------- 1 | # Linear Cable Model cable.ode 2 | 3 | # define the 4 parameters, a,b,v0,lambda^2 4 | p a=1,b=0,v0=1,lam2=1 5 | # now do the right-hand sides 6 | v'=vx 7 | vx'=v/lam2 8 | 9 | # The initial data 10 | v(0)=1 11 | vx(0)=0 12 | 13 | # and finally, boundary conditions 14 | # First we want V(0)-V0=0 15 | b v-v0 16 | # 17 | # We also want aV(1)+bVX(1)=0 18 | b a*v'+b*vx' 19 | # Note that the primes tell XPP to evaluate at the right endpoint 20 | d 21 | -------------------------------------------------------------------------------- /ode/osc.ode: -------------------------------------------------------------------------------- 1 | par beta=1.463,gam=3.358,Input=1.352,eps=0.1,sigma=0 2 | init V=2,X=1.5 3 | @ parmin=0,parmax=6, ds=-0.001, dsmax=.01 4 | 5 | xm(z) = z 6 | Vnull(z) = 3*z-z^3+2+Input 7 | Xnull(z) = gam*(1+tanh(z/beta)) 8 | wiener z 9 | 10 | dV/dt = 3*V-V^3+2-X+Input+sigma*z 11 | dX/dt = eps*(gam*(1+tanh(V/beta))-X) 12 | 13 | @ BUT=AUTO:fa,NOUT=10 14 | @ MAXSTOR=100000,TOTAL=400,XP=V,YP=X,Xlo=-3,Xhi=3,Ylo=-3,Yhi=6 15 | @ METH=euler 16 | @ AUTOVAR=V 17 | 18 | 19 | -------------------------------------------------------------------------------- /ode/r3b.ode: -------------------------------------------------------------------------------- 1 | # planar restricted 3 body problem 2 | # the parameter set "period" is an approximate periodic solution 3 | par m=.012277471 4 | d1=((x+m)^2+y^2)^1.5 5 | d2=((x-1+m)^2+y^2)^1.5 6 | x'=u 7 | y'=v 8 | u'=2*v+x-(1-m)*(x+m)/d1-m*(x-1+m)/d2 9 | v'=-2*u+y-(1-m)*y/d1-m*y/d2 10 | init x=.5,y=.87 11 | set period {total=17.2,dt=.05,x=.994,y=0,u=0,v=-2.001583,meth=8,xlo=-2,ylo=-2,xhi=2,yhi=2} 12 | @ total=200,xp=x,yp=y,xlo=0,ylo=0,xhi=1.2,yhi=1.2 13 | done 14 | -------------------------------------------------------------------------------- /txtread.h: -------------------------------------------------------------------------------- 1 | #ifndef _txtread_h 2 | #define _txtread_h 3 | 4 | 5 | 6 | void txt_view_events(XEvent ev); 7 | void txtview_keypress(XEvent ev); 8 | void enter_txtview(Window w, int val); 9 | void do_txt_action(char *s); 10 | void resize_txtview(int w, int h); 11 | void txtview_press(Window w, int x, int y); 12 | void redraw_txtview(Window w); 13 | void redraw_txtview_text(void); 14 | void init_txtview(void); 15 | void make_txtview(void); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /cv2.h: -------------------------------------------------------------------------------- 1 | #ifndef _cv2_h_ 2 | #define _cv2_h_ 3 | 4 | 5 | /* cv2.c */ 6 | void start_cv(double *y, double t, int n, double tout, double *atol, double *rtol); 7 | void end_cv(void); 8 | void cvode_err_msg(int kflag); 9 | int cvode(int *command, double *y, double *t, int n, double tout, int *kflag, double *atol, double *rtol); 10 | int ccvode(int *command, double *y, double *t, int n, double tout, int *kflag, double *atol, double *rtol); 11 | 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /ode/fieldnoy.ode: -------------------------------------------------------------------------------- 1 | # The Field-Noyes Equations. A very hard problem for most numerical 2 | # integrators. A stiff method is absolutely necessary 3 | init x=1,y=1,z=1 4 | p q=8.375e-6,s=77.27,f=1,w=.1610 5 | x'= s*(y-x*y+x-q*x*x) 6 | y'=(-y-x*y+f*z)/s 7 | z'=w*(x-z) 8 | aux lx=ln(abs(x)) 9 | aux ly=ln(abs(y)) 10 | aux lz=ln(abs(z)) 11 | @ meth=cvode,total=1000,dt=.5,tol=1e-8,atol=1e-7 12 | @ xlo=0,xhi=1000,ylo=0,yhi=12,yp=lz 13 | @ bound=1e7 14 | d 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /canonical/ratchet.ode: -------------------------------------------------------------------------------- 1 | # a simple thermal ratchet 2 | wiener w 3 | par a=.8,sig=.05,alpha=.1,beta=.1 4 | # piecewise linear potential with slope 5 | # 1 from 0 to a and slope -a/(1-a) from a to 1 6 | # f = -V' 7 | f(x)=if(x 2 | 3 | double f(double x,double a) 4 | { 5 | return x*(1-x)*(x-a); 6 | } 7 | 8 | front(double *in,double *out, int nin, int nout, double *var, double *con) 9 | { 10 | int i; 11 | double a=in[0]; 12 | double d=in[1]; 13 | double *x=var+1; 14 | double *xp=x+81; 15 | xp[0]=f(x[0],a)+d*(x[1]-x[0]); 16 | xp[80]=f(x[80],a)+d*(x[79]-x[80]); 17 | for(i=1;i<80;i++) 18 | xp[i]=f(x[i],a)+d*(x[i+1]-2*x[i]+x[i-1]); 19 | } 20 | -------------------------------------------------------------------------------- /delay_handle.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _delay_handle_h_ 3 | #define _delay_handle_h_ 4 | 5 | 6 | /* delay_handle.c */ 7 | double delay_stab_eval(double delay, int var); 8 | int alloc_delay(double big); 9 | void free_delay(void); 10 | void stor_delay(double *y); 11 | double get_delay_old(int in, double tau); 12 | void polint(double *xa, double *ya, int n, double x, double *y, double *dy); 13 | double get_delay(int in, double tau); 14 | int do_init_delay(double big); 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ode/lor2.ode: -------------------------------------------------------------------------------- 1 | # the famous Lorenz equation set up for 3d view 2 | init x=-7.5 y=-3.6 z=30 3 | init xp=-8,yp=3,zp=25 4 | par c=0 5 | par r=27 s=10 b=2.66666 6 | x'=s*(-x+y)+c*(xp-x) 7 | y'=r*x-y-x*z 8 | z'=-b*z+x*y 9 | xp'=s*(-xp+yp)+c*(x-xp) 10 | yp'=r*xp-yp-xp*zp 11 | zp'=-b*zp+xp*yp 12 | @ dt=.025, total=40, xplot=x,yplot=y,zplot=z,axes=3d 13 | @ xmin=-20,xmax=20,ymin=-30,ymax=30,zmin=0,zmax=50 14 | @ xlo=-1.5,ylo=-2,xhi=1.5,yhi=2 15 | @ maxstor=20000 16 | @ phi=60 17 | done 18 | -------------------------------------------------------------------------------- /choice_box.h: -------------------------------------------------------------------------------- 1 | #ifndef _choice_box_h_ 2 | #define _choice_box_h_ 3 | 4 | #include 5 | #include "struct.h" 6 | 7 | void destroy_choice(CHOICE_BOX p); 8 | void display_choice(Window w, CHOICE_BOX p); 9 | void do_checks(CHOICE_BOX p); 10 | void base_choice(char *wname, int n, int mcc, char **names, int *check, int type); 11 | int do_choice_box(Window root, char *wname, int n, int mcc, char **names, int *check, int type); 12 | int choice_box_event_loop(CHOICE_BOX p); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /my_rhs.h: -------------------------------------------------------------------------------- 1 | #ifndef _my_rhs_h_ 2 | #define _my_rhs_h_ 3 | 4 | 5 | /* my_rhs.c */ 6 | int MAIN__(void); 7 | int main(int argc, char **argv); 8 | void extra(double *y__y, double t, int nod, int neq); 9 | void set_fix_rhs(double t, double *y); 10 | int my_rhs(double t, double *y, double *ydot, int neq); 11 | void update_based_on_current(void); 12 | void fix_only(void); 13 | void rhs_only(double *y, double *ydot); 14 | void vec_rhs(double t, double *y, double *ydot, int neq); 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ode/lamomeg.ode: -------------------------------------------------------------------------------- 1 | # the normal form of a Hopf bifurcation lamomeg.ode 2 | # Boundary conditions are periodic and there is 3 | # a frequency parameter -- om 4 | init x=1 y=0 5 | par q=2 om=3.14159 6 | x'=(x*(1-x^2-y^2)+q*(x^2+y^2)*y)*om 7 | y'=(y*(1-x^2-y^2)-q*(x^2+y^2)*x)*om 8 | # Periodic boundary conditions 9 | bndry x-x' 10 | bndry y-y' 11 | @ dt=.01,total=4,xhi=4,ylo=-1.5,yhi=1.5 12 | aux xp=(x*(1-x^2-y^2)+q*(x^2+y^2)*y)*om 13 | aux yp=(y*(1-x^2-y^2)-q*(x^2+y^2)*x)*om 14 | done 15 | 16 | 17 | -------------------------------------------------------------------------------- /ode/toy.ani: -------------------------------------------------------------------------------- 1 | # animation file for toy_ok.ode 2 | # I will use the average coordinates of the magnets 3 | # may want to slow it down 4 | speed 50 5 | dimension -1.25;-1.25;3.25;1.25 6 | line 0;0;.5*(x1n[1..3]+x1s[j]);.5*(y1n[j]+y1s[j]);$BLACK;3 7 | line 2.1;0;.5*(x2n[1..3]+x2s[j]);.5*(y2n[j]+y2s[j]);$BLACK;3 8 | fcircle .5*(x1n[1..3]+x1s[j]);.5*(y1n[j]+y1s[j]);.1;$BLACK 9 | fcircle .5*(x2n[1..3]+x2s[j]);.5*(y2n[j]+y2s[j]);.1;$BLACK 10 | end 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ode/pend2.ani: -------------------------------------------------------------------------------- 1 | # fancy animation file for pendulum 2 | PERMANENT 3 | settext 3;rom;$PURPLE 4 | text .25;.9;Pendulum 5 | line 0;.5;1;.5;$BLUE;4 6 | SPEED 10 7 | TRANSIENT 8 | line .5;.5;.5+.4*sin(x);.5-.4*cos(x);$BLACK;3 9 | fcircle .5+.4*sin(x);.5-.4*cos(x);.05;1.-scale*ke 10 | settext 1;rom;$BLACK 11 | vtext .05;.1;t=;t 12 | settext 1;sym;$BLACK 13 | vtext .05;.05;q=;x 14 | end 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ode/pendx.ani: -------------------------------------------------------------------------------- 1 | # animation file for pendulum 2 | # speed 50 3 | line .5;.5;.5+.4*sin(x);.5-.4*cos(x);$BLACK;3 4 | fcircle .5+.4*sin(x);.5-.4*cos(x);.05;$RED 5 | # grab the ball of the pendulum and then release with a swing!! 6 | grab .5+.4*sin(x);.5-.4*cos(x);.02 7 | {x=th(mouse_x,mouse_y)} 8 | {x=th(mouse_x,mouse_y);xp=thdot(mouse_x,mouse_y,mouse_vx,mouse_vy);runnow=1} 9 | end 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cuda/mlgpu.ode: -------------------------------------------------------------------------------- 1 | # this is an ode that calls gpu code to get the right-hand side 2 | # 3 | # 4 | @ autoeval=0 5 | table w % 262144 0 262143 ran(1)/256 6 | params iapp=0.1,phi=.333 7 | param va=-.01,vb=0.15,vc=0.1,vd=0.145,gca=1 8 | params vk=-.7,vl=-.5,gk=2.0,gl=.5 9 | par tsyn=1,gsyn=0.1,vsyn=0 10 | par vth=0,vshp=.05 11 | special vp=import(MLGPU.SO,MLGPU,1536,v0,w) 12 | v[0..511]'=vp([j]) 13 | w[0..511]'=vp([j]+512) 14 | s[0..511]'=vp([j]+1024) 15 | v[0..512](0)=ran(1)-.5 16 | @ total=200, autoeval=0 17 | d 18 | -------------------------------------------------------------------------------- /ode/duck3.ani: -------------------------------------------------------------------------------- 1 | # duck.ani 2 | PERMANENT 3 | rect 0;0;.4;.4 4 | frect 0;0;.4;.3;$BLUEGREEN 5 | TRANSIENT 6 | line .5;.5;.5;0;$BLACK;4 7 | line .5;.5;x1;y1;$RED;4 8 | line .5;.5;x2;y2;$RED;4 9 | circle x1;y1;.08;$BLACK;2 10 | circle x2;y2;.08;$BLACK;2 11 | fcircle x1;y1;.079*(mu/mutot);$RED 12 | fcircle x2;y2;.079*(1-mu/mutot);$RED 13 | line x2;y2;x2-.15*cos(x);y2-.15*sin(x);$ORANGE;4 14 | grab x2;y2;.03 15 | {x=th(mouse_x,mouse_y)} 16 | {x=th(mouse_x,mouse_y);runnow=1} 17 | # fcircle x2;y2;.02;$BLACK 18 | done 19 | -------------------------------------------------------------------------------- /ode/jcoaster.old.ani: -------------------------------------------------------------------------------- 1 | # animation file for 2D roller coaster 2 | # speed 75 3 | dimension -6.25;-1.25;4.25;6.25 4 | PERMANENT 5 | settext 3;rom;$PURPLE 6 | vtext -6.0;1.0;g=;g 7 | line xm([-80..60]*.06);zm([j]*.06);xm([j+1]*.06);zm([j+1]*.06);$GREEN 8 | TRANSIENT 9 | comet X;Z;-5;5;Lalt 10 | fcirc X;Z;0.08;$RED 11 | grab xm(M);Zm(M);0.1 12 | {M=(mouse_x+1.25)*2*pi/2.5;x=xm(m);z=zm(m)} 13 | {M=(mouse_x+1.25)*2*pi/2.5;x=xm(m);z=zm(m);Lalt=sv*sign(mouse_vx)*sqrt(mouse_vx^2+mouse_vy^2);runnow=1} 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /help/xppxivst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - XI VS T 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    Xi vs. t

    This chooses a certain 2D view and prompts you for the variable name. The window is automatically fitted and the data plotted. It is a shortcut to choosing a 2D view with time along the x-axis and windowing it.

    10 | -------------------------------------------------------------------------------- /ode/atcoaster.ani: -------------------------------------------------------------------------------- 1 | # animation file for 2D roller coaster 2 | # speed 75 3 | dimension -3.25;-3.25;3.25;3.25 4 | PERMANENT 5 | settext 3;rom;$PURPLE 6 | vtext -1.0;1.0;g=;g 7 | line xm([0..50]*.04*pi);zm([j]*.04*pi);xm([j+1]*.04*pi);zm([j+1]*.04*pi);$GREEN 8 | TRANSIENT 9 | comet X;Z;-5;5;Lalt 10 | fcirc X;Z;0.05;$RED 11 | grab xm(M);Zm(M);.1 12 | {M=(mouse_x+3.25)*2*pi/6.5;x=xm(m);z=zm(m)} 13 | {M=(mouse_x+3.25)*2*pi/6.5;x=xm(m);z=zm(m);Lalt=sv*sign(mouse_vx)*sqrt(mouse_vx^2+mouse_vy^2);runnow=1} 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /menu.h: -------------------------------------------------------------------------------- 1 | #ifndef _xppmenu_h_ 2 | #define _xppmenu_h_ 3 | 4 | #include 5 | 6 | 7 | void flash(int num); 8 | void add_menu(Window base, int j, int n, char **names, char *key, char **hint); 9 | void create_the_menus(Window base); 10 | void show_menu(int j); 11 | void unshow_menu(int j); 12 | void help(void); 13 | void help_num(void); 14 | void help_file(void); 15 | void menu_crossing(Window win, int yn); 16 | void menu_expose(Window win); 17 | void menu_button(Window win); 18 | void draw_help(void); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ode/minode.ode: -------------------------------------------------------------------------------- 1 | export {nlo,nhi} {mymin} 2 | par nlo=0,nhi=49 3 | mymin=0 4 | table junk % 50 0 49 ran(1) 5 | x[0..49]'=-x[j]+junk([j]) 6 | aux lo=mymin 7 | done 8 | --------------------------------------- 9 | #include 10 | fun(double *in,double *out,int nin,int nout,double *var,double *con) 11 | { 12 | int nmin=(int)in[0],i; 13 | int nmax=(int)in[1]; 14 | double d=var[nmin+1],dnew; 15 | for(i=nmin;i<=nmax;i++){ 16 | dnew=fabs(var[i+1]); 17 | if(dnew real){ 17 | temp = real; 18 | real = imag; 19 | imag = temp; 20 | } 21 | if((real+imag) == real) 22 | return(real); 23 | 24 | temp = imag/real; 25 | temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ 26 | return(temp); 27 | } 28 | -------------------------------------------------------------------------------- /cuda/mlcpu.ode: -------------------------------------------------------------------------------- 1 | # this is an ode that calls C code to get the right-hand side 2 | # 3 | # 4 | @ autoeval=0 5 | # random table of weights 6 | # 512 neurons 3 variables per neuron so 1536 returns 7 | table w % 262144 0 262143 ran(1)/256 8 | params iapp=0.1,phi=.333 9 | param va=-.01,vb=0.15,vc=0.1,vd=0.145,gca=1 10 | params vk=-.7,vl=-.5,gk=2.0,gl=.5 11 | par tsyn=1,gsyn=0.1,vsyn=-.5 12 | par vth=0,vshp=.05 13 | special vp=import(ML.SO,ML,1536,v0,w) 14 | v[0..511]'=vp([j]) 15 | w[0..511]'=vp([j]+512) 16 | s[0..511]'=vp([j]+1024) 17 | @ total=200 18 | d 19 | -------------------------------------------------------------------------------- /pow_di.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | double pow_di(ap, bp) doublereal *ap; integer *bp; 5 | #else 6 | double pow_di(doublereal *ap, integer *bp) 7 | #endif 8 | { 9 | double pow, x; 10 | integer n; 11 | unsigned long u; 12 | 13 | pow = 1; 14 | x = *ap; 15 | n = *bp; 16 | 17 | if(n != 0) 18 | { 19 | if(n < 0) 20 | { 21 | n = -n; 22 | x = 1/x; 23 | } 24 | for(u = n; ; ) 25 | { 26 | if(u & 01) 27 | pow *= x; 28 | if(u >>= 1) 29 | x *= x; 30 | else 31 | break; 32 | } 33 | } 34 | return(pow); 35 | } 36 | -------------------------------------------------------------------------------- /color.h: -------------------------------------------------------------------------------- 1 | #ifndef _color_h_ 2 | #define _color_h_ 3 | 4 | #include 5 | 6 | void tst_color(Window w); 7 | void set_scolor(int col); 8 | void set_color(int col); 9 | void make_cmaps(int *r, int *g, int *b, int n, int type); 10 | int rfun(double y, int per); 11 | int gfun(double y, int per); 12 | int bfun(double y, int per); 13 | void NewColormap(int type); 14 | void get_ps_color(int i, float *r, float *g, float *b); 15 | void get_svg_color(int i,int *r,int *g,int *b); 16 | void MakeColormap(void); 17 | int ColorMap(int i); 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /help/odes/schnak.ode: -------------------------------------------------------------------------------- 1 | # schnakenberg PDE 100 points 2 | f(u,v)=-u+v*u^2 3 | g(u,v)=a-v*u^2 4 | u0'=f(u0,v0)+duh*(u1-u0) 5 | u[1..99]'=f(u[j],v[j])+duh*(u[j+1]-2*u[j]+u[j-1]) 6 | u100'=f(u100,v100)+duh*(u99-u100) 7 | v0'=g(u0,v0)+dvh*(v1-v0) 8 | v[1..99]'=g(u[j],v[j])+dvh*(v[j+1]-2*v[j]+v[j-1]) 9 | v100'=g(u100,v100)+dvh*(v99-v100) 10 | par a=1.05,du=.2,dv=3,h=.2 11 | !duh=du/(h*h) 12 | !dvh=dv/(h*h) 13 | init u0=1.5,u1=1.3,u2=1.1,v0=1.05,v1=1.05,v2=1.05 14 | init u[3..100]=1.05,v[j]=1.05 15 | @ dt=.1,nout=50,total=50,meth=cvode,tol=1e-5,atol=1e-5 16 | done 17 | -------------------------------------------------------------------------------- /ode/ielaspen.ani: -------------------------------------------------------------------------------- 1 | # animation for elastic pendulum 2 | PERMANENT 3 | line 0;.5;1;.5;$BLACK;3 4 | TRANSIENT 5 | line .5;.5;xb;yb;$BLUE;2 6 | fcircle xb;yb;.025;$RED 7 | fcircle a/4;.95;.01;$PURPLE 8 | vtext .01;.9;k=;a 9 | fcircle f*2;.85;.01;$GREEN 10 | vtext .01;.8;f=;f 11 | grab a/4;.95;.02*scale 12 | {a=mouse_x*4} 13 | {a=mouse_x*4;runnow=0} 14 | grab f*2;.85;.02*scale 15 | {f=mouse_x/2} 16 | {f=mouse_x/2;runnow=0} 17 | grab xb;yb;.02*scale 18 | {r=r0(mouse_x,mouse_y);th=q(mouse_x,mouse_y)} 19 | {r=r0(mouse_x,mouse_y);th=q(mouse_x,mouse_y);runnow=1} 20 | end 21 | -------------------------------------------------------------------------------- /userbut.h: -------------------------------------------------------------------------------- 1 | #ifndef _userbut_h_ 2 | #define _userbut_h_ 3 | 4 | #include 5 | 6 | typedef struct { 7 | Window w; 8 | char bname[10]; 9 | int com; 10 | } USERBUT; 11 | 12 | void user_button_events(XEvent report); 13 | void user_button_press(Window w); 14 | void user_button_draw(Window w); 15 | void user_button_cross(Window w, int b); 16 | int get_button_info(char *s, char *bname, char *sc); 17 | int find_kbs(char *sc); 18 | void add_user_button(char *s); 19 | void create_user_buttons(int x0, int y0, Window base); 20 | 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ode/lecwave.ode: -------------------------------------------------------------------------------- 1 | # The Morris-Lecar model as in our chapter in Koch & Segev 2 | # A simple membrane oscillator. 3 | # 4 | par eta=1 5 | params iapp=0.08,phi=.1 6 | param v1=-.01,v2=0.15,v3=0.1,v4=0.145,gca=1 7 | params vk=-.7,vl=-.5,gk=2.0,gl=.5,om=1 8 | minf(v)=.5*(1+tanh((v-v1)/v2)) 9 | ninf(v)=.5*(1+tanh((v-v3)/v4)) 10 | lamn(v)= phi*cosh((v-v3)/(2*v4)) 11 | ica=gca*minf(v)*(v-1) 12 | v'=vp 13 | vp'=eta*vp -(iapp+gl*(vl-v)+gk*w*(vk-v)-ica) 14 | w'= (lamn(v)*(ninf(v)-w))/eta 15 | i v=-.28,w=0.005 16 | done 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ode/gill_bruss.ode: -------------------------------------------------------------------------------- 1 | # gillesp_bruss.ode 2 | # gillespie algorithm for brusselator 3 | # 4 | # x1 -> y1 (c1) 5 | # x2+y1 -> y2+Z (c2) 6 | # 2 y1 + y2 -> 3 y1 (c3) 7 | # y1 -> Z2 (c4) 8 | par c1x1=5000,c2x2=50,c3=.00005,c4=5 9 | init y1=1000,y2=2000 10 | # compute the reaction rates 11 | r1=c1x1 12 | r2=c2x2*y1 13 | r3=c3*y1*y2*(y1-1)/2 14 | r4=c4*y1 15 | special z=gill(0,r1,r2,r3,r4) 16 | tr'=tr+z(0) 17 | y1'=y1+z(1)-z(2)+z(3)-z(4) 18 | y2'=y2+z(2)-z(3) 19 | @ bound=100000000,meth=discrete,total=1000000,njmp=1000 20 | @ xp=y1,yp=y2 21 | @ xlo=0,ylo=0,xhi=10000,yhi=10000 22 | done 23 | -------------------------------------------------------------------------------- /ode/lorknead.ode: -------------------------------------------------------------------------------- 1 | # kneading sequences for the Lorenz equation 2 | init x=-7.5 y=-3.6 z=30 3 | par r=27 s=10 b=2.66666 4 | par q=.8 5 | x'=s*(-x+y) 6 | y'=r*x-y-x*z 7 | z'=-b*z+x*y 8 | global 1 x-y {p=p+(x>0)*(q^count);count=count+(x>0);out_put=(count>cmax);arret=(count>cmax)} 9 | global 1 y-x {p=p-(x<0)*(q^count);count=count+(x<0);out_put=(count>cmax);arret=(count>cmax)} 10 | count'=0 11 | p'=0 12 | aux xd=-x+y 13 | par cmax=25 14 | aux rr=r 15 | aux ss=s 16 | # 2 PAR RANGE r 20-120, s 10-70 17 | # color by p 18 | @ dt=.001, nout=10,total=40,trans=1000,bound=100000 19 | done 20 | -------------------------------------------------------------------------------- /canonical/exdaebvp.ode: -------------------------------------------------------------------------------- 1 | # dae_ex3.ode 2 | # a boundary-value DAE model 3 | # for the steady states of an artificial liver device 4 | # 5 | # vary v, the rate of flow 6 | # slow flow u at the end is minimized, but dont clean much 7 | # 8 | u'=up 9 | up'=v*up+lamu*(u-w) 10 | # DAE stuff 11 | 0= -k*w/(1+w)+lamv*(u-w) 12 | solve w=.235 13 | # some extra stuff 14 | init u=1,up=-.34 15 | aux ww=w 16 | aux z=-k*w/(1+w)+lamv*(u-w) 17 | par k=1,lamu=.25,lamv=.25,v=.2,u0=1 18 | bdry u-u0 19 | bdry up' 20 | @ total=5.001,jac_eps=1e-5,newt_tol=1e-5,dt=.005 21 | done 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /help/xpppara.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - PARAMETER EDIT 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 | 10 |

    Parameters

    Type the name of a parameter to change. Repeat for more 11 | parameters. Hit Enter a few times to exit. Type default to get back the values when you started XPP. Use the parameter window or the sliders -- its easier!

    12 | 13 | -------------------------------------------------------------------------------- /ode/pend.ode: -------------------------------------------------------------------------------- 1 | # damped pendulum pend.ode 2 | dx/dt = xp 3 | dxp/dt = (-mu*xp-m*g*sin(x))/(m*l) 4 | pe=m*g*(1-cos(x)) 5 | ke=.5*m*l*xp^2 6 | aux P.E.=pe 7 | aux K.E.=ke 8 | aux T.E=pe+ke 9 | # MKS units 10 | # 11 | param m=10,mu=2,g=9.8,l=1 12 | param scale=0.0083333 13 | @ xp=x,yp=xp,xlo=-4,xhi=4,ylo=-8,yhi=8 14 | @ bounds=1000 15 | x(0)=2 16 | # click on numerics colorize color via T.e 17 | # choose min=0, max=400 18 | # click dir fld - colorize - grid=80 19 | # click on the slider and choose g, gravity start at 9.8, min=0,max=20 20 | # watch the energy landscape change as you move the slider! 21 | done 22 | -------------------------------------------------------------------------------- /pow_ii.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | 3 | #ifdef KR_headers 4 | integer pow_ii(ap, bp) integer ap, bp; 5 | #else 6 | integer pow_ii(integer ap, integer bp) 7 | #endif 8 | { 9 | integer pow, x, n; 10 | unsigned long u; 11 | 12 | x = ap; 13 | n = bp; 14 | 15 | if (n <= 0) { 16 | if (n == 0 || x == 1) 17 | return 1; 18 | if (x != -1) 19 | return x == 0 ? 1/x : 0; 20 | n = -n; 21 | } 22 | u = n; 23 | for(pow = 1; ; ) 24 | { 25 | if(u & 01) 26 | pow *= x; 27 | if(u >>= 1) 28 | x *= x; 29 | else 30 | break; 31 | } 32 | return(pow); 33 | } 34 | -------------------------------------------------------------------------------- /help/odes/schnak2.ode: -------------------------------------------------------------------------------- 1 | # schnakenberg PDE 100 points 2 | # interlaced 3 | f(u,v)=-u+v*u^2 4 | g(u,v)=a-v*u^2 5 | u0'=f(u0,v0)+duh*(u1-u0) 6 | v0'=g(u0,v0)+dvh*(v1-v0) 7 | %[1..99] 8 | u[j]'=f(u[j],v[j])+duh*(u[j+1]-2*u[j]+u[j-1]) 9 | v[j]'=g(u[j],v[j])+dvh*(v[j+1]-2*v[j]+v[j-1]) 10 | % 11 | u100'=f(u100,v100)+duh*(u99-u100) 12 | v100'=g(u100,v100)+dvh*(v99-v100) 13 | par a=1.05,du=5,dv=75,h=.2 14 | !duh=du/(h*h) 15 | !dvh=dv/(h*h) 16 | init u0=1.5,u1=1.3,u2=1.1,v0=1.05,v1=1.05,v2=1.05 17 | init u[3..100]=1.05,v[j]=1.05 18 | @ dt=.1,nout=50,total=50,meth=cvode,tol=1e-5,atol=1e-5 19 | @ bandlo=2,bandup=2 20 | done 21 | -------------------------------------------------------------------------------- /canonical/qif-noise.ode: -------------------------------------------------------------------------------- 1 | # qif-noise.ode 2 | # noisy qif that keeps track of spike times and ISI 3 | @ meth=euler,bound=100000000 4 | # noise 5 | wiener w 6 | par sig=.1 7 | par i=.1 8 | par vhit=20,vreset=-5 9 | par maxcount=1000.05 10 | v'=v^2+i + sig * w 11 | isi'=0 12 | count'=0 13 | tlast'=0 14 | # when v spikes, reset, compute isi, update tlast, output 15 | global 1 v-vhit {v=vreset;isi=t-tlast;tlast=t;count=count+1;out_put=1} 16 | # when 1000 are computed stop! 17 | global 1 count-maxcount {arret=1} 18 | @ total=8000,trans=50000 19 | # set plot 20 | @ xp=count,yp=isi,xlo=0,xhi=1000,ylo=0,yhi=100 21 | done 22 | 23 | -------------------------------------------------------------------------------- /home.bitmap: -------------------------------------------------------------------------------- 1 | #define home_width 32 2 | #define home_height 24 3 | static unsigned char home_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03, 5 | 0x00,0x00,0xf0,0x0f,0x00,0x00,0x3c,0x3c,0x00,0x00,0x0f,0xf0,0x00,0xc0,0x03, 6 | 0xc0,0x03,0xf0,0x00,0x00,0x0f,0x38,0x00,0x00,0x1c,0xc0,0x00,0x00,0x03,0xc0, 7 | 0xf0,0x0f,0x03,0xc0,0xf0,0x0f,0x03,0xc0,0x30,0x0c,0x03,0xc0,0x30,0x0c,0x03, 8 | 0xc0,0x30,0x0c,0x03,0xc0,0x30,0x0c,0x03,0xc0,0x30,0x0c,0x03,0xc0,0x3f,0xfc, 9 | 0x03,0xc0,0x3f,0xfc,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00 }; 11 | -------------------------------------------------------------------------------- /linedn.bitmap: -------------------------------------------------------------------------------- 1 | #define linedn_width 32 2 | #define linedn_height 24 3 | static unsigned char linedn_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff, 6 | 0xff,0x1f,0xf8,0xff,0xff,0x1f,0x70,0x00,0x00,0x0e,0xe0,0x00,0x00,0x07,0xc0, 7 | 0x01,0x80,0x03,0x80,0x03,0xc0,0x01,0x00,0x07,0xe0,0x00,0x00,0x0e,0x70,0x00, 8 | 0x00,0x1c,0x38,0x00,0x00,0x38,0x1c,0x00,0x00,0x70,0x0e,0x00,0x00,0xe0,0x07, 9 | 0x00,0x00,0xc0,0x03,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00 }; 11 | -------------------------------------------------------------------------------- /lineup.bitmap: -------------------------------------------------------------------------------- 1 | #define lineup_width 32 2 | #define lineup_height 24 3 | static unsigned char lineup_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01, 5 | 0x00,0x00,0xc0,0x03,0x00,0x00,0xe0,0x07,0x00,0x00,0x70,0x0e,0x00,0x00,0x38, 6 | 0x1c,0x00,0x00,0x1c,0x38,0x00,0x00,0x0e,0x70,0x00,0x00,0x07,0xe0,0x00,0x80, 7 | 0x03,0xc0,0x01,0xc0,0x01,0x80,0x03,0xe0,0x00,0x00,0x07,0x70,0x00,0x00,0x0e, 8 | 0xf8,0xff,0xff,0x1f,0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00 }; 11 | -------------------------------------------------------------------------------- /ode/idoubpend.ani: -------------------------------------------------------------------------------- 1 | # animation of double pendulum 2 | fcircle .5;.5;.025;$BLACK 3 | line .5;.5;.5+.2*sin(t1);.5-.2*cos(t1) 4 | line .5+.2*sin(t1);.5-.2*cos(t1);.5+.2*sin(t1)+.2*sin(t2);.5-.2*cos(t1)-.2*cos(t2) 5 | fcircle .5+.2*sin(t1);.5-.2*cos(t1);.04;$RED 6 | fcircle .5+.2*sin(t1)+.2*sin(t2);.5-.2*cos(t1)-.2*cos(t2);.04;$GREEN 7 | grab .5+.2*sin(t1);.5-.2*cos(t1);.03 8 | {t1=th1(mouse_x,mouse_y)} 9 | {t1=th1(mouse_x,mouse_y);runnow=0} 10 | grab .5+.2*sin(t1)+.2*sin(t2);.5-.2*cos(t1)-.2*cos(t2);.03 11 | {t2=th2(mouse_x,mouse_y)} 12 | {t2=th2(mouse_x,mouse_y);t2p=th2dot(mouse_x,mouse_y,mouse_vx,mouse_vy);runnow=1} 13 | end 14 | -------------------------------------------------------------------------------- /pagedn.bitmap: -------------------------------------------------------------------------------- 1 | #define pagedn_width 32 2 | #define pagedn_height 24 3 | static unsigned char pagedn_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff, 5 | 0x1f,0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff, 6 | 0xff,0x1f,0xf8,0xff,0xff,0x1f,0x70,0x00,0x00,0x0e,0xe0,0x00,0x00,0x07,0xc0, 7 | 0x01,0x80,0x03,0x80,0x03,0xc0,0x01,0x00,0x07,0xe0,0x00,0x00,0x0e,0x70,0x00, 8 | 0x00,0x1c,0x38,0x00,0x00,0x38,0x1c,0x00,0x00,0x70,0x0e,0x00,0x00,0xe0,0x07, 9 | 0x00,0x00,0xc0,0x03,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00 }; 11 | -------------------------------------------------------------------------------- /pageup.bitmap: -------------------------------------------------------------------------------- 1 | #define pageup_width 32 2 | #define pageup_height 24 3 | static unsigned char pageup_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01, 5 | 0x00,0x00,0xc0,0x03,0x00,0x00,0xe0,0x07,0x00,0x00,0x70,0x0e,0x00,0x00,0x38, 6 | 0x1c,0x00,0x00,0x1c,0x38,0x00,0x00,0x0e,0x70,0x00,0x00,0x07,0xe0,0x00,0x80, 7 | 0x03,0xc0,0x01,0xc0,0x01,0x80,0x03,0xe0,0x00,0x00,0x07,0x70,0x00,0x00,0x0e, 8 | 0xf8,0xff,0xff,0x1f,0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 9 | 0x00,0xf8,0xff,0xff,0x1f,0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00 }; 11 | -------------------------------------------------------------------------------- /ode/elaspen.ode: -------------------------------------------------------------------------------- 1 | # the pendulum on a spring 2 | # the dimensionless parameter is 3 | # a= k l/m g where k is the spring constant 4 | # r is the length and th is the angle 5 | # 6 | # friction is set to zero 7 | # scale is for animation 8 | r'=rp 9 | rp'=r*thp^2+cos(th)-1-a*(r-1)-fk*rp 10 | th'=thp 11 | thp'=-(2*rp*thp+sin(th)+ft*thp)/r 12 | par a=.15,fk=0,ft=0,scale=15 13 | init r=1,th=1.4 14 | # the position of the bob for animation 15 | xb=.5+.5*r*sin(th)/scale 16 | yb=.5-.5*r*cos(th)/scale 17 | # the energy 18 | aux e=.5*(rp^2+(r*thp)^2+a*(r-1)^2)-r*cos(th)+1 19 | @ total=400,meth=qualrk,dt=.25 20 | @ bound=100000 21 | done 22 | -------------------------------------------------------------------------------- /ode/pend-cart1.ode: -------------------------------------------------------------------------------- 1 | # pendulum on a cart 2 | # uses DAE solver to solve for x'', th1'' 3 | # 4 | # pend-cart1.ode 5 | # 6 | # masses of cart and pendulum (kg) 7 | par mc=5,mp=1 8 | # length (m) and gravity 9 | par l=1,g=9.8 10 | # simple linear friction 11 | par muc=0,mup=0 12 | # set up DAEs 13 | 0=(mc+mp)*xdd+mp*l*cos(th1)*th1dd-mp*l*sin(th1)*th1p^2+muc*xp 14 | 0=cos(th1)*xdd+l*th1dd+g*sin(th1)+mup*th1p 15 | solv xdd=0 16 | solv th1dd=0 17 | # 18 | # dynamics 19 | x'=xp 20 | xp'=xdd 21 | th1'=th1p 22 | th1p'=th1dd 23 | # track accelerations 24 | aux xpp=xdd 25 | aux th1pp=th1dd 26 | @ dt=.02 27 | # nice ICs 28 | init th1=1.5 29 | done 30 | -------------------------------------------------------------------------------- /ode/itoy.ani: -------------------------------------------------------------------------------- 1 | # animation file for toy_ok.ode 2 | # I will use the north coordinates of the magnets 3 | # may want to slow it down 4 | speed 50 5 | dimension -1.25;-1.25;3.25;1.25 6 | line 0;0;x1n[1..3];y1n[j];$BLACK;3 7 | line 2.1;0;x2n[1..3];y2n[j];$BLACK;3 8 | fcircle x1n[1..3];y1n[j];.1;$RED 9 | fcircle x2n[1..3];y2n[j];.1;$BLUE 10 | grab x1n1;y1n1;.05 11 | {t1=a+atan2(mouse_y,mouse_x)} 12 | {t1=a+atan2(mouse_y,mouse_x);t1p=t1dot(mouse_x,mouse_y,mouse_vx,mouse_vy);runnow=1} 13 | grab x2n1;y2n1;.05 14 | {t2=a+atan2(mouse_y,mouse_x-2-d)} 15 | {t2=a+atan2(mouse_y,mouse_x-2-d);runnow=0} 16 | end 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /xppaut-stylesheet2.css: -------------------------------------------------------------------------------- 1 | line.xppaxes { 2 | stroke: #000000; 3 | stroke-width: 2; 4 | } 5 | 6 | line.xppboxaxes { 7 | stroke: #000000; 8 | stroke-width: 2; 9 | } 10 | 11 | text.xppaxestext { 12 | stroke: #000000; 13 | fill: #000000; 14 | } 15 | 16 | text.xppyaxislabelv { 17 | stroke: #000000; 18 | fill: #000000; 19 | } 20 | 21 | text.xppyaxislabelh { 22 | stroke: none; 23 | fill: none; 24 | } 25 | 26 | 27 | rect { 28 | fill-opacity: 0.2; 29 | stroke-opacity: 0.2; 30 | } 31 | -------------------------------------------------------------------------------- /eig_list.h: -------------------------------------------------------------------------------- 1 | #ifndef _eig_list_h_ 2 | #define _eig_list_h_ 3 | 4 | #include 5 | 6 | void draw_eq_list(Window w); 7 | void create_eq_list(void); 8 | void eq_list_keypress(XEvent ev, int *used); 9 | void enter_eq_stuff(Window w, int b); 10 | void eq_list_button(XEvent ev); 11 | void eq_list_up(void); 12 | void eq_list_down(void); 13 | void eq_box_import(void); 14 | void get_new_size(Window win, unsigned int *wid, unsigned int *hgt); 15 | void resize_eq_list(Window win); 16 | void eq_box_button(Window w); 17 | void create_eq_box(int cp, int cm, int rp, int rm, int im, double *y, double *ev, int n); 18 | void draw_eq_box(Window w); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ode/logbif.ode: -------------------------------------------------------------------------------- 1 | # this is an example showing the logistic bifurcation diagram 2 | f(x,a)=a*x*(1-x) 3 | # here is the map 4 | x'=f(x,aa) 5 | # keep tabs on the parameter for plotting 6 | a'=aa 7 | # dummy index so you can change range without reloading 8 | par ind 9 | # define a in terms of the index ind over which we range 10 | !aa=amin+(amax-amin)*ind/200 11 | # 12 | init x=.1 13 | # change amin and amax to change the window 14 | par amin=2,amax=4 15 | @ maxstor=11000,total=400,trans=350,meth=discrete 16 | @ xlo=2,xhi=4.001,ylo=0,yhi=1.001,xp=a,yp=x 17 | @ range=1,rangeover=ind 18 | @ rangereset=no 19 | @ rangelow=0,rangehigh=200,rangestep=200 20 | @ LT=0 21 | done 22 | -------------------------------------------------------------------------------- /ode/jcoaster.ani: -------------------------------------------------------------------------------- 1 | # animation file for 2D roller coaster 2 | # speed 75 3 | dimension -6.25;-1.25;6.25;10.25 4 | PERMANENT 5 | settext 3;rom;$PURPLE 6 | vtext -6.0;2.0;g=;g 7 | line xm([-100..100]*.06);zm([j]*.06);xm([j+1]*.06);zm([j+1]*.06);$GREEN 8 | TRANSIENT 9 | #Some values you may want to explore... 10 | #vtext -6.0;1.5;M =;m 11 | #vtext -6.0;1.0;Velocity (m/s) =;Lalt 12 | #vtext -6.0;0.5;Displacement (m) =;L 13 | comet X;Z;-5;5;Lalt 14 | fcirc X;Z;0.08;$RED 15 | grab xm(M);Zm(M);0.25 16 | {M=min(max(-5.6,mouse_x),5.13);x=xm(m);z=zm(m)} 17 | {M=min(max(-5.6,mouse_x),5.13);x=xm(m);z=zm(m);Lalt=sv*sign(mouse_vx)*sqrt(mouse_vx^2+mouse_vy^2);runnow=1} 18 | end 19 | 20 | 21 | -------------------------------------------------------------------------------- /ode/jcoaster1.ani: -------------------------------------------------------------------------------- 1 | # animation file for 2D roller coaster 2 | # speed 75 3 | dimension -6.25;-1.25;6.25;10.25 4 | PERMANENT 5 | settext 3;rom;$PURPLE 6 | vtext -6.0;2.0;g=;g 7 | line xm([-100..100]*.06);zm([j]*.06);xm([j+1]*.06);zm([j+1]*.06);$GREEN 8 | TRANSIENT 9 | #Some values you may want to explore... 10 | #vtext -6.0;1.5;M =;m 11 | #vtext -6.0;1.0;Velocity (m/s) =;Lalt 12 | #vtext -6.0;0.5;Displacement (m) =;L 13 | comet X;Z;-5;5;Lalt 14 | fcirc X;Z;0.08;$RED 15 | grab xm(M);Zm(M);0.5 16 | {M=min(max(-5.6,mouse_x),5.13);x=xm(m);z=zm(m)} 17 | {M=min(max(-5.6,mouse_x),5.13);x=xm(m);z=zm(m);Lalt=sv*sign(mouse_vx)*sqrt(mouse_vx^2+mouse_vy^2);runnow=1} 18 | end 19 | 20 | 21 | -------------------------------------------------------------------------------- /ode/mlvolt.ode: -------------------------------------------------------------------------------- 1 | # cube volt.ode 2 | # two equlations with passive media and then two active regions 3 | # 4 | # dV/dt = -a v + active stuff + d V_xx 5 | # G(xhat,t) = exp(-a*t-xhat/t)/sqrt(pi t) xhat is a distance 6 | f1=k*(v1^2-v1^3-w1) 7 | f2=k*(v2^2-v2^3-w2) 8 | v1(t)=v10*exp(-kk*t) + int[.5]{exp(-a*t)#f1}+int[.5]{exp(-a*t-xhat/(t+.0001))#f2} 9 | v2(t)=v20*exp(-kk*t) + int[.5]{exp(-a*t)#f2}+int[.5]{exp(-a*t-xhat/(t+.0001))#f1} 10 | w[1..2]'=b*(v[j]-c-d*w[j]) 11 | par a=.1,d=.5,c=.2,b=.2,k=2 12 | par xhat=3 13 | par v10=.5,v20=.2,kk=5 14 | @ dt=.05,total=100 15 | init w1=.5,w2=-.4 16 | # change w2=-.2 to get sync 17 | @ xp=v1,yp=v2,xlo=-.5,xhi=1,ylo=-.5,yhi=1 18 | done 19 | -------------------------------------------------------------------------------- /xppaut-stylesheet.css: -------------------------------------------------------------------------------- 1 | line.xppaxes { 2 | stroke: #000000; 3 | stroke-width: 2; 4 | } 5 | line.xppboxaxes { 6 | stroke: none; 7 | stroke-width: 0; 8 | } 9 | 10 | text.xppaxestext { 11 | stroke: #000000; 12 | fill: #000000; 13 | } 14 | 15 | text.xppyaxislabelv { 16 | stroke: #000000; 17 | fill: #000000; 18 | } 19 | text.xppyaxislabelh { 20 | stroke: none; 21 | fill: none; 22 | } 23 | line.xppline0 { 24 | stroke: #000000; 25 | stroke-dasharray: 4,4; 26 | } 27 | -------------------------------------------------------------------------------- /cuda/ml_noc.ode: -------------------------------------------------------------------------------- 1 | #this is the same as mlcpu.c but using XPP 2 | # 3 | @ autoeval=0 4 | table w % 262144 0 262143 ran(1)/(256) 5 | special ws=mmult(512,512,w,s0) 6 | minf(v)=.5*(1+tanh((v-va)/vb)) 7 | ninf(v)=.5*(1+tanh((v-vc)/vd)) 8 | lamn(v)= phi*cosh((v-vc)/(2*vd)) 9 | sinf(v)=1/(1+exp(-(v-vth)/vshp)) 10 | params iapp=0.1,phi=.333 11 | param va=-.01,vb=0.15,vc=0.1,vd=0.145,gca=1 12 | params vk=-.7,vl=-.5,gk=2.0,gl=.5 13 | par tsyn=1,gsyn=0.1,vsyn=-.5 14 | par vth=0,vshp=.05 15 | 16 | v[0..511]'=iapp-gl*(v[j]-vl)-gk*w[j]*(v[j]-vk)-gca*minf(v[j])*(v[j]-1)-gsyn*ws([j])*(v[j]-vsyn) 17 | w[0..511]'=lamn(v[j])*(ninf(v[j])-w[j]) 18 | s[0..511]'=(sinf(v[j])-s[j])/tsyn 19 | @ total=200 20 | d 21 | -------------------------------------------------------------------------------- /ode/waterwheel.ode: -------------------------------------------------------------------------------- 1 | # the waterwheel ala Lorenz but discrete 2 | ff(u)=heav(cos(u)-cos(pi/n)) 3 | flow[0..9]=flow*ff(theta-2*pi*[j]/n) 4 | cp[0..9]=flow[j]-mu*c[j] 5 | m[0..9]=c[j]+mc/n 6 | c[0..9]'=cp[j] 7 | mdot=sum(0,9)of(shift(cp0,i')) 8 | m=sum(0,9)of(shift(c0,i'))+mc 9 | theta'=thetap 10 | thetap'=(-nu*thetap-l*l*mdot*thetap+l*sum(0,9)of(shift(m0,i')*sin(theta-2*pi*i'/n)))/(m*l*l) 11 | par flow=.5,mu=.1,n=10,l=.15,mc=2,nu=.1 12 | init theta=.05 13 | ### some stuf for animation 14 | x[0..9]=.3*sin(theta-2*pi*[j]/n)+.4 15 | y[0..9]=.3*cos(theta-2*pi*[j]/n)+.4 16 | yc[0..9]=.3*cos(theta-2*pi*[j]/n)+.4+.1*c[j]/2 17 | @ total=200,dt=.05,meth=cvode,tol=1e-5,atol=1e-4 18 | done 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tstauto/she.ode: -------------------------------------------------------------------------------- 1 | par mus=.163875 2 | par q=0.0 3 | par sigma=.5 4 | par zeta=2 5 | !pi2=pi^2 6 | @ meth=qualrk4,dt=.01,total=85.07 7 | @ tol=1e-10 8 | p11ss'=p11ss * t02cs + p11ss * mus - p12cs * p01cs 9 | t02cs'=-(p11ss * p11ss + t02cs) 10 | p12cs'=(sigma*4.*p11ss*p01cs+sigma*4.*p12cs*mus-sigma*9.*p12cs+p11ss*4.*p01cs+p12cs*4.*mus) / ((sigma +1.) *4.) 11 | p01cs'=(-q * (sigma * sigma) * a01cs - pi2 * (sigma * sigma) * p01cs + pi2 * 3. * sigma * p11ss * p12cs + pi2 * 3. * p11ss * p12cs) / (pi2 * 4. * sigma) 12 | a01cs'=zeta * (p01cs - a01cs) / 4. 13 | i P11SS=0.4048147756870142 14 | i T02CS=-0.1638749999491637 15 | i P12CS=-0.0008869668098317242 16 | i P01CS=-0.001 17 | i A01CS=0.0 18 | d 19 | -------------------------------------------------------------------------------- /ode/lecdiff200.ode: -------------------------------------------------------------------------------- 1 | # The Morris-Lecar model as in our chapter in Koch & Segev 2 | # A simple membrane oscillator. 3 | # 4 | par dif=5 5 | params iapp=0.0,phi=.333 6 | param va=-.01,vb=0.15,vc=0.1,vd=0.145,gca=1 7 | params vk=-.7,vl=-.5,gk=2.0,gl=.5,om=1 8 | minf(v)=.5*(1+tanh((v-va)/vb)) 9 | ninf(v)=.5*(1+tanh((v-vc)/vd)) 10 | lamn(v)= phi*cosh((v-vc)/(2*vd)) 11 | ica(v)=gca*minf(v)*(v-1) 12 | f(v,w)=(iapp+gl*(vl-v)+gk*w*(vk-v)-ica(v)) 13 | g(v,w)=(lamn(v)*(ninf(v)-w)) 14 | v0=v1 15 | v201=v200 16 | v[1..200]'=f(v[j],w[j])+dif*(v[j+1]-2*v[j]+v[j-1]) 17 | w[1..200]'=g(v[j],w[j]) 18 | v[20..200](0)=-.49 19 | v[1..19](0)=0 20 | done 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /comline.h: -------------------------------------------------------------------------------- 1 | #ifndef _comline_h_ 2 | #define _comline_h_ 3 | 4 | 5 | typedef struct { 6 | char *name; 7 | char *does; 8 | unsigned int use; 9 | } INTERN_SET; 10 | 11 | 12 | typedef struct { 13 | char *name; 14 | struct SET_NAME * next; 15 | } SET_NAME; 16 | 17 | 18 | 19 | int is_set_name(SET_NAME *set, char *nam); 20 | SET_NAME *add_set(SET_NAME *set, char *nam); 21 | SET_NAME *rm_set(SET_NAME *set, char *nam); 22 | void do_comline(int argc, char **argv); 23 | int if_needed_select_sets(void); 24 | int if_needed_load_set(void); 25 | int if_needed_load_par(void); 26 | int if_needed_load_ic(void); 27 | int if_needed_load_ext_options(void); 28 | int parse_it(char *com); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ode/lorenz2.ode: -------------------------------------------------------------------------------- 1 | # the famous Lorenz equation set up for animated waterwheel and 2 | # some delayed coordinates as well 3 | init x=-7.5 y=-3.6 z=30 4 | par r=27 s=10 b=2.66666 5 | par c=.2 del=.1 6 | x'=s*(-x+y) 7 | y'=r*x-y-x*z 8 | z'=-b*z+x*y 9 | # x is proportional to the angular velocity so integral is angle 10 | theta'=c*x 11 | th[0..7]=theta+2*pi*[j]/8 12 | # approximate the velocity vector in the butterfly coords 13 | z1=z-del*(-b*z+x*y) 14 | x1=x-del*(s*(-x+y)) 15 | @ dt=.025, total=40, xplot=x,yplot=y,zplot=z,axes=3d 16 | @ xmin=-20,xmax=20,ymin=-30,ymax=30,zmin=0,zmax=50 17 | @ xlo=-1.5,ylo=-2,xhi=1.5,yhi=2,bound=10000 18 | done 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ode/ielaspen.ode: -------------------------------------------------------------------------------- 1 | # the pendulum on a spring 2 | # the dimensionless parameter is 3 | # a= k l/m g where k is the spring constant 4 | # r is the length and th is the angle 5 | # 6 | # friction is set to zero 7 | # scale is for animation 8 | r'=rp 9 | rp'=r*thp^2+cos(th)-1-a*(r-1)-f*rp 10 | th'=thp 11 | thp'=-(2*rp*thp+sin(th)+f*thp)/r 12 | par a=1,f=0.05,scale=10 13 | init r=1,th=1.4 14 | # the position of the bob for animation 15 | xb=.5+.5*r*sin(th)/scale 16 | yb=.5-.5*r*cos(th)/scale 17 | r0(x,y)=sqrt((x-.5)^2+(y-.5)^2)*2*scale 18 | q(x,y)=atan2(x-.5,.5-y) 19 | # the energy 20 | 21 | aux e=.5*(rp^2+(r*thp)^2+a*(r-1)^2)-r*(cos(th)-1) 22 | @ total=100,meth=qualrk,dt=.1 23 | @ bound=100000 24 | done 25 | -------------------------------------------------------------------------------- /ode/idoubpend.ode: -------------------------------------------------------------------------------- 1 | t1' = t1p 2 | t2' = t2p 3 | t2p' = -mu*t2p+1/(L2*(m1+m2*(sin(t2-t1))^2))*(-(m1+m2)*g*sin(t2)-(m1+m2)*\ 4 | L1*t1p^2*sin(t2-t1)+cos(t2-t1)*((m1+m2)*g*sin(t1)-m2*L2*t2p^2*sin(t2-t1))) 5 | t1p' = -mu*t1p+1/(L1*(m1+m2*(sin(t2-t1))^2))*(-(m1+m2)*g*sin(t1)+\ 6 | m2*L2*t2p^2*sin(t2-t1)+cos(t2-t1)*(m2*g*sin(t2)+m2*L1*t1p^2*sin(t2-t1))) 7 | # parameters 8 | par L1=4,L2=1,m1=2,m2=1,g=9.8,mu=.01 9 | @ total=200,bound=100000 10 | init t1=1.5,t2=0 11 | th1(x,y)=atan2(x-.5,.5-y) 12 | th1dot(x,y,xp,yp)=(xp*(.5-y)+yp*(x-.5))/((x-.5)^2+(y-.5)^2) 13 | th2(x,y)=atan2(x-.5-.2*sin(t1),-y+.5-.2*cos(t1)) 14 | th2dot(x,y,xp,yp)=(xp*(.5-.2*cos(t1)-y)+yp*(x-.5-.2*sin(t1)))/((.5-.2*cos(t1)-y)^2+(x-.5-.2*sin(t1))^2) 15 | 16 | done -------------------------------------------------------------------------------- /ode/ml1.ode: -------------------------------------------------------------------------------- 1 | # The Morris-Lecar equations ml1.ode 2 | # NOTE: I use only the first letter for declarations! 3 | # Declare the parameters 4 | p gl=.5,gca=1,gk=2 5 | p vk=-.7,vl=-.5,vca=1 6 | p v1=.01,v2=.145,v3=.1,v4=.15 7 | p i=.2,phi=.333 8 | 9 | w nz 10 | # Define some functions 11 | minf(v)=.5*(1+tanh((v-v1)/v2)) 12 | winf(v)= .5*(1+tanh((v-v3)/v4)) 13 | lamw(v)= cosh((v-v3)/(2*v4)) 14 | 15 | # define the right-hand sides 16 | v'= gl*(vl-v)+gk*w*(vk-v)-icaf+i+sig*nz 17 | w'= phi*lamw(v)*(winf(v)-w) 18 | 19 | # where 20 | icaf=gca*minf(v)*(v-vca) 21 | 22 | # and 23 | aux ica=icaf 24 | par sig=.2 25 | # some initial conditions -- not necessary but for completeness 26 | v(0)=.05 27 | w(0)=0 28 | @ total=5000,meth=euler 29 | 30 | # Done!! 31 | d -------------------------------------------------------------------------------- /read_dir.h: -------------------------------------------------------------------------------- 1 | #ifndef _read_dir_h_ 2 | #define _read_dir_h_ 3 | 4 | 5 | typedef struct { 6 | char **dirnames,**filenames; 7 | int nfiles,ndirs; 8 | } FILEINFO; 9 | 10 | 11 | void free_finfo(FILEINFO *ff); 12 | int cmpstringp(const void *p1, const void *p2); 13 | int get_fileinfo_tab(char *wild, char *direct, FILEINFO *ff,char *wild2); 14 | int get_fileinfo(char *wild, char *direct, FILEINFO *ff); 15 | int fil_count(char *direct, int *ndir, int *nfil, char *wild, int *mld, int *mlf); 16 | int change_directory(char *path); 17 | int get_directory(char *direct); 18 | int IsDirectory(char *root, char *path); 19 | void MakeFullPath(char *root, char *filename, char *pathname); 20 | int wild_match(char *string, char *pattern); 21 | 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /ode/lecsimp2.ode: -------------------------------------------------------------------------------- 1 | params iapp=0.0,phi=.333 2 | param va=-.01,vb=0.15,vc=0.1,vd=0.145,gca=1 3 | params vk=-.7,vl=-.5,gk=2.0,gl=.5,om=1 4 | minf(v)=.5*(1+tanh((v-va)/vb)) 5 | ninf(v)=.5*(1+tanh((v-vc)/vd)) 6 | lamn(v)= phi*cosh((v-vc)/(2*vd)) 7 | i=imin+(imax-imin)*(1+cos(2*pi*eps*a*t))/2 8 | par imin=.09,imax=.23 9 | isyn1=eps*gsyn*s2*(v1-esyn) 10 | isyn2=eps*gsyn*s1*(v2-esyn) 11 | p1=delta 12 | p2=-delta 13 | v[1..2]'= i+eps*p[j]+gl*(vl-v[j])+gk*w[j]*(vk-v[j])+gca*minf(v[j])*(1-v[j])+isyn[j] 14 | w[1..2]'= lamn(v[j])*(ninf(v[j])-w[j]) 15 | s[1..2]'=1/(1+exp(-(v[j]-vth)/vshp))-s[j]/tau 16 | par vshp=.05,tau=.25,vth=.05 17 | par esyn=-.65,gsyn=1,delta=0 18 | aux ii=i 19 | par a=1,eps=.002 20 | done 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /canonical/gb_wnet.ode: -------------------------------------------------------------------------------- 1 | # gb_wnet.ode 2 | # gillespie algorithm for brusselator 3 | # using the special declaration - it is a bit faster than by hand 4 | # should work even better for more complex systems 5 | # x1 -> y1 (c1) 6 | # x2+y1 -> y2+Z (c2) 7 | # 2 y1 + y2 -> 3 y1 (c3) 8 | # y1 -> Z2 (c4) 9 | par c1x1=5000,c2x2=50,c3=.00005,c4=5 10 | init y1=1000,y2=2000 11 | # compute the cumulative reactions 12 | p1=c1x1 13 | p2=c2x2*y1 14 | p3=c3*y1*y2*(y1-1)/2 15 | p4=c4*y1 16 | special z=gill(0,p{1-4}) 17 | # time for next reaction 18 | tr'=tr+z(0) 19 | y1'=max(1,y1+z(1)-z(2)+z(3)-z(4)) 20 | y2'=max(1,y2+z(2)-z(3)) 21 | @ bound=100000000,meth=discrete,total=1000000,njmp=1000 22 | @ xp=y1,yp=y2 23 | @ xlo=0,ylo=0,xhi=10000,yhi=10000 24 | aux w[0..4]=z([j]) 25 | done 26 | 27 | -------------------------------------------------------------------------------- /ode/efmxplot.ode: -------------------------------------------------------------------------------- 1 | # plots the rhs of s' 2 | # gcc -fPIC -dynamiclib -arch i386 efmx.c -o efx.so 3 | # File Edit Load-dll - choose efx.so 4 | # choose efmx for the function 5 | # ibar is the mean input, isig is the SD of the currents 6 | # nsig is the amplitude of the white noise 7 | # tau is synaptic time scale 8 | # nit is the number of timesteps to take. Only the last 3/4 are used 9 | # ntr is the number fo trials over which to average 10 | # nn is the number of neurons 11 | par ibar=-.5,isig=.3333,nsig=0.25,tau=10 12 | par nit=200,nn=128,ntr=128 13 | @ meth=discrete,total=50 14 | init s=-1 15 | s'=s+.08 16 | sdot'=sp 17 | sp=0 18 | tt=0 19 | @ bound=1000000000 20 | @ xp=s,yp=sdot,xlo=-1,xhi=3,ylo=-.1,yhi=.2 21 | export {s,ibar,isig,nsig,tau,nit,ntr,nn} {sp} 22 | done -------------------------------------------------------------------------------- /pp_shoot.h: -------------------------------------------------------------------------------- 1 | #ifndef _pp_shoot_h_ 2 | #define _pp_shoot_h_ 3 | 4 | #include 5 | 6 | 7 | void do_bc(double *y__0, double t0, double *y__1, double t1, double *f, int n); 8 | void compile_bvp(void); 9 | void reset_bvp(void); 10 | void init_shoot_range(char *s); 11 | void dump_shoot_range(FILE *fp, int f); 12 | void bad_shoot(int iret); 13 | void do_sh_range(double *ystart, double *yend); 14 | int set_up_homoclinic(void); 15 | int set_up_periodic(int *ipar, int *ivar, double *sect, int *ishow); 16 | void find_bvp_com(int com); 17 | void last_shot(int flag); 18 | int set_up_sh_range(void); 19 | void bvshoot(double *y, double *yend, double err, double eps, int maxit, int *iret, int n, int ishow, int iper, int ipar, int ivar, double sect); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /canonical/cgl.ode: -------------------------------------------------------------------------------- 1 | # coupled Ginsberg-Landau equation 2 | # cgl.ode 3 | !d=1/(h*h) 4 | r[0..127]=u[j]*u[j]+v[j]*v[j] 5 | u0'=u0-(u0-beta*v0)*r0+d*(u1-u0-eps*(v1-v0)) 6 | v0'=v0-(v0+beta*u0)*r0+d*(v1-v0+eps*(u1-u0)) 7 | %[1..126] 8 | u[j]'=u[j]-(u[j]-beta*v[j])*r[j]+d*(u[j+1]+u[j-1]-2*u[j]-eps*(v[j+1]+v[j-1]-2*v[j])) 9 | v[j]'=v[j]-(v[j]+beta*u[j])*r[j]+d*(v[j+1]+v[j-1]-2*v[j]+eps*(u[j+1]+u[j-1]-2*u[j])) 10 | % 11 | u127'=u127-(u127-beta*v127)*r127+d*(u126-u127-eps*(v126-v127)) 12 | v127'=v127-(v127+beta*u127)*r127+d*(v126-v127+eps*(u126-u127)) 13 | # parameters 14 | par beta=-1.8,eps=.8,h=1 15 | aux rr[0..127]=r[j] 16 | init u[50..55]=1 17 | @ dt=.25,total=300,trans=100 18 | done 19 | Use the array to plot u0 256 cols 20 | with colskip=2 rowskip=2,nrows=401,zlo=-1,zhi=+1 21 | 22 | -------------------------------------------------------------------------------- /tabular.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _tabular_h_ 3 | #define _tabular_h_ 4 | 5 | 6 | /* tabular.c */ 7 | void set_auto_eval_flags(int f); 8 | void set_table_name(char *name, int index); 9 | void view_table(int index); 10 | void new_lookup_com(int i); 11 | void new_lookup_ok(void); 12 | double lookupxy(double x, int n, double *xv, double *yv); 13 | double tab_interp(double xlo, double h, double x, double *y, int n, int i); 14 | double lookup(double x, int index); 15 | void init_table(void); 16 | void redo_all_fun_tables(void); 17 | int eval_fun_table(int n, double xlo, double xhi, char *formula, double *y); 18 | int create_fun_table(int npts, double xlo, double xhi, char *formula, int index); 19 | int load_table(char *filename, int index); 20 | int get_lookup_len(int i); 21 | 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /alert.bitmap: -------------------------------------------------------------------------------- 1 | #define alert_width 32 2 | #define alert_height 32 3 | static unsigned char alert_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5 | 0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0, 6 | 0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00, 7 | 0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00, 8 | 0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07, 9 | 0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0xc0, 10 | 0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0x80,0x03,0x00,0x00, 11 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; 13 | -------------------------------------------------------------------------------- /auto_def2.h: -------------------------------------------------------------------------------- 1 | 2 | #define EPSU rap->epsu 3 | #define EPSS rap->epss 4 | #define EPSL rap->epsl 5 | #define IBR iap->ibr 6 | 7 | #define IRS iap->irs 8 | #define NDIM iap->ndim 9 | #define IPS iap->ips 10 | #define ILP iap->ilp 11 | 12 | #define NTST iap->ntst 13 | #define NCOL iap->ncol 14 | #define IAD iap->iad 15 | #define ISP iap->isp 16 | #define ISW iap->isw 17 | #define NBC iap->nbc 18 | #define NIC iap->nint 19 | 20 | #define DS rap->ds 21 | #define DSMAX rap->dsmax 22 | #define DSMIN rap->dsmin 23 | 24 | #define NMX iap->nmx 25 | #define NUZR iap->nuzr 26 | #define RL0 rap->rl0 27 | #define RL1 rap->rl1 28 | #define AUTO_A0 rap->a0 29 | #define AUTO_A1 rap->a1 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /info.bitmap: -------------------------------------------------------------------------------- 1 | #define info_width 32 2 | #define info_height 32 3 | static unsigned char info_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03, 5 | 0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0x80, 6 | 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x07,0x00,0x00,0xf0,0x07,0x00,0x00, 7 | 0xe0,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00, 8 | 0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07, 9 | 0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0xc0, 10 | 0x0f,0x00,0x00,0xf8,0x7f,0x00,0x00,0xf8,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, 11 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; 13 | -------------------------------------------------------------------------------- /ode/pend-cart1-kick.ode: -------------------------------------------------------------------------------- 1 | # pendulum on a cart 2 | # uses DAE solver to solve for x'', th1'' 3 | # 4 | # pend-cart1.ode 5 | # 6 | # masses of cart and pendulum (kg) 7 | par mc=5,mp=1 8 | # length (m) and gravity 9 | par l=1,g=9.8 10 | # simple linear friction 11 | par muc=0.01,mup=0.1 12 | # set up DAEs 13 | 0=(mc+mp)*xdd+mp*l*cos(th1)*th1dd-mp*l*sin(th1)*th1p^2+muc*xp 14 | 0=cos(th1)*xdd+l*th1dd+g*sin(th1)+mup*th1p 15 | solv xdd=0 16 | solv th1dd=0 17 | # 18 | # 19 | # dynamics 20 | x'=xp 21 | xp'=xdd 22 | th1'=th1p 23 | th1p'=th1dd 24 | # 25 | # the physics isn't quite right, but now I will add a kick 26 | global 1 th1p {th1=th1-kick;x=x+r*kick} 27 | par kick=.05,r=0 28 | # track accelerations 29 | aux xpp=xdd 30 | aux th1pp=th1dd 31 | @ dt=.02 32 | # nice ICs 33 | init th1=1.5 34 | done 35 | -------------------------------------------------------------------------------- /start.bitmap: -------------------------------------------------------------------------------- 1 | #define start_width 32 2 | #define start_height 32 3 | static unsigned char start_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8, 5 | 0x07,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0xe0,0xff,0xff,0x0f,0x10,0x00, 6 | 0x00,0x18,0x08,0x00,0x00,0x18,0x08,0x80,0x00,0x18,0x08,0x90,0x04,0x18,0x08, 7 | 0xa0,0x02,0x18,0x08,0x00,0x00,0x18,0x08,0x38,0x0e,0x18,0x08,0x00,0x00,0x18, 8 | 0x08,0xa0,0x02,0x18,0x08,0x90,0x04,0x18,0x08,0x80,0x00,0x18,0x08,0x00,0x00, 9 | 0x18,0x08,0x00,0x00,0x18,0xf8,0xff,0xff,0x1f,0xf0,0xff,0xff,0x1f,0x00,0x00, 10 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 11 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; 13 | -------------------------------------------------------------------------------- /axes2.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _axes2_h_ 3 | #define _axes2_h_ 4 | 5 | #include 6 | 7 | void re_title(void); 8 | void get_title_str(char *s1, char *s2, char *s3); 9 | void make_title(char *str); 10 | double dbl_raise(double x, int y); 11 | double make_tics(double tmin, double tmax); 12 | void find_max_min_tic(double *tmin, double *tmax, double tic); 13 | void redraw_cube_pt(double theta, double phi); 14 | void do_axes(void); 15 | void redraw_cube(double theta, double phi); 16 | void draw_unit_cube(void); 17 | void Frame_3d(void); 18 | void Box_axis(double x_min, double x_max, double y_min, double y_max, char *sx, char *sy, int flag); 19 | void draw_ytics(char *s1, double start, double incr, double end); 20 | void draw_xtics(char *s2, double start, double incr, double end); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /lunch-new.h: -------------------------------------------------------------------------------- 1 | #ifndef _lunch_new_h_ 2 | #define _lunch_new_h_ 3 | 4 | 5 | #include 6 | #include "form_ode.h" 7 | 8 | 9 | 10 | void file_inf(void); 11 | void ps_write_pars(FILE *fp); 12 | void do_info(FILE *fp); 13 | int read_lunch(FILE *fp); 14 | void do_lunch(int f); 15 | void dump_eqn(FILE *fp); 16 | void io_numerics(int f, FILE *fp); 17 | void io_parameter_file(char *fn, int flag); 18 | void io_ic_file(char *fn, int flag); 19 | void io_parameters(int f, FILE *fp); 20 | void io_exprs(int f, FILE *fp); 21 | void io_graph(int f, FILE *fp); 22 | void io_int(int *i, FILE *fp, int f, char *ss); 23 | void io_double(double *z, FILE *fp, int f, char *ss); 24 | void io_float(float *z, FILE *fp, int f, char *ss); 25 | void io_string(char *s, int len, FILE *fp, int f); 26 | 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ode/fancylorenz.ode: -------------------------------------------------------------------------------- 1 | # the lorenz equations 2 | # with some fancy graphics options 3 | x'=s*(-x+y) 4 | y'=r*x-y-x*z 5 | z'=-b*z+x*y 6 | par r=27,s=10,b=2.66 7 | init x=-7.5,y=-3.6,z=30 8 | # now add some projection planes for 2D plote 9 | aux x2=xplane 10 | aux y2=yplane 11 | aux z2=zplane 12 | par xplane=-35,yplane=60,zplane=-10 13 | # set up the numerics 14 | @ total=50,dt=.02 15 | # set up 3D plot 16 | @ xplot=x,yplot=y,zplot=z,axes=3d 17 | # tell XPP there are 4 plots altogether 18 | @ nplot=4 19 | # here are the 3 projections 20 | @ xp2=x,yp2=y,zp2=z2 21 | @ xp3=x,yp3=y2,zp3=z 22 | @ xp4=x2,yp4=y,zp4=z 23 | # set up the 3D window 24 | @ xmin=-40,xmax=18,ymin=-24,ymax=64,zmin=-12,zmax=45 25 | @ xlo=-1.4,ylo=-1.7,xhi=1.7,yhi=1.7 26 | # and rotate the plot a bit so it looks nice 27 | @ theta=35 28 | done 29 | -------------------------------------------------------------------------------- /filebrowse.bitmap: -------------------------------------------------------------------------------- 1 | #define filebrowse_width 32 2 | #define filebrowse_height 32 3 | static unsigned char filebrowse_bits[] = { 4 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 5 | 0x00,0xe0,0xff,0xff,0x07,0x10,0x00,0x00,0x08,0x08,0x00,0x00,0x10,0xfc,0xff, 6 | 0xff,0x3f,0x04,0x00,0x00,0x20,0xc4,0xff,0xff,0x23,0x44,0x00,0x00,0x22,0x44, 7 | 0x00,0x00,0x22,0x44,0xe0,0x0f,0x22,0x44,0x00,0x00,0x22,0x44,0x00,0x00,0x22, 8 | 0xc4,0xff,0xff,0x23,0x04,0x00,0x00,0x20,0xc4,0xff,0xff,0x23,0xe4,0xff,0xff, 9 | 0x27,0xf4,0xff,0xff,0x2f,0xf4,0xff,0xff,0x2f,0x14,0x00,0x00,0x28,0x14,0x00, 10 | 0x00,0x28,0x14,0xf0,0x1f,0x28,0x14,0x00,0x00,0x28,0x14,0x00,0x00,0x28,0x1c, 11 | 0x00,0x00,0x38,0xf0,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; 13 | -------------------------------------------------------------------------------- /simplenet.h: -------------------------------------------------------------------------------- 1 | #ifndef _simplenet_h_ 2 | #define _simplenet_h_ 3 | 4 | int get_vector_info(); 5 | double net_interp(double x, int i); 6 | double network_value(double x, int i); 7 | void init_net(double *v, int n); 8 | int add_spec_fun(char *name, char *rhs); 9 | void add_special_name(char *name, char *rhs); 10 | int add_vectorizer(char *name, char *rhs); 11 | void add_vectorizer_name(char *name, char *rhs); 12 | int is_network(char *s); 13 | void eval_all_nets(void); 14 | void evaluate_network(int ind); 15 | void update_all_ffts(void); 16 | void update_fft(int ind); 17 | void fft_conv(int it, int n, double *values, double *yy, double *fftr, double *ffti, double *dr, double *di); 18 | int gilparse(char *s, int *ind, int *nn); 19 | int g_namelist(char *s, char *root, int *flag, int *i1, int *i2); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ode/example.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | /* 4 | some example functions 5 | */ 6 | 7 | lv(double *in,double *out,int nin,int nout,double *var,double *con) 8 | { 9 | double x=in[0],y=in[1]; 10 | double a=in[2],b=in[3],c=in[4],d=in[5]; 11 | double t=in[6]; 12 | out[0]=a*x*(b-y); 13 | out[1]=c*y*(-d+x); 14 | } 15 | 16 | vdp(double *in,double *out,int nin,int nout,double *var,double *con) 17 | { 18 | double x=in[0],y=in[1]; 19 | double a=in[2],b=in[3],c=in[4],d=in[5]; 20 | double t=in[6]; 21 | out[0]=y; 22 | out[1]=-x+a*y*(1-x*x); 23 | 24 | } 25 | 26 | duff(double *in,double *out,int nin,int nout,double *var,double *con) 27 | { 28 | double x=in[0],y=in[1]; 29 | double a=in[2],b=in[3],c=in[4],d=in[5]; 30 | double t=in[6]; 31 | out[0]=y; 32 | out[1]=x*(1-x*x)+a*sin(b*t)-c*y; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /ode/examx.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | /* 4 | some example functions 5 | */ 6 | 7 | 8 | lv(double *in,double *out,int nin,int nout,double *var,double *con) 9 | { 10 | double x=in[0],y=in[1]; 11 | double a=in[2],b=in[3],c=in[4],d=in[5]; 12 | double t=in[6]; 13 | out[0]=a*x*(b-y); 14 | out[1]=c*y*(-d+x); 15 | } 16 | 17 | vdp(double *in,double *out,int nin,int nout,double *var,double *con) 18 | { 19 | double x=in[0],y=in[1]; 20 | double a=in[2],b=in[3],c=in[4],d=in[5]; 21 | double t=in[6]; 22 | out[0]=y; 23 | out[1]=-x+a*y*(1-x*x); 24 | 25 | } 26 | 27 | duff(double *in,double *out,int nin,int nout,double *var,double *con) 28 | { 29 | double x=in[0],y=in[1]; 30 | double a=in[2],b=in[3],c=in[4],d=in[5]; 31 | double t=in[6]; 32 | out[0]=y; 33 | out[1]=x*(1-x*x)+a*sin(b*t)-c*y; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /volterra2.h: -------------------------------------------------------------------------------- 1 | #ifndef _volterra2_h_ 2 | #define _volterra2_h_ 3 | 4 | 5 | /* volterra2.c */ 6 | double ker_val(int in); 7 | void alloc_v_memory(void); 8 | void allocate_volterra(int npts, int flag); 9 | void re_evaluate_kernels(void); 10 | void alloc_kernels(int flag); 11 | void init_sums(double t0, int n, double dt, int i0, int iend, int ishift); 12 | double alpha1n(double mu, double dt, double t, double t0); 13 | double alpbetjn(double mu, double dt, int l); 14 | double betnn(double mu, double dt, double t0, double t); 15 | void get_kn(double *y, double t); 16 | int volterra(double *y, double *t, double dt, int nt, int neq, int *istart, double *work); 17 | int volt_step(double *y, double t, double dt, int neq, double *yg, double *yp, double *yp2, double *ytemp, double *errvec, double *jac); 18 | 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /ode/efmxplott.ode: -------------------------------------------------------------------------------- 1 | # plots the rhs of s' 2 | # gcc -fPIC -dynamiclib efmx.c -o efx.so 3 | # File Edit Load-dll - choose efx.so 4 | # choose efmx for the function 5 | # ibar is the mean input, isig is the SD of the currents 6 | # nsig is the amplitude of the white noise 7 | # tau is synaptic time scale 8 | # nit is the number of timesteps to take. Only the last 3/4 are used 9 | # ntr is the number fo trials over which to average 10 | # nn is the number of neurons 11 | par ibar=-.5,isig=.3333,nsig=0,tau=10 12 | par nit=200,nn=100,ntr=100 13 | @ meth=discrete,total=50 14 | init s=-1 15 | s'=s+.08 16 | sd'=sp 17 | # plots the time as well 18 | tim'=tt 19 | sp=0 20 | tt=0 21 | #aux sdot=sp 22 | #aux time=tt 23 | @ bound=1000000000 24 | @ xp=s,yp=sd,xlo=-1,xhi=3,ylo=-.1,yhi=.2 25 | export {s,ibar,isig,nsig,tau,nit,ntr,nn} {sp,tt} 26 | done -------------------------------------------------------------------------------- /ode/kohonen.ode: -------------------------------------------------------------------------------- 1 | # this implements the kohonen algorithm 2 | # using the findext code in xpp 3 | number ntot=100 4 | # here is the Gauddian like nbhd function 5 | h(u)=exp(-sig*(1-cos(2*pi*u*k/ntot))) 6 | par sig=10 7 | # k=1 gives 1 peak, k=2, 2, etc 8 | # eps is the growth rate 9 | par k=1,eps=.1 10 | # generate a random stimulus 11 | z=2*ran(1)-1 12 | # compute distance between stimulus and weight 13 | d[0..99]=abs(w[j]-z) 14 | # find minimum mx(2) is value mx(3) is index 15 | special mx=findext(-1,100,1,d0) 16 | # here is the algorithm 17 | w[0..99]'=w[j]+eps*(z-w[j])*h(mx(3)-[j]) 18 | # keep track of the index 19 | ip'=mx(3) 20 | # and keep track of the stim 21 | aux zz=z 22 | # randomly initialize 23 | global 0 t-t0 {w[0..99]=2*ran(1)-1} 24 | par t0=0 25 | # 26 | @ meth=discrete, total=16000,nout=8 27 | @ colormap=6 28 | d 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /canonical/huygens.ode: -------------------------------------------------------------------------------- 1 | # Huygens pendulums 2 | # x is position of the cart, p1,p2 are angles of the pendulum 3 | # v, q1,q2 are velocities 4 | par g=9.8,l=1,mp=1,mc=1 5 | par fp=.1,fc=.1 6 | par k=0.1 7 | # from Bennett et al PRS A 2002 458 563 8 | # 9 | 0=p1dd+fp*q1+(g/l)*sin(p1)+xdd*cos(p1)/l 10 | 0=p2dd+fp*q2+(g/l)*sin(p2)+xdd*cos(p2)/l 11 | 0=(mc+2*mp)*xdd+fc*v+k*x+mp*l*(cos(p1)*p1dd-sin(p1)*q1^2+cos(p2)*p2dd-sin(p2)*q2^2) 12 | solv p1dd=0 13 | solv p2dd=0 14 | solve xdd=0 15 | # 16 | # 17 | # dynamics 18 | x'=v 19 | v'=xdd 20 | p1'=q1 21 | q1'=p1dd 22 | p2'=q2 23 | q2'=p2dd 24 | # escapement mechanism 25 | global -1 p1+p0 {q1=(1-c)*abs(q1)+eps} 26 | global 1 p1-p0 {q1=-(1-c)*abs(q1)-eps} 27 | global -1 p2+p0 {q2=(1-c)*abs(q2)+eps} 28 | global 1 p2-p0 {q2=-(1-c)*abs(q2)-eps} 29 | par p0=.5 30 | init p1=1.5,p2=1.8 31 | par c=.1,eps=.3 32 | # 33 | done 34 | -------------------------------------------------------------------------------- /ode/tstheti.ode: -------------------------------------------------------------------------------- 1 | # tstheti.ode 2 | # a heteroclinic orbit 3 | # unstable at u=1, stable at u=0 4 | f(u,up)=up 5 | g(u,up)=-c*up-u*(1-u)*(u-a) 6 | # the dynamics 7 | u'=per*f(u,up) 8 | up'=per*g(u,up) 9 | # dummy equations for the fixed points 10 | uleft'=0 11 | upleft'=0 12 | uright'=0 13 | upright'=0 14 | # the velocity parameter 15 | c'=0 16 | # fixed points 17 | b f(uleft,upleft) 18 | b g(uleft,upleft) 19 | b f(uright,upright) 20 | b g(uright,upright) 21 | # projection conditions 22 | b hom_bcs(0) 23 | b hom_bcs(1) 24 | # parameters 25 | par per=6.67,a=.5 26 | # initial data 27 | init u=.918,up=-.0577,c=0 28 | # initial fixed points 29 | init uleft=1,upleft=0,uright=0,upright=0 30 | @ total=1.01,dt=.01 31 | @ xp=u,yp=up,xlo=-.25,xhi=1.25,ylo=-.75,yhi=.25 32 | # some AUTO parameters 33 | @ epss=1e-7,epsu=1e-7,epsl=1e-7,parmax=60,dsmax=5,dsmin=1e-4,ntst=35 34 | done 35 | -------------------------------------------------------------------------------- /my_ps.h: -------------------------------------------------------------------------------- 1 | #ifndef _my_ps_h_ 2 | #define _my_ps_h_ 3 | 4 | 5 | /* my_ps.c */ 6 | int ps_init(char *filename, int color); 7 | void ps_stroke(void); 8 | void ps_do_color(int color); 9 | void ps_setcolor(int color); 10 | void ps_end(void); 11 | void ps_bead(int x, int y); 12 | void ps_frect(int x, int y, int w, int h); 13 | void ps_last_pt_off(void); 14 | void ps_line(int xp1, int yp1, int xp2, int yp2); 15 | void chk_ps_lines(void); 16 | void ps_linetype(int linetype); 17 | void ps_point(int x, int y); 18 | void ps_write(char *str); 19 | void ps_fnt(int cf, int scale); 20 | void ps_show(char *str, int type); 21 | void ps_abs(int x, int y); 22 | void ps_rel(int x, int y); 23 | void special_put_text_ps(int x, int y, char *str, int size); 24 | void fancy_ps_text(int x, int y, char *str, int size, int font); 25 | void ps_text(int x, int y, char *str); 26 | 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ode/cuplamdif.ode: -------------------------------------------------------------------------------- 1 | # cuplamdif.ode 2 | # the functions F(u,v), G(u1,v1) 3 | par lam=1.5 q=0.8 d=1 u0=1 u10=0.95 4 | !spi=1/sqrt(pi) 5 | # the integral equations; since (0,0,0,0) is a rest point, I 6 | # add a small quickly decaying transient 7 | volt u=u0*exp(-5*t)+spi*(int[.5]{exp(-t)#f}+int[.5]{exp(-t-d/(t+.0001))#f1}) 8 | volt v=spi*(int[.5]{exp(-t)#g}+int[.5]{exp(-t-d/(t+.0001))#g1}) 9 | volt u1=u10*exp(-5*t)+spi*(int[.5]{exp(-t)#f1}+int[.5]{exp(-t-d/(t+.0001))#f}) 10 | volt v1=spi*(int[.5]{exp(-t)#g1}+int[.5]{exp(-t-d/(t+.0001))#g}) 11 | # the four functions f,g,f1,g1 12 | @ autoeval=1 13 | f=lam*u-v-(u*u+v*v)*(u+q*v) 14 | g=lam*v+u-(u*u+v*v)*(v-q*u) 15 | f1=lam*u1-v1-(u1*u1+v1*v1)*(u1+q*v1) 16 | g1=lam*v1+u1-(u1*u1+v1*v1)*(v1-q*u1) 17 | th1=atan2(u,v) 18 | th2=atan2(u1,v1) 19 | aux phi=mod(th1-th2,2*pi) 20 | aux ui=u10 21 | aux dd=d 22 | @ total=150 23 | done 24 | -------------------------------------------------------------------------------- /my_svg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _my_svg_h_ 3 | #define _my_svg_h_ 4 | 5 | 6 | /* my_ps.c */ 7 | int svg_init(char *filename, int color); 8 | void svg_stroke(void); 9 | void svg_do_color(int color); 10 | void svg_setcolor(int color); 11 | void svg_end(void); 12 | void svg_bead(int x, int y); 13 | void svg_frect(int x, int y, int w, int h); 14 | void svg_last_pt_off(void); 15 | void svg_line(int xp1, int yp1, int xp2, int yp2); 16 | void chk_svg_lines(void); 17 | void svg_linetype(int linetype); 18 | void svg_point(int x, int y); 19 | void svg_write(char *str); 20 | void svg_fnt(int cf, int scale); 21 | void svg_show(char *str, int type); 22 | void svg_abs(int x, int y); 23 | void svg_rel(int x, int y); 24 | void special_put_text_svg(int x, int y, char *str, int size); 25 | void fancy_svg_text(int x, int y, char *str, int size, int font); 26 | void svg_text(int x, int y, char *str); 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ode/ml-range.ode: -------------------------------------------------------------------------------- 1 | # The Morris-Lecar equations ml1.ode 2 | # NOTE: I use only the first letter for declarations! 3 | # Declare the parameters 4 | p gl=.5,gca=1,gk=2 5 | p vk=-.7,vl=-.5,vca=1 6 | p v1=.01,v2=.145,v3=.1,v4=.15 7 | p i=.2,phi=.333 8 | 9 | w nz 10 | # Define some functions 11 | minf(v)=.5*(1+tanh((v-v1)/v2)) 12 | winf(v)= .5*(1+tanh((v-v3)/v4)) 13 | lamw(v)= cosh((v-v3)/(2*v4)) 14 | 15 | # define the right-hand sides 16 | v'= gl*(vl-v)+gk*w*(vk-v)-icaf+i+sig*nz 17 | w'= phi*lamw(v)*(winf(v)-w) 18 | 19 | # where 20 | icaf=gca*minf(v)*(v-vca) 21 | 22 | # and 23 | aux ica=icaf 24 | par sig=0 25 | # some initial conditions -- not necessary but for completeness 26 | v(0)=.05 27 | w(0)=0 28 | @ total=100,trans=50 29 | @ xp=v,yp=w,xlo=-.4,xhi=.6,ylo=-.1,yhi=.6 30 | @ range=1,rangeover=i,rangestep=50,rangelow=-.2,rangehigh=.5 31 | @ rangereset=yes 32 | @ dfgrid=16,ncdraw=1,dfdraw=2 33 | # Done!! 34 | d -------------------------------------------------------------------------------- /canonical/gberg.ode: -------------------------------------------------------------------------------- 1 | # gberg.ode 2 | # A <> boundary value problem whose solution represents a 3 | # rotating spiral wave solution to a two-dimensional partial 4 | # differential equation. There are 3 dynamic variables and 5 | # a free shooting parameter -- omeg -- 6 | # Since 4 boundary conditions must be satisfied, there must be 4 7 | # variables and thus the free parameter is treated 8 | # dynamically 9 | init a=0.0118 ap=1.18 k=0 omeg=-0.19 10 | par d=0.177 q=0.5 sig=3 11 | # the odes... 12 | a'=ap 13 | ap'=a*k*k-ap/t+a/(t*t)-a*(1-a*a)/d 14 | k'=-k/t-2*k*ap/a-(omeg+q*a*a)/d 15 | omeg'=0 16 | # the boundary conditions 17 | # left end - need to be a bit careful since it is singular 18 | bndry a-t*ap 19 | bndry k 20 | # right end - note primes here refer to value at the right end 21 | bndry ap' 22 | bndry k' 23 | # set it up for the user 24 | @ xhi=1 t0=.01,dt=.01,total=.99 25 | done 26 | 27 | -------------------------------------------------------------------------------- /bc.bitmap: -------------------------------------------------------------------------------- 1 | #define bc_width 32 2 | #define bc_height 32 3 | static unsigned char bc_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x20, 7 | 0x12, 0x00, 0x00, 0x30, 0x12, 0x00, 0x00, 0x20, 0x12, 0xc0, 0x03, 0x20, 8 | 0x0c, 0x38, 0x0c, 0x70, 0x00, 0x06, 0x10, 0x00, 0x80, 0x01, 0x20, 0x00, 9 | 0x40, 0x00, 0x40, 0x00, 0x20, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x01, 10 | 0x08, 0x00, 0x00, 0x12, 0x04, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x18, 11 | 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /ic.bitmap: -------------------------------------------------------------------------------- 1 | #define ic_width 32 2 | #define ic_height 32 3 | static unsigned char ic_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x90, 0x13, 0x40, 8 | 0x02, 0x4a, 0x24, 0x60, 0x04, 0x29, 0x28, 0x50, 0x88, 0x28, 0x28, 0x40, 9 | 0x50, 0x28, 0xa8, 0x47, 0x20, 0x28, 0x28, 0x40, 0x50, 0x28, 0xa8, 0x47, 10 | 0x88, 0x28, 0x28, 0x40, 0x04, 0x49, 0x24, 0x40, 0x02, 0x92, 0x13, 0x40, 11 | 0x00, 0x20, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /auto.bitmap: -------------------------------------------------------------------------------- 1 | #define auto_width 32 2 | #define auto_height 32 3 | static unsigned char auto_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 5 | 0x06, 0x00, 0x00, 0x0c, 0x06, 0x00, 0x00, 0x06, 0x06, 0x00, 0x80, 0x03, 6 | 0x06, 0x00, 0xc0, 0x00, 0x06, 0x00, 0x60, 0x00, 0x06, 0x00, 0x30, 0x00, 7 | 0x06, 0x00, 0x30, 0x00, 0x06, 0x00, 0x10, 0x00, 0x06, 0x00, 0x18, 0x00, 8 | 0x06, 0x00, 0x18, 0x00, 0x06, 0x00, 0x0c, 0x00, 0xff, 0xff, 0x3f, 0x33, 9 | 0xff, 0xff, 0x3f, 0x33, 0x06, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0c, 0x00, 10 | 0x46, 0x00, 0x18, 0x00, 0x86, 0x00, 0x18, 0x00, 0x06, 0x01, 0x30, 0x00, 11 | 0x06, 0x03, 0x60, 0x00, 0x86, 0x04, 0x60, 0x00, 0x46, 0x08, 0xc0, 0x00, 12 | 0x06, 0x00, 0x80, 0x01, 0x06, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x0e, 13 | 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /canonical/gberga.ode: -------------------------------------------------------------------------------- 1 | # gberg.ode 2 | # A <> boundary value problem whose solution represents a 3 | # rotating spiral wave solution to a two-dimensional partial 4 | # differential equation. There are 3 dynamic variables and 5 | # a free shooting parameter -- omeg -- 6 | # Since 4 boundary conditions must be satisfied, there must be 4 7 | # variables and thus the free parameter is treated 8 | # dynamically 9 | init a=0.0118 ap=1.18 k=0 omeg=-0.19,s=.01 10 | par d=0.177 q=0.5 sig=3 11 | # the odes... 12 | a'=ap 13 | ap'=a*k*k-ap/s+a/(s^2)-a*(1-a*a)/d 14 | k'=-k/s-2*k*ap/a-(omeg+q*a*a)/d 15 | omeg'=0 16 | s'=1 17 | # the boundary conditions 18 | # left end - need to be a bit careful since it is singular 19 | bndry a-s*ap 20 | bndry k 21 | bdry s-.01 22 | # right end - note primes here refer to value at the right end 23 | bndry ap' 24 | bndry k' 25 | # set it up for the user 26 | @ xhi=1,total=1,dt=.001 27 | done 28 | 29 | -------------------------------------------------------------------------------- /eqns.bitmap: -------------------------------------------------------------------------------- 1 | #define eqns_width 32 2 | #define eqns_height 32 3 | static unsigned char eqns_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 9 | 0x04, 0xe1, 0x03, 0x00, 0x04, 0x01, 0x40, 0x12, 0x04, 0x01, 0x40, 0x12, 10 | 0x88, 0xe0, 0x03, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /array.bitmap: -------------------------------------------------------------------------------- 1 | #define array_width 32 2 | #define array_height 32 3 | static unsigned char array_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x46, 0x00, 0x00, 0x33, 5 | 0x1e, 0x00, 0x00, 0x3c, 0x3e, 0x01, 0x80, 0x3e, 0x76, 0x04, 0x40, 0x37, 6 | 0xe6, 0x0a, 0x10, 0x33, 0xc6, 0x05, 0xa0, 0x31, 0x86, 0x23, 0xc8, 0x30, 7 | 0x06, 0x8f, 0xe0, 0x30, 0x06, 0x5c, 0x75, 0x34, 0x06, 0xb8, 0x3a, 0x31, 8 | 0x06, 0x70, 0x18, 0x32, 0x2e, 0xe0, 0x4f, 0x30, 0x46, 0xc0, 0x87, 0x39, 9 | 0x0e, 0x01, 0x10, 0x3e, 0x5e, 0x00, 0x64, 0x3f, 0x3e, 0x05, 0x90, 0x37, 10 | 0x76, 0x10, 0xe9, 0x31, 0xe6, 0x85, 0xf2, 0x30, 0x86, 0x2b, 0x3c, 0x30, 11 | 0x06, 0x57, 0x1e, 0x30, 0x06, 0x0e, 0x0f, 0x30, 0x06, 0xdc, 0x03, 0x30, 12 | 0x06, 0xf0, 0x01, 0x30, 0x06, 0x60, 0x00, 0x30, 0x06, 0x00, 0x00, 0x30, 13 | 0x06, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x30, 0xfe, 0xff, 0xff, 0x3f, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /delay.bitmap: -------------------------------------------------------------------------------- 1 | #define delay_width 32 2 | #define delay_height 32 3 | static unsigned char delay_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x68, 0x04, 0x19, 0x01, 0xc8, 8 | 0x8c, 0x19, 0x01, 0xc8, 0xd8, 0xd8, 0x07, 0xce, 0x70, 0x18, 0x71, 0xc9, 9 | 0x70, 0x18, 0x01, 0xc9, 0x78, 0x18, 0x01, 0xc9, 0xcc, 0x18, 0x01, 0xc9, 10 | 0x86, 0x19, 0x03, 0xce, 0x00, 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /graph.bitmap: -------------------------------------------------------------------------------- 1 | #define graph_width 32 2 | #define graph_height 32 3 | static unsigned char graph_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x80, 0x01, 5 | 0x06, 0x00, 0x80, 0x01, 0x06, 0x00, 0x80, 0x03, 0x06, 0x00, 0x80, 0x02, 6 | 0x06, 0x00, 0x40, 0x02, 0x06, 0x00, 0x40, 0x06, 0x86, 0x07, 0x40, 0x04, 7 | 0xe6, 0x04, 0x20, 0x04, 0x36, 0x0c, 0x20, 0x04, 0x1e, 0x08, 0x20, 0x04, 8 | 0x0e, 0x08, 0x10, 0x08, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 9 | 0x06, 0x10, 0x10, 0x08, 0x06, 0x30, 0x18, 0x08, 0x06, 0x60, 0x08, 0x08, 10 | 0x06, 0xc0, 0x08, 0x10, 0x06, 0x80, 0x09, 0x30, 0x06, 0x00, 0x07, 0xe0, 11 | 0x06, 0x00, 0x00, 0xc0, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 12 | 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /param.bitmap: -------------------------------------------------------------------------------- 1 | #define param_width 32 2 | #define param_height 32 3 | static unsigned char param_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x18, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0a, 0x7c, 0x04, 0x00, 0x08, 8 | 0xc6, 0x06, 0x00, 0x08, 0x82, 0xc3, 0x0f, 0x08, 0x02, 0x03, 0x00, 0x08, 9 | 0x02, 0xc7, 0x0f, 0x08, 0x82, 0x0d, 0x00, 0x08, 0x86, 0x18, 0x00, 0x08, 10 | 0xfc, 0x30, 0x60, 0x08, 0x00, 0x00, 0x60, 0x3e, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /aniwin.bitmap: -------------------------------------------------------------------------------- 1 | #define aniwin_width 32 2 | #define aniwin_height 32 3 | static unsigned char aniwin_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 5 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 6 | 0x00, 0xc0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 7 | 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 8 | 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 9 | 0x00, 0x03, 0x09, 0x00, 0x00, 0x81, 0x04, 0x00, 0xb0, 0x41, 0x04, 0x00, 10 | 0xf8, 0x30, 0x02, 0x00, 0xfc, 0x01, 0x01, 0x00, 0xfc, 0xc1, 0x00, 0x00, 11 | 0xfc, 0x31, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /browse.bitmap: -------------------------------------------------------------------------------- 1 | #define browse_width 32 2 | #define browse_height 32 3 | static unsigned char browse_bits[] = { 4 | 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xf9, 0xe1, 0x87, 0x9f, 5 | 0x09, 0x21, 0x84, 0x90, 0x09, 0x21, 0x84, 0x90, 0xf9, 0xe1, 0x87, 0x9f, 6 | 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 7 | 0x7d, 0x22, 0x44, 0xbc, 0x11, 0x14, 0x28, 0xa0, 0x11, 0x08, 0x10, 0x90, 8 | 0x11, 0x14, 0x10, 0x88, 0x11, 0x22, 0x10, 0xbc, 0x01, 0x00, 0x00, 0x80, 9 | 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x0d, 0x0c, 0x18, 0xe6, 10 | 0x09, 0x10, 0x24, 0xc4, 0x09, 0x08, 0x18, 0xc4, 0x09, 0x10, 0x24, 0xc4, 11 | 0x1d, 0x0d, 0x18, 0xee, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 12 | 0x0d, 0x04, 0x30, 0xb0, 0x11, 0x14, 0x48, 0x88, 0x11, 0x3c, 0x48, 0xb8, 13 | 0x09, 0x10, 0x48, 0xc8, 0x1d, 0x11, 0x32, 0xb0, 0x01, 0x00, 0x00, 0x80, 14 | 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff}; 15 | -------------------------------------------------------------------------------- /equilib.bitmap: -------------------------------------------------------------------------------- 1 | #define equilib_width 32 2 | #define equilib_height 32 3 | static unsigned char equilib_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 6 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x90, 0x04, 0x00, 7 | 0x00, 0xa0, 0x02, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x80, 0x80, 0x00, 0x01, 8 | 0x40, 0x80, 0x00, 0x02, 0x20, 0xc0, 0x01, 0x04, 0xf8, 0xff, 0xff, 0x1f, 9 | 0x20, 0xc0, 0x01, 0x04, 0x40, 0x80, 0x00, 0x02, 0x80, 0x80, 0x00, 0x01, 10 | 0x00, 0xc0, 0x01, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x90, 0x04, 0x00, 11 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 12 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 15 | -------------------------------------------------------------------------------- /txtview.bitmap: -------------------------------------------------------------------------------- 1 | #define txtview_width 32 2 | #define txtview_height 32 3 | static unsigned char txtview_bits[] = { 4 | 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xf9, 0xe1, 0x87, 0x9f, 5 | 0x09, 0x21, 0x84, 0x90, 0x09, 0x21, 0x84, 0x90, 0xf9, 0xe1, 0x87, 0x9f, 6 | 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 7 | 0x01, 0x10, 0x00, 0x80, 0x01, 0x88, 0x07, 0x80, 0x89, 0x88, 0x88, 0x87, 8 | 0x51, 0x84, 0x0f, 0x80, 0xf9, 0x88, 0x88, 0x87, 0x51, 0x98, 0x08, 0x80, 9 | 0x89, 0x10, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 10 | 0x11, 0x04, 0x02, 0x80, 0x11, 0x04, 0x00, 0x80, 0xfd, 0x04, 0xe0, 0x80, 11 | 0x11, 0x1c, 0x22, 0x80, 0x11, 0x34, 0xe2, 0x80, 0x11, 0x24, 0x82, 0x80, 12 | 0x11, 0x24, 0xe2, 0x80, 0x11, 0x24, 0x02, 0x80, 0x01, 0x00, 0x00, 0x80, 13 | 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 14 | 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff}; 15 | -------------------------------------------------------------------------------- /ode/cobweb2.ode: -------------------------------------------------------------------------------- 1 | # way to fool XPP into cobwebbing 2 | # first I define a function that every other step evaluates 3 | # the map -- in the alternate steps, it just keeps the same 4 | # value so that it alternates between horizontal and vertical 5 | # jumps 6 | g(x,y)=if(mod(t,2)<.5)then(f(x))else(y) 7 | # note that 't' is the iteration number 0,1,2,... 8 | # if t is even evaluate f otherwise keep the old y 9 | y(t+1)=g(x,y) 10 | x(t+1)=if(t==0)then(x)else(y) 11 | # note that x(t+2)=f(x(t)) so every other point is the map! 12 | f(x)=a*x*(1-x) 13 | par a=3.95 14 | init y=0,x=.01 15 | # always start y=0 16 | # 17 | # add this plot to the graph to see the actual function 18 | # this assumes that you have chosen at least 100 iterates 19 | aux map=f(.01*t) 20 | aux st=.01*t 21 | # some convenient settings for the graphics 22 | @ xlo=0,ylo=0,xhi=1,yhi=1 23 | @ xp=x,yp=y 24 | # tell xpp that it is discrete and iterate 100 times 25 | @ meth=discrete,total=100 26 | done 27 | -------------------------------------------------------------------------------- /stiff.h: -------------------------------------------------------------------------------- 1 | #ifndef _stiff_h_ 2 | #define _stiff_h_ 3 | 4 | 5 | /* stiff.c */ 6 | void jacobn(double x, double *y, double *dfdx, double *dermat, double eps, double *work, int n); 7 | int adaptive(double *ystart, int nvar, double *xs, double x2, double eps, double *hguess, double hmin, double *work, int *ier, double epjac, int iflag, int *jstart); 8 | int gadaptive(double *ystart, int nvar, double *xs, double x2, double eps, double *hguess, double hmin, double *work, int *ier, double epjac, int iflag, int *jstart); 9 | int stiff(double y[], double dydx[], int n, double *x, double htry, double eps, double yscal[], double *hdid, double *hnext, double *work, double epjac, int *ier); 10 | int rkqs(double *y, double *dydx, int n, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext, double *work, int *ier); 11 | void rkck(double *y, double *dydx, int n, double x, double h, double *yout, double *yerr, double *work); 12 | 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /cuda/README: -------------------------------------------------------------------------------- 1 | This code is for using XPP and CUDA for GPU speedup. 2 | There is also code to compare with straight up C and without any code 3 | ml_noc.ode is a straght-up ODE file 4 | mlcpu.ode calls righthand sides written in C 5 | mlgpu.ode calls the RHS vis GPU (precision can be chosen by the user) 6 | mlgpueul.ode calls the GPU several times and then treats the code as a discrete file and basically just loads it into XPP. 7 | 8 | C code 9 | ml.c 10 | GPU codes 11 | 12 | mlgpu.cu single precision 13 | mlgpu2.cu double precision 14 | mlgpueul.cu single precision euler integration specificed number of steps 15 | 16 | 17 | see the instructions in mlgpu.cu for compiling the cuda stuff 18 | see instructions in ml.c for compiling the .c code 19 | 20 | 21 | Basically the steps are to compile the code and then run the XPP file 22 | 23 | Unfortunately, I do not know how to do this on Windows since I have no windows computers with a GPU. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ode/lecar.ode.pars: -------------------------------------------------------------------------------- 1 | File: ode/lecar.ode 2 | 3 | Equations... 4 | dV/dT=(IAPP+GL*(VL-V)+GK*W*(VK-V)-ICA) 5 | dW/dT=(LAMN(V)*(NINF(V)-W)) 6 | 7 | where ... 8 | ICA = GCA*MINF(V)*(V-1) 9 | 10 | User-defined functions: 11 | MINF(V) = .5*(1+TANH((V-V1)/V2)) 12 | NINF(V) = .5*(1+TANH((V-V3)/V4)) 13 | LAMN(V) = PHI*COSH((V-V3)/(2*V4)) 14 | 15 | 16 | Numerical parameters ... 17 | NJMP=1 NMESH=40 METHOD=Runge-Kutta EVEC_ITER=100 18 | BVP_EPS=1e-05,BVP_TOL=1e-05,BVP_MAXIT=20 19 | DT=0.05 T0=0 TRANS=0 TEND=30 BOUND=100 DELAY=0 MaxPts=4000 20 | EVEC_ERR=0.001, NEWT_ERR=0.001 HMIN=1e-12 HMAX=1 TOLER=0.001 21 | POIMAP=0 POIVAR=V POIPLN=0 POISGN=1 22 | 23 | 24 | Delay strings ... 25 | 0.0 26 | 0.0 27 | 28 | 29 | BCs ... 30 | 0=0 31 | 0=0 32 | 33 | 34 | ICs ... 35 | V=1 36 | W=0.006970866560677969 37 | 38 | 39 | Parameters ... 40 | iapp=0.2 phi=0.333 v1=-0.01 v2=0.15 41 | v3=0.1 v4=0.145 gca=1 vk=-0.7 42 | vl=-0.5 gk=2 gl=0.5 om=1 43 | 44 | -------------------------------------------------------------------------------- /ode/osc1.ani: -------------------------------------------------------------------------------- 1 | # animation file osc.ode neural oscillator nullcline demo 2 | dimension -6.25;-1.25;6.25;10.25 3 | TRANSIENT 4 | line xm([-100..100]*.06);Xnull([j]*.06);xm([j+1]*.06);Xnull([j+1]*.06);$RED 5 | line xm([-100..100]*.06);Vnull([j]*.06);xm([j+1]*.06);Vnull([j+1]*.06);$GREEN 6 | fcirc V;X;0.25;$BLUE 7 | grab V;X;0.25 8 | {V=mouse_x;X=mouse_y} 9 | {V=mouse_x;X=mouse_y;runnow=1} 10 | fcirc 5;2*gam;0.1;$RED 11 | grab 5;2*gam;0.1 12 | {gam=0.5*abs(mouse_y)} 13 | {gam=0.5*abs(mouse_y);runnow=1} 14 | fcirc 4*beta;0;0.1;$YELLOW 15 | grab 4*beta;0;0.1 16 | {beta=0.25*abs(mouse_x)} 17 | {beta=0.25*abs(mouse_x);runnow=1} 18 | fcirc -1;Input;0.1;$BLACK 19 | grab -1;Input;0.1 20 | {Input=mouse_y} 21 | {Input=mouse_y;runnow=1} 22 | fcirc 10*sigma;9;0.1;$GREEN 23 | grab 10*sigma;9;0.1 24 | {sigma=0.1*abs(mouse_x)} 25 | {sigma=0.1*abs(mouse_x);runnow=1} 26 | fcirc 10*eps;10;0.1;$PURPLE 27 | grab 10*eps;10;0.1 28 | {eps=0.1*abs(mouse_x)} 29 | {eps=0.1*abs(mouse_x);runnow=1} 30 | end 31 | 32 | 33 | -------------------------------------------------------------------------------- /ode/osc.ani: -------------------------------------------------------------------------------- 1 | # animation file osc.ode neural oscillator nullcline demo 2 | dimension -6.25;-1.25;6.25;10.25 3 | TRANSIENT 4 | line xm([-100..100]*.06);Xnull([j]*.06);xm([j+1]*.06);Xnull([j+1]*.06);$GREEN 5 | line xm([-100..100]*.06);Vnull([j]*.06);xm([j+1]*.06);Vnull([j+1]*.06);$RED 6 | fcirc V;X;0.25;$BLUE 7 | grab V;X;0.4 8 | {V=mouse_x;X=mouse_y} 9 | {V=mouse_x;X=mouse_y;runnow=1} 10 | fcirc 5;2*gam;0.1;$RED 11 | grab 5;2*gam;0.25 12 | {gam=0.5*abs(mouse_y)} 13 | {gam=0.5*abs(mouse_y);runnow=1} 14 | fcirc 4*beta;0;0.1;$YELLOW 15 | grab 4*beta;0;0.25 16 | {beta=0.25*abs(mouse_x)} 17 | {beta=0.25*abs(mouse_x);runnow=1} 18 | fcirc -1;Input;0.1;$BLACK 19 | grab -1;Input;0.25 20 | {Input=mouse_y} 21 | {Input=mouse_y;runnow=1} 22 | fcirc 10*sigma;9;0.1;$GREEN 23 | grab 10*sigma;9;0.25 24 | {sigma=0.1*abs(mouse_x)} 25 | {sigma=0.1*abs(mouse_x);runnow=1} 26 | fcirc 10*eps;10;0.1;$PURPLE 27 | grab 10*eps;10;0.25 28 | {eps=0.1*abs(mouse_x)} 29 | {eps=0.1*abs(mouse_x);runnow=1} 30 | end 31 | 32 | 33 | -------------------------------------------------------------------------------- /changes.txt: -------------------------------------------------------------------------------- 1 | First in auto_nox.c: I defined these: 2 | 3 | char this_auto_file[200]; 4 | char fort3[200]; 5 | char fort7[200]; 6 | char fort8[200]; 7 | char fort9[200]; 8 | char TMPSWAP[200]; 9 | 10 | Then modified several lines within 11 | open_auto(), close_auto(), and appendf() to create and use those file names based at the 12 | user's home directory. 13 | 14 | 15 | Then, open.c Line 63: Modified to 16 | 17 | sprintf(buf,"%s/%s",getenv("HOME"),"tmp.FXXXXXX"); 18 | 19 | 20 | endfile.c Line 45: Made nm buffer bigger to accomodate longer path. 21 | 22 | char nm[200]; 23 | 24 | also in endfile.c Line 65: Modified to 25 | sprintf(nm,"%s/%s",getenv("HOME"),"tmp.FXXXXXX"); 26 | 27 | 28 | Then in run_auto.c: Included the following externs... 29 | 30 | extern char fort3[200]; 31 | extern char fort7[200]; 32 | extern char fort8[200]; 33 | extern char fort9[200]; 34 | 35 | Modified run_aut in run_auto.c lines 83-84, lines 94-95, lines 106-107, and lines 118-119 to 36 | use those file names and the lengths of those strings. 37 | 38 | 39 | -------------------------------------------------------------------------------- /newpars.h: -------------------------------------------------------------------------------- 1 | #ifndef _newpars_h 2 | #define _newpars_h 3 | 4 | 5 | /*#define LPAREN 1 6 | */ 7 | 8 | 9 | #define COMMENT 2 10 | #define SPACE 3 11 | #define EQUAL 4 12 | 13 | #define COMMAND -1 14 | #define FIXED 0 15 | #define FUNCTION 1 16 | #define IC 2 17 | #define MAP 3 18 | #define ODE 4 19 | #define VEQ 5 20 | #define MARKOV_VAR 6 21 | #define AUX_VAR 7 22 | #define TABLE 8 23 | 24 | #define SPEC_FUN 11 25 | 26 | #define PAR_AM 16 27 | #define DAE 12 28 | #define DERIVE_PAR 13 29 | #define SOL_VAR 14 30 | 31 | #define EXPORT 15 32 | 33 | 34 | 35 | #define ONLY 26 36 | 37 | #define GROUP 27 38 | 39 | #define VECTOR 28 40 | 41 | #define NAMLEN 10 42 | #define MAXARG 20 43 | #define MAXEXPLEN 1024 44 | typedef struct var_info { 45 | char lhs[MAXEXPLEN],rhs[MAXEXPLEN],args[MAXARG][NAMLEN+1]; 46 | int type,nargs; 47 | double value; 48 | struct var_info *next,*prev; 49 | } VAR_INFO; 50 | 51 | /*int start_var_info=0; 52 | 53 | VAR_INFO *my_varinfo; 54 | */ 55 | 56 | #endif 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /help/xppphase.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - PHASE SPACE 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    Phase Space

    10 | XPP allows for periodic domains so that you can solve equations on a torus or cylinder.

    You will be prompted to make

      11 |
    • (A)ll variables periodic, 12 |
    • (N)o variables periodic or 13 |
    • (C)hoose the ones you want.
    14 |

    You will be asked for the period which is the same for all periodic variables (if they must be different, rescale them)

    15 | Choose them by name or by clicking the 16 | appropriate names from the list presented to you. An X will 17 | appear next to the selected ones. Clicking toggles the X .

    18 | Type Esc when done or CANCEL or DONE.

    19 | XPP mods your variables by this period and is smart 20 | enough when plotting to not join the two ends. 21 |

    22 | -------------------------------------------------------------------------------- /ode/junk1.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 5 0 1 0 -1 50 0 -1 0.000 0 0 -1 0 0 5 11 | 0 key.ps 12 | 600 750 975 750 975 2625 600 2625 600 750 13 | 2 5 0 1 0 -1 50 0 -1 0.000 0 0 -1 0 0 5 14 | 0 junk1.ps 15 | 1575 375 5175 375 5175 5250 1575 5250 1575 375 16 | 2 5 0 1 0 -1 50 0 -1 0.000 0 0 -1 0 0 5 17 | 0 junk1.ps 18 | 6300 450 9900 450 9900 5325 6300 5325 6300 450 19 | 2 5 0 1 0 -1 50 0 -1 0.000 0 0 -1 0 0 5 20 | 0 junk1.ps 21 | 1575 5625 5175 5625 5175 10500 1575 10500 1575 5625 22 | 2 5 0 1 0 -1 50 0 -1 0.000 0 0 -1 0 0 5 23 | 0 junk1.ps 24 | 6300 5700 9900 5700 9900 10575 6300 10575 6300 5700 25 | 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 26 | 1 1 2.00 120.00 240.00 27 | 1350 525 1350 5025 28 | 4 0 0 50 0 16 20 0.0000 4 195 150 675 675 0\001 29 | 4 0 0 50 0 16 20 0.0000 4 195 150 750 2925 1\001 30 | 4 0 0 50 0 16 20 0.0000 4 195 150 1575 375 0\001 31 | 4 0 0 50 0 16 20 0.0000 4 195 450 4725 375 100\001 32 | 4 0 0 50 0 16 20 0.0000 4 210 540 525 3600 time\001 33 | -------------------------------------------------------------------------------- /xAuto.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | int ndim; 3 | int ips; 4 | int irs; 5 | int ilp; 6 | int nicp; 7 | int icp[100]; 8 | int ntst; 9 | int ncol; 10 | int iad; 11 | int isp; 12 | int isw; 13 | int iplt; 14 | int nbc; 15 | int nint; 16 | int nmx; 17 | double rl0; 18 | double rl1; 19 | double a0; 20 | double a1; 21 | int npr; 22 | int mxbf; 23 | int iid; 24 | int itmx; 25 | int itnw; 26 | int nwtn; 27 | int jac; 28 | double epsl; 29 | double epss; 30 | double epsu; 31 | double ds; 32 | double dsmax; 33 | double dsmin; 34 | int iads; 35 | int nthl; 36 | int ithl[100]; 37 | double thl[100]; 38 | int nuzr; 39 | int iuz[20]; 40 | double vuz[20]; 41 | /* these are for the homoclinic stuff */ 42 | int nunstab; 43 | int nstab; 44 | int iequib; /* +1 homoclinic -2 heteroclinic */ 45 | 46 | 47 | 48 | } XAUTO; 49 | 50 | /* for homcont - itwist=0, istart=2, nrev=0,nfixed=0,npsi=0 */ 51 | 52 | 53 | -------------------------------------------------------------------------------- /numerics.h: -------------------------------------------------------------------------------- 1 | #ifndef _numerics_h_ 2 | #define _numerics_h_ 3 | 4 | /* Numerics.h */ 5 | 6 | extern double DELTA_T,TEND,T0,TRANS,NULL_ERR,EVEC_ERR,NEWT_ERR; 7 | extern double BOUND,DELAY,TOLER,HMIN,HMAX; 8 | extern float *fft_data,*hist_data,color_scale,min_scale; 9 | extern double POIPLN; 10 | 11 | extern int NMESH,NJMP,METHOD,color_flag,NC_ITER; 12 | extern int EVEC_ITER,FOREVER; 13 | 14 | extern int POIMAP,POIVAR,POISGN,SOS; 15 | 16 | extern int HIST,HVAR,hist_ind; 17 | 18 | extern int XSHFT,YSHFT,ZSHFT; 19 | 20 | void chk_volterra(void); 21 | void check_pos(int *j); 22 | void quick_num(int com); 23 | void get_num_par(int ch); 24 | void chk_delay(void); 25 | void set_delay(void); 26 | void ruelle(void); 27 | void init_numerics(void); 28 | void meth_dialog(void); 29 | void get_pmap_pars_com(int l); 30 | void get_method(void); 31 | void set_col_par_com(int i); 32 | void do_meth(void); 33 | void set_total(double total); 34 | void user_set_color_par(int flag,char *via,double lo,double hi); 35 | void compute_one_period(double period,double *x, char *name); 36 | #endif 37 | -------------------------------------------------------------------------------- /ode/bob.dat: -------------------------------------------------------------------------------- 1 | -1 0.0467455 2 | -0.92 0.0419853 3 | -0.84 0.0374911 4 | -0.76 0.033112 5 | -0.68 0.028888 6 | -0.6 0.0244612 7 | -0.52 0.0198096 8 | -0.44 0.0155437 9 | -0.36 0.0111785 10 | -0.28 0.00757112 11 | -0.2 0.00355293 12 | -0.12 0.000230589 13 | -0.04 -0.0027393 14 | 0.04 -0.00544546 15 | 0.12 -0.00724861 16 | 0.2 -0.00845096 17 | 0.28 -0.00845999 18 | 0.36 -0.00700997 19 | 0.44 -0.0050451 20 | 0.52 -0.00189911 21 | 0.6 0.00321535 22 | 0.68 0.00844845 23 | 0.76 0.0125233 24 | 0.84 0.0180973 25 | 0.92 0.023509 26 | 1 0.0260726 27 | 1.08 0.0289393 28 | 1.16 0.0292362 29 | 1.24 0.0296995 30 | 1.32 0.0289911 31 | 1.4 0.0286482 32 | 1.48 0.0272486 33 | 1.56 0.0259637 34 | 1.64 0.0238276 35 | 1.72 0.0220981 36 | 1.8 0.0202137 37 | 1.88 0.0183302 38 | 1.96 0.0153807 39 | 2.04 0.0136794 40 | 2.12 0.0117689 41 | 2.2 0.00930673 42 | 2.28 0.00737711 43 | 2.36 0.00452907 44 | 2.44 0.00175211 45 | 2.52 -5.52542e-05 46 | 2.6 -0.00233627 47 | 2.68 -0.00515201 48 | 2.76 -0.00757447 49 | 2.84 -0.0109763 50 | 2.92 -0.012717 51 | 3 -0.0162331 52 | -------------------------------------------------------------------------------- /ode/coaster2D.ode: -------------------------------------------------------------------------------- 1 | 2 | #Hey, define your roller coaster track here! 3 | #Use parametric equations in M. 4 | xM(M) = sin(M) 5 | zM(M) = cos(M) 6 | 7 | #Now calculate and put the derivatives of your 8 | #parametric equations here: 9 | xMdM(M) = cos(M) 10 | zMdM(M) = -sin(M) 11 | 12 | 13 | param drag=1.2 14 | param mass=1 15 | param g=8.3 16 | 17 | init M=0,X=0,Z=1 18 | init L=0,Lalt=0.01 19 | 20 | #Shouldn't need to modify too much below... 21 | 22 | normM(M) = sqrt(xMdM(M)^2 + zMdM(M)^2) 23 | mdt(M) = Lalt/normM(M) 24 | 25 | dX/dt=xMdM(M)*mdt(M) 26 | dZ/dt=zMdM(M)*mdt(M) 27 | dM/dt=mdt(M) 28 | dL/dt=Lalt 29 | #Thanks to Newton! 30 | dLalt/dt=(1/mass)*((-g*zMdM(M)/normM(M)) - drag*Lalt) 31 | 32 | set Sun {g=274.13} 33 | set Mercury {g=3.59} 34 | set Venus {g=8.87} 35 | set Earth {g=9.81} 36 | set Moon {g=1.62} 37 | set Mars {g=3.77} 38 | set Jupiter {g=25.95} 39 | set Saturn {g=11.08} 40 | set Uranus {g=10.67} 41 | set Neptune {g=14.07} 42 | set Pluto {g=0.42} 43 | 44 | @ XP=X,YP=Z,XLO=-1,XHI=1,YLO=-1,YHI=1 45 | @ bounds=100000 46 | done 47 | -------------------------------------------------------------------------------- /ode/duck.ode: -------------------------------------------------------------------------------- 1 | # duck.ode 2 | # the infamous drinking duck 3 | # modeled as a pendulum with some extra forces 4 | # M is the total mass of the two parts of the duck 5 | # m1 is the lower mass and M-m1 the upper 6 | # mmin is the mass of the two parts when empty 7 | # thus, M-2*mmin is the mass of the fluid 8 | # we will call mu the mass of th is fluid in the lower vessel 9 | # without loss of generality we assume this is 1 so M=1+2*mmin 10 | mudot=-eps*abs(xdot)*min(beta*mu,1) 11 | m1=mmin+mu 12 | m2=mmin+mutot -mu 13 | mu'=mudot 14 | x'=xdot 15 | xdot'=(-f*xdot-(m1*l1-m2*l2)*sin(x)+k/(1-cos(x-xlo))-mudot*(l1^2-l2^2))/(m1*l1^2+m2*l2^2) 16 | par l1=2.6,l2=2.5,mmin=2,f=.5,k=.002,xlo=-.2,eps=.015,xdip=1.6,mutot=.4 17 | par beta=50 18 | global 1 x-xdip {xdot=0;mu=mutot} 19 | init mu=.25,x=1.5 20 | # some animation constants 21 | x1=.5+.8*(l1/(l1+l2))*sin(x) 22 | y1=.5-.8*(l1/(l1+l2))*cos(x) 23 | x2=.5-.8*(l2/(l1+l2))*sin(x) 24 | y2=.5+.8*(l2/(l1+l2))*cos(x) 25 | xb=x2-.15*cos(x) 26 | yb=y2-.15*sin(x) 27 | th(x,y)=min(atan2(.5-x,y-.5),xdip) 28 | @ meth=qualrk,dt=1,total=1000 29 | done 30 | 31 | 32 | -------------------------------------------------------------------------------- /autevd.h: -------------------------------------------------------------------------------- 1 | #ifndef _autevd_h_ 2 | #define _autevd_h_ 3 | 4 | #include "autlim.h" 5 | #include "auto_f2c.h" 6 | #include "auto_c.h" 7 | /* autevd.c */ 8 | 9 | /* typedef struct {double r,i;} doublecomplex; */ 10 | 11 | typedef struct { 12 | int pt,br; 13 | double evr[NAUTO],evi[NAUTO]; 14 | } EIGVAL; 15 | 16 | 17 | void send_eigen(int ibr, int ntot, int n, doublecomplex *ev); 18 | void send_mult(int ibr, int ntot, int n, doublecomplex *ev); 19 | int get_bif_type(int ibr, int ntot, int lab); 20 | void addbif(iap_type *iap, rap_type *rap, integer ntots, integer ibrs, double *par,integer *icp,int labw, double *a, double *uhigh, double *ulow, double *u0, double *ubar); 21 | double etime_(double *z); 22 | int eigrf_(double *a, int *n, int *m, doublecomplex *ecv, double *work, int *ier); 23 | void init_auto(int ndim, int nicp,int nbc, int ips, int irs, int ilp, int ntst, int isp, int isw, int nmx, int npr, double ds, double dsmin, double dsmax, double rl0, double rl1, double a0, double a1, int ip1, int ip2, int ip3, int ip4, int ip5, int nuzr, double epsl, double epsu, double epss, int ncol); 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /help/xpp3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - 3D PARAMETERS 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    3d params

    Brings up a dialog box allowing you to rotate the axes in three-dimensional plots and make animations. The items are:
      10 |
    • theta, the angle about the z-axis to use this. 11 |
    • phi, the angle about the y-axis 12 |
    • Movie set this to 1 if you want to create a little movie in which the box rotates about one of the two principle axes. 13 |
    • Choose which angle you want to rotate about: theta or phi 14 |
    • Choose the starting angle 15 |
    • Choose the increment 16 |
    • Choose the number of frames 17 |

    If you select Movie then a series of frames will be drawn. You can use the Kinescope command to play these back or save them in an animated gif file.

    18 | -------------------------------------------------------------------------------- /ode/duckx.ode: -------------------------------------------------------------------------------- 1 | # duck.ode 2 | # the infamous drinking duck 3 | # modeled as a pendulum with some extra forces 4 | # M is the total mass of the two parts of the duck 5 | # m1 is the lower mass and M-m1 the upper 6 | # mmin is the mass of the two parts when empty 7 | # thus, M-2*mmin is the mass of the fluid 8 | # we will call mu the mass of th is fluid in the lower vessel 9 | # without loss of generality we assume this is 1 so M=1+2*mmin 10 | mudot=-eps*abs(xdot)*min(beta*mu,1) 11 | m1=mmin+mu 12 | m2=mmin+mutot -mu 13 | mu'=mudot+gamma*cos(x)*(mutot-mu)*mu 14 | x'=xdot 15 | xdot'=(-f*xdot-(m1*l1-m2*l2)*sin(x)+k/(1-cos(x-xlo))-mudot*(l1^2-l2^2))/(m1*l1^2+m2*l2^2) 16 | par l1=2.6,l2=2.5,mmin=2,f=.5,k=.002,xlo=-.2,eps=.015,xdip=1.6,mutot=.4 17 | par beta=50,gamma=0 18 | global 1 x-xdip {xdot=0;mu=mutot} 19 | init mu=.25,x=1.5 20 | # some animation constants 21 | x1=.5+.8*(l1/(l1+l2))*sin(x) 22 | y1=.5-.8*(l1/(l1+l2))*cos(x) 23 | x2=.5-.8*(l2/(l1+l2))*sin(x) 24 | y2=.5+.8*(l2/(l1+l2))*cos(x) 25 | xb=x2-.15*cos(x) 26 | yb=y2-.15*sin(x) 27 | th(x,y)=min(atan2(.5-x,y-.5),xdip) 28 | @ meth=qualrk,dt=1,total=1000 29 | done 30 | 31 | 32 | -------------------------------------------------------------------------------- /ode/koho.ode: -------------------------------------------------------------------------------- 1 | # EXAMPLE 1. 2 | # koho.ode 3 | # implements kohonen algorithm with help from an external function 4 | export {z,ntot} {ihot} 5 | par ntot=100,k=1 6 | z=2*ran(1)-1 7 | h(u)=(.5+.5*cos(2*pi*u*k/ntot))^sig 8 | par sig=20,eps=.1 9 | ihot=0 10 | w[0..99]'=w[j]+eps*(z-w[j])*h(ihot-[j]) 11 | ip'=ihot 12 | aux zz=z 13 | @ meth=discrete,total=2000 14 | done 15 | 16 | 17 | 18 | 1. save the C file as getmax.c 19 | 2. Compile it as below 20 | 3. xpp koho.ode 21 | 4. File Edit Load DLL getmax.so -- function is called fun 22 | 23 | --------------------- cut below line and save as getmax.c --------------- 24 | 25 | /* external function 26 | gcc -shared -o getmax.so -fpic getmax.c 27 | 28 | */ 29 | /* getmax.c 30 | finds the closest in a list */ 31 | #include 32 | fun(double *in,double *out,int nin,int nout,double *var,double *con) 33 | { 34 | double z=in[0]; 35 | int nmax=(int)in[1]; 36 | int i,ihot=0; 37 | double d=1000,dnew; 38 | for(i=1;i<=nmax;i++){ 39 | dnew=fabs(var[i]-z); 40 | if(dnew 7 | 8 | void do_main(int argc, char **argv); 9 | void check_for_quiet(int argc, char **argv); 10 | void do_vis_env(void); 11 | void init_X(void); 12 | void set_big_font(void); 13 | void set_small_font(void); 14 | void xpp_events(XEvent report, int min_wid, int min_hgt); 15 | void do_events(unsigned int min_wid, unsigned int min_hgt); 16 | void bye_bye(void); 17 | void clr_scrn(void); 18 | void redraw_all(void); 19 | void commander(int ch); 20 | Window init_win(unsigned int bw, char *icon_name, char *win_name, int x, int y, unsigned int min_wid, unsigned int min_hgt, int argc, char **argv); 21 | void top_button_draw(Window w); 22 | void top_button_cross(Window w, int b); 23 | void top_button_press(Window w); 24 | void top_button_events(XEvent report); 25 | void make_top_buttons(void); 26 | void getGC(GC *gc); 27 | void load_fonts(void); 28 | void make_pops(void); 29 | void FixWindowSize(Window w, int width, int height, int flag); 30 | int getxcolors(XWindowAttributes *win_info, XColor **colors); 31 | void test_color_info(void); 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /help/xppkine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - KINESCOPE 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    Kinescope

    10 | This allows you to capture the bitmap of the active window and play it back.

    11 |

      12 |
    • (C)apture
      takes a snapshot of the currently active window

      13 |

    • (R)eset
      deletes all the snapshots

      14 |

    • (P)layback
      cycles thru the pictures each time you click the left mouse button and stops if you click the middle or tap Esc . It will beep when done.

      15 |

    • (A)utoplay
      continuously plays back snapshots. You tell it how many cycles and how much time between frames in milliseconds.

      16 |

    • (S)ave
      saves the frames in either ppm or gif format

      17 |

    • (M)ake anigif
      Create an animated gif from the frames. The file is always called anim.gif and can be played with Netscape, Explorer, xanim, etc.

      18 |

    19 |

    20 | 21 | -------------------------------------------------------------------------------- /ode/hhred.ode: -------------------------------------------------------------------------------- 1 | # The reduced Hodgkin Huxley equations showing fixed parameters 2 | # and a bunch of auxiliary columns left for post processing 3 | # 4 | init v=20 n=0 5 | par om=1 6 | par VNA=115 VK=-12 VL=10.5989 GNABAR=120 GKBAR=36 GLBAR=0.3 GL=0.3 7 | par I0=20 IP=0 PON=0 POFF=0 TEMP=6.3 h0=0.8 8 | AM(arg1)=PHI*.1e0*(.25e+02-arg1)/(EXP(.1e0*(.25e02-arg1))-.1e+01) 9 | BM(arg1)=PHI*4.0e0*EXP(-arg1/1.8e01) 10 | AH(arg1)= PHI*.7e-01*EXP(-arg1/2.0e01) 11 | BH(arg1)=PHI*1.0e0/(EXP(.1e0*(.3e02-arg1))+1.0e0) 12 | BN(arg1)=PHI*.125*EXP(-arg1/80.) 13 | AN(arg1)=PHI*.1e-01*(.1e02-arg1)/(EXP(.1e0*(.1e2-arg1))-1.0e0) 14 | IAPP(arg1)=I0+heav(POFF-arg1)*heav(arg1-PON)*ip 15 | minf(arg1)=am(arg1)/(am(arg1)+bm(arg1)) 16 | ninf(arg1)=an(arg1)/(an(arg1)+bn(arg1)) 17 | hinf(arg1)=ah(arg1)/(ah(arg1)+bh(arg1)) 18 | v'=(IAPP(T)-GNABAR*M**3*H*(V-VNA)-GKBAR*N**4*(V-VK)-GL*(V-VL))*om 19 | n'=(AN(V)-(AN(V)+BN(V))*N)*om 20 | # Here are the 3 fixed guys 21 | phi=3^((TEMP-6.3)/10) 22 | m=minf(v) 23 | h=h0-n 24 | # and the auxiliary functions 25 | aux aux1=0 26 | aux aux2=0 27 | aux aux3=0 28 | @ total=40,method=gear,bound=500,dt=.25,dtmin=1e-12,xhi=40,yhi=120,ylo=-10 29 | done 30 | -------------------------------------------------------------------------------- /worker2.c: -------------------------------------------------------------------------------- 1 | #include "auto_f2c.h" 2 | #include "auto_c.h" 3 | #include "auto_types.h" 4 | 5 | #ifdef TIME 6 | #include 7 | #include 8 | #include 9 | static double time_start (void) { 10 | struct rusage time; 11 | double seconds,microseconds; 12 | getrusage(RUSAGE_SELF,&time); 13 | seconds = (double)time.ru_utime.tv_sec; 14 | microseconds = (double)time.ru_utime.tv_usec; 15 | return seconds + microseconds/1e6; 16 | } 17 | static double time_end(double start) { 18 | struct rusage time; 19 | double seconds,microseconds; 20 | getrusage(RUSAGE_SELF,&time); 21 | seconds = (double)time.ru_utime.tv_sec; 22 | microseconds = (double)time.ru_utime.tv_usec; 23 | return (seconds + microseconds/1e6)-start; 24 | } 25 | #endif 26 | 27 | /* The memory for these are taken care of in autobv_, autoae_, and setubv for the 28 | mpi parallel case */ 29 | extern struct { 30 | doublereal *dfu, *dfp, *uu1, *uu2, *ff1, *ff2; 31 | } global_scratch; 32 | 33 | /* The memory for these are taken care of in autobv_ and autoae_ */ 34 | extern struct { 35 | integer irtn; 36 | integer *nrtn; 37 | } global_rotations; 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ode/lamvolt.ode: -------------------------------------------------------------------------------- 1 | # lamvolt.ode 2 | # the four variables: 3 | init u=0 v=0 u1=0 v1=0 4 | par lam=1.5 q=0.8 d=1 u0=1 u10=0.95 5 | # 1/sqrt(pi)= 6 | number spi=0.56419 7 | # the integral equations; since (0,0,0,0) is a rest point, I 8 | # add a small quickly decaying transient 9 | u(t)=u0*exp(-5*t)+spi*(int[.5]{exp(-t)#f}+int[.5]{exp(-t-d/(t+.0001))#f1}) 10 | v(t)=spi*(int[.5]{exp(-t)#g}+int[.5]{exp(-t-d/(t+.0001))#g1}) 11 | u1(t)=u10*exp(-5*t)+spi*(int[.5]{exp(-t)#f1}+int[.5]{exp(-t-d/(t+.0001))#f}) 12 | v1(t)=spi*(int[.5]{exp(-t)#g1}+int[.5]{exp(-t-d/(t+.0001))#g}) 13 | # the four functions f,g,f1,g1 14 | f=lam*u-v-(u*u+v*v)*(u+q*v) 15 | g=lam*v+u-(u*u+v*v)*(v-q*u) 16 | f1=lam*u1-v1-(u1*u1+v1*v1)*(u1+q*v1) 17 | g1=lam*v1+u1-(u1*u1+v1*v1)*(v1-q*u1) 18 | done 19 | 20 | # This is a model for two oscillators embedded in an infinite 21 | # one-dimensional medium a distance d apart. The value lam=sqrt(2) 22 | # is where oscillations of the uncoupled system begin. Four coupled integral 23 | # equations are solved. For d=2, the model is bistable and the in-phase 24 | # and anti-phase solution are stable (q=.8) One should use DELTA_T=.01 25 | # and MaxPoints=1001 to get numerical stability. 26 | # -------------------------------------------------------------------------------- /canonical/10x10.ode: -------------------------------------------------------------------------------- 1 | # setup a table for 10x10 nn coupled oscillators 2 | # with natural boundary conditions 3 | # arrays are only 1-d so 0..9 10-19... are the rows 4 | # t=0..99, get x,y 5 | x(t)=mod(t,10) 6 | y(t)=flr(t/10) 7 | # negative and positive with clamps 8 | n(x)=max(x-1,0) 9 | p(x)=min(x+1,9) 10 | # pull back together 11 | s(x,y)=10*y+x 12 | # here is the interaction function 13 | h(x)=sin(x+phi)-sin(phi) 14 | par phi=0 15 | # set tstart to negative to ignore global, else generate random ICs 16 | par tstart=0 17 | # get the indices for north south east west 18 | table nr % 100 0 99 s(x(t),p(y(t))) 19 | table so % 100 0 99 s(x(t),n(y(t))) 20 | table ea % 100 0 99 s(p(x(t)),y(t)) 21 | table we % 100 0 99 s(n(x(t)),y(t)) 22 | # now just add up the ODEs 23 | x[0..99]'=1+h(shift(x0,nr([j]))-x[j])+h(shift(x0,so([j]))-x[j])+h(shift(x0,we([j]))-x[j])+h(shift(x0,ea([j]))-x[j]) 24 | # make them all periodic 25 | @ fold=x[0..99] 26 | @ xp=x0,yp=x21,xlo=0,xhi=6.3,ylo=0,yhi=6.3 27 | @ total=50,meth=euler 28 | # set periodic colormap 29 | @ colormap=1 30 | # add the relative phase difference 31 | aux y[0..99]=mod(x[j]-x0,2*pi) 32 | # initial conditions 33 | global 0 t-tstart {x[0..99]=ran(1)*2*pi} 34 | done 35 | 36 | -------------------------------------------------------------------------------- /ode/nthet.c: -------------------------------------------------------------------------------- 1 | #include 2 | double BoxMuller; 3 | int BoxMullerFlag; 4 | #define N 500 5 | double c[N],x[N],xp[N],s[N],sp[N]; 6 | double drand48(); 7 | #define Tpi 6.283185307 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | double norm() 16 | { 17 | 18 | double fac,r,v1,v2; 19 | if(BoxMullerFlag==0){ 20 | do { 21 | v1=2.0*drand48()-1.0; 22 | v2=2.0*drand48()-1.0; 23 | r=v1*v1+v2*v2; 24 | } while(r>=1.0); 25 | fac=sqrt(-2.0*log(r)/r); 26 | BoxMuller=v1*fac; 27 | BoxMullerFlag=1; 28 | return(v2*fac); 29 | } 30 | else { 31 | BoxMullerFlag=0; 32 | return(BoxMuller); 33 | } 34 | } 35 | 36 | rhs(double g,double a, double sig, double tau, double dt,double st) 37 | { 38 | int i; 39 | for(i=0;i 5 | 6 | /* markov.c */ 7 | void add_wiener(int index); 8 | void set_wieners(double dt, double *x, double t); 9 | void add_markov(int nstate, char *name); 10 | int build_markov(char **ma, char *name); 11 | int old_build_markov(FILE *fptr, char *name); 12 | void extract_expr(char *source, char *dest, int *i0); 13 | void create_markov(int nstates, double *st, int type, char *name); 14 | void add_markov_entry(int index, int j, int k, char *expr); 15 | void compile_all_markov(void); 16 | int compile_markov(int index, int j, int k); 17 | void update_markov(double *x, double t, double dt); 18 | double new_state(double old, int index, double dt); 19 | void make_gill_nu(double *nu, int n, int m, double *v); 20 | void one_gill_step(int meth, int nrxn, int *rxn, double *v); 21 | void do_stochast_com(int i); 22 | void mean_back(void); 23 | void variance_back(void); 24 | void compute_em(void); 25 | void free_stoch(void); 26 | void init_stoch(int len); 27 | void append_stoch(int first, int length); 28 | void do_stats(int ierr); 29 | double gammln(double xx); 30 | double poidev(double xm); 31 | double ndrand48(void); 32 | void nsrand48(int seed); 33 | double ran1(long *idum); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /del_stab.h: -------------------------------------------------------------------------------- 1 | #ifndef _del_stab_h_ 2 | #define _del_stab_h_ 3 | 4 | typedef struct{ 5 | double r,i; 6 | }COMPLEX; 7 | 8 | /* del_stab.c */ 9 | void do_delay_sing(double *x, double eps, double err, double big, int maxit, int n, int *ierr, float *stabinfo); 10 | COMPLEX csum(COMPLEX z, COMPLEX w); 11 | COMPLEX cdif(COMPLEX z, COMPLEX w); 12 | COMPLEX cmlt(COMPLEX z, COMPLEX w); 13 | COMPLEX cdivv(COMPLEX z, COMPLEX w); 14 | COMPLEX cexp2(COMPLEX z); 15 | void switch_rows(COMPLEX *z, int i1, int i2, int n); 16 | COMPLEX rtoc(double x, double y); 17 | void cprintn(COMPLEX z); 18 | void cprint(COMPLEX z); 19 | void cprintarr(COMPLEX *z, int n, int m); 20 | double c_abs(COMPLEX z); 21 | COMPLEX cdeterm(COMPLEX *z, int n); 22 | COMPLEX cxdeterm(COMPLEX *z, int n); 23 | void make_z(COMPLEX *z, double *delay, int n, int m, double *coef, COMPLEX lambda); 24 | int find_positive_root(double *coef, double *delay, int n, int m, double rad, double err, double eps, double big, int maxit, double *rr); 25 | void process_root(double real, double im); 26 | double get_arg(double *delay, double *coef, int m, int n, COMPLEX lambda); 27 | int test_sign(double old, double new); 28 | int plot_args(double *coef, double *delay, int n, int m, int npts, double almax, double wmax); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /myfonts.h: -------------------------------------------------------------------------------- 1 | #ifndef _myfonts_h_ 2 | #define _myfonts_h_ 3 | 4 | /* 5 | char *timesfonts[]={ 6 | "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", 7 | "-adobe-times-medium-r-normal--12-120-75-75-p-64-iso8859-1", 8 | "-adobe-times-medium-r-normal--14-140-75-75-p-74-iso8859-1", 9 | "-adobe-times-medium-r-normal--18-180-75-75-p-94-iso8859-1", 10 | "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1"}; 11 | 12 | char *symbolfonts[]={ 13 | "-adobe-symbol-medium-r-normal--10-100-75-75-p-61-adobe-fontspecific", 14 | "-adobe-symbol-medium-r-normal--12-120-75-75-p-74-adobe-fontspecific", 15 | "-adobe-symbol-medium-r-normal--14-140-75-75-p-85-adobe-fontspecific", 16 | "-adobe-symbol-medium-r-normal--18-180-75-75-p-107-adobe-fontspecific", 17 | "-adobe-symbol-medium-r-normal--24-240-75-75-p-142-adobe-fontspecific"}; 18 | */ 19 | 20 | char *timesfonts[]={ 21 | "*-times-medium-r-*-10-100-*", 22 | "*-times-medium-r-*-12-120-*", 23 | "*-times-medium-r-*-14-140-*", 24 | "*-times-medium-r-*-18-180-*", 25 | "*-times-medium-r-*-24-240-*"}; 26 | 27 | 28 | char *symbolfonts[]={ 29 | "*-symbol-medium-r-*-10-100-*", 30 | "*-symbol-medium-r-*-12-120-*", 31 | "*-symbol-medium-r-*-14-140-*", 32 | "*-symbol-medium-r-*-18-180-*", 33 | "*-symbol-medium-r-*-24-240-*"}; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /ode/acoaster.ode: -------------------------------------------------------------------------------- 1 | 2 | #Hey, define your roller coaster track here! 3 | #Use parametric equations in M. 4 | xM(M) = sin(alpha*M) 5 | zM(M) = gamma*cos(beta*M+delta) 6 | 7 | #Now calculate and put the derivatives of your 8 | #parametric equations here: 9 | xMdM(M) = alpha*cos(alpha*M) 10 | zMdM(M) = -gamma*beta*sin(beta*M+delta) 11 | 12 | par alpha=3,beta=1,gamma=1,delta=0 13 | param drag=.1 14 | param mass=1 15 | param g=8.3 16 | # scale mouse velocity a little as it is too sensitive 17 | par sv=.25 18 | init M=0,X=0,Z=1 19 | init L=0,Lalt=0.001 20 | 21 | #Shouldn't need to modify too much below... 22 | 23 | normM(M) = sqrt(xMdM(M)^2 + zMdM(M)^2) 24 | mdt(M) = Lalt/normM(M) 25 | 26 | dX/dt=xMdM(M)*mdt(M) 27 | dZ/dt=zMdM(M)*mdt(M) 28 | dM/dt=mdt(M) 29 | dL/dt=Lalt 30 | #Thanks to Newton! 31 | dLalt/dt=(1/mass)*((-g*zMdM(M)/normM(M)) - drag*Lalt) 32 | 33 | set Sun {g=274.13} 34 | set Mercury {g=3.59} 35 | set Venus {g=8.87} 36 | set Earth {g=9.81} 37 | set Moon {g=1.62} 38 | set Mars {g=3.77} 39 | set Jupiter {g=25.95} 40 | set Saturn {g=11.08} 41 | set Uranus {g=10.67} 42 | set Neptune {g=14.07} 43 | set Pluto {g=0.42} 44 | 45 | @ XP=X,YP=Z,XLO=-1,XHI=1,YLO=-1,YHI=1 46 | @ bounds=100000 47 | @ dt=.01,nout=5 48 | @ total=50 49 | done 50 | -------------------------------------------------------------------------------- /ode/fr.ode: -------------------------------------------------------------------------------- 1 | # fabry-perot cavity 2 | init tau=1,x=1.08 3 | # needed to fool XPP into using the Volterra solver 4 | junk=int{0#x} 5 | # ode for the delay 6 | tau'=v/(c+delay(v,tau)) 7 | x0=-xs+a*sin(th)^2/(1-cos(th)^2-2*cos(th)*cos(xs)) 8 | x'=v 9 | v'=-v/q-x-x0+a*(fr*fr+fi*fi)*sin(th)^2 10 | volt fr=1+cos(th)*(cos(delay(x,tau))*delay(fr,tau)-sin(delay(x,tau))*delay(fi,tau)) 11 | volt fi=1+cos(th)*(sin(delay(x,tau))*delay(fr,tau)+cos(delay(x,tau))*delay(fi,tau)) 12 | par q=.11,xs=1.07,a=11.459,th=1,r=1.2221,c=120,eps=.1 13 | @ dt=.025,total=200,trans=50,delay=4,vmaxpts=1 14 | done 15 | 16 | # 17 | Functional-differential equations for a pendular Fabry-Perot cavity: 18 | 19 | x''+x'/Q+x+x0 = A sin^2 th |f|^2, 20 | 21 | f(t) = 1 + cos th exp(i x(t-tau)) f(t-tau), 22 | 23 | tau = (r+(x(t)+x(t-tau)-2 xs)/c). 24 | 25 | f(t) is complex, the parameters are Q, A, th, xs, r, c and we define: 26 | 27 | x0 + xs = A sin^2 th/(1-cos^2 th-2 cos th cos xs). 28 | 29 | Initial conditions: 30 | 31 | x = const. 32 | 33 | We differentiate tau with respect to t to get an ODE for tau 34 | to avoid the ugly implicit definition 35 | 36 | I use a Volterra declaration to trick XPP into treating fr,fi 37 | as integral equations 38 | 39 | 40 | -------------------------------------------------------------------------------- /adj2.h: -------------------------------------------------------------------------------- 1 | #ifndef _adj2_h_ 2 | #define _adj2_h_ 3 | 4 | #include 5 | 6 | void init_trans(void); 7 | void dump_transpose_info(FILE *fp, int f); 8 | int do_transpose(void); 9 | int create_transpose(void); 10 | void alloc_h_stuff(void); 11 | void data_back(void); 12 | void adj_back(void); 13 | void h_back(void); 14 | void make_adj_com(int com); 15 | void adjoint_parameters(void); 16 | void new_h_fun(int silent); 17 | void dump_h_stuff(FILE *fp, int f); 18 | int make_h(float **orb, float **adj, float **h, int nt, double dt, int node,int silent); 19 | void new_adjoint(void); 20 | void test_test(void); 21 | void compute_one_orbit(double *ic, double per); 22 | int adjoint(float **orbit, float **adjnt, int nt, double dt, double eps, double minerr, int maxit, int node); 23 | void eval_rhs(double **jac, int k1, int k2, double t, double *y, double *yp, int node); 24 | int rk_interp(double **jac, int k1, int k2, double *y, double *work, int neq, double del, int nstep); 25 | int step_eul(double **jac, int k, int k2, double *yold, double *work, int node, double dt); 26 | void do_liapunov(void); 27 | void alloc_liap(int n); 28 | void do_this_liaprun(int i, double p); 29 | void norm_vec(double *v, double *mu, int n); 30 | int hrw_liapunov(double *liap, int batch, double eps); 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /ode/atcoaster.ode: -------------------------------------------------------------------------------- 1 | 2 | #Hey, define your roller coaster track here! 3 | #Use parametric equations in M. 4 | xM(t) = (2+cos(3*t))*sin(2*t) 5 | zM(t)= (2+cos(3*t))*cos(2*t) 6 | 7 | #Now calculate and put the derivatives of your 8 | #parametric equations here: 9 | xMdM(t) =(xm(t+.01)-xm(t-.01))/(.02) 10 | zMdM(t) =(zm(t+.01)-zm(t-.01))/(.02) 11 | 12 | par alpha=3,beta=1,gamma=1,delta=0 13 | param drag=.1 14 | param mass=1 15 | param g=1 16 | # scale mouse velocity a little as it is too sensitive 17 | par sv=.25 18 | init M=0,X=0,Z=3 19 | init L=0,Lalt=1 20 | 21 | #Shouldn't need to modify too much below... 22 | 23 | normM(M) = sqrt(xMdM(M)^2 + zMdM(M)^2) 24 | mdt(M) = Lalt/normM(M) 25 | 26 | dX/dt=xMdM(M)*mdt(M) 27 | dZ/dt=zMdM(M)*mdt(M) 28 | dM/dt=mdt(M) 29 | dL/dt=Lalt 30 | #Thanks to Newton! 31 | dLalt/dt=(1/mass)*((-g*zMdM(M)/normM(M)) - drag*Lalt) 32 | 33 | set Sun {g=274.13} 34 | set Mercury {g=3.59} 35 | set Venus {g=8.87} 36 | set Earth {g=9.81} 37 | set Moon {g=1.62} 38 | set Mars {g=3.77} 39 | set Jupiter {g=25.95} 40 | set Saturn {g=11.08} 41 | set Uranus {g=10.67} 42 | set Neptune {g=14.07} 43 | set Pluto {g=0.42} 44 | 45 | @ XP=X,YP=Z,XLO=-3.25,XHI=3.25,YLO=-3.25,YHI=3.25 46 | @ bounds=100000 47 | @ dt=.05,meth=cvode,tol=1e-10,atol=1e-10 48 | @ total=50 49 | done 50 | -------------------------------------------------------------------------------- /phsplan.h: -------------------------------------------------------------------------------- 1 | #ifndef _phsplan_h 2 | #define _phsplan_h 3 | 4 | 5 | /* This include file has all of the global phaseplane 6 | stuff. 7 | This is not where it is defined 8 | 9 | */ 10 | 11 | #include "xpplim.h" 12 | 13 | extern int NEQ,NODE; 14 | 15 | extern int PLOT_3D; 16 | 17 | 18 | 19 | 20 | extern float **storage; 21 | extern int storind,MAXSTOR,INFLAG,MY_STOR,STORFLAG; 22 | 23 | extern int FOREVER; 24 | 25 | extern int ENDSING,PAUSER; 26 | 27 | /* extern GRAPH *MyGraph; */ 28 | 29 | 30 | extern int METHOD,NJMP; 31 | extern double HMIN,HMAX,TOLER,ATOLER,BOUND,DELAY; 32 | extern double NULL_ERR,EVEC_ERR,NEWT_ERR; 33 | extern int EVEC_ITER,NMESH,NC_ITER; 34 | 35 | 36 | 37 | 38 | extern float *fft_data; 39 | extern int FFT; 40 | 41 | 42 | 43 | 44 | extern float *hist_data; 45 | extern int HIST,HVAR,hist_ind; 46 | 47 | 48 | extern double TEND,DELTA_T,T0,TRANS; 49 | 50 | 51 | extern double *WORK; 52 | extern int IWORK[1000]; 53 | 54 | extern int TORUS,itor[MAXODE]; 55 | extern double TOR_PERIOD; 56 | 57 | 58 | extern int POIMAP,POISGN,POIEXT,SOS,POIVAR; 59 | extern double POIPLN; 60 | 61 | extern int NULL_HERE; 62 | extern float *X_n,*Y_n; 63 | 64 | 65 | extern char uvar_names[MAXODE][12]; 66 | 67 | 68 | #endif 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /help/xppwind.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - WINDOW 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    Window

    10 | Allows you to rewindow the current graph. Pressing this presents another menu with the choices:

    11 |

    22 | ( NOTE: On some displays, no rubber boxes are drawn for the zooming operations. If this occurs, run with the -xorflag option on the command line.) 23 |

    24 | 25 | -------------------------------------------------------------------------------- /histogram.h: -------------------------------------------------------------------------------- 1 | #ifndef _histogram_h_ 2 | #define _histogram_h_ 3 | 4 | 5 | /* histogram.c */ 6 | int two_d_hist(int col1, int col2, int ndat, int n1, int n2, double xlo, double xhi, double ylo, double yhi); 7 | void four_back(void); 8 | void hist_back(void); 9 | void new_four(int nmodes, int col); 10 | int new_2d_hist(void); 11 | void new_hist(int nbins, double zlo, double zhi, int col, int col2, char *condition, int which); 12 | void column_mean(void); 13 | int get_col_info(int *col, char *prompt); 14 | void compute_power(void); 15 | int spectrum(float *data, int nr, int win, int w_type, float *pow); 16 | int cross_spectrum(float *data, float *data2, int nr, int win, int w_type, float *pow, int type); 17 | void compute_sd(void); 18 | void compute_fourier(void); 19 | void compute_correl(void); 20 | void compute_stacor(void); 21 | void mycor(float *x, float *y, int n, double zlo, double zhi, int nbins, float *z, int flag); 22 | void mycor2(float *x, float *y, int n, int nbins, float *z, int flag); 23 | void compute_hist(void); 24 | void sft(float *data, float *ct, float *st, int nmodes, int grid); 25 | void fftxcorr(float *data1, float *data2, int length, int nlag, float *cr, int flag); 26 | void fft(float *data, float *ct, float *st, int nmodes, int length); 27 | void post_process_stuff(); 28 | void just_fourier(int flag); 29 | void just_sd(int flag); 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /canonical/fp.ode: -------------------------------------------------------------------------------- 1 | # fp.ode 2 | # fabry-perot cavity 3 | init tau=1,x=1.08 4 | # needed to fool XPP into using the Volterra solver 5 | junk=int{0#x} 6 | # ode for the delay 7 | tau'=v/(c+delay(v,tau)) 8 | x0=-xs+a*sin(th)^2/(1-cos(th)^2-2*cos(th)*cos(xs)) 9 | x'=v 10 | v'=-v/q-x-x0+a*(fr*fr+fi*fi)*sin(th)^2 11 | volt fr=1+cos(th)*(cos(delay(x,tau))*delay(fr,tau)-sin(delay(x,tau))*delay(fi,tau)) 12 | volt fi=1+cos(th)*(sin(delay(x,tau))*delay(fr,tau)+cos(delay(x,tau))*delay(fi,tau)) 13 | par q=.11,xs=1.07,a=11.459,th=1,r=1.2221,c=120,eps=.1 14 | @ xp=fr,yp=fi,xlo=-.5,xhi=2.5,ylo=-.5,yhi=2.5 15 | @ dt=.05,total=200,trans=50,delay=4,vmaxpts=1 16 | done 17 | 18 | # 19 | Functional-differential equations for a pendular Fabry-Perot cavity: 20 | 21 | x''+x'/Q+x+x0 = A sin^2 th |f|^2, 22 | 23 | f(t) = 1 + cos th exp(i x(t-tau)) f(t-tau), 24 | 25 | tau = (r+(x(t)+x(t-tau)-2 xs)/c). 26 | 27 | f(t) is complex, the parameters are Q, A, th, xs, r, c and we define: 28 | 29 | x0 + xs = A sin^2 th/(1-cos^2 th-2 cos th cos xs). 30 | 31 | Initial conditions: 32 | 33 | x = const. 34 | 35 | We differentiate tau with respect to t to get an ODE for tau 36 | to avoid the ugly implicit definition 37 | 38 | I use a Volterra declaration to trick XPP into treating fr,fi 39 | as integral equations 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tutor.h: -------------------------------------------------------------------------------- 1 | #ifndef _tutor_h_ 2 | #define _tutor_h_ 3 | 4 | 5 | /* 6 | When adding items try to keep to the format of using a strong _verb_ to 7 | start the help topic (e.g. "Press" or "Add") and keep it brief. 8 | */ 9 | #define N_TUTORIAL 12 10 | 11 | char* tutorial[N_TUTORIAL]={"use captital letters on buttons as keyboard shortcuts. Press or now!", 12 | "use the key to close any unwanted menus.", 13 | "press the key to match/limit directory listings in the file browser.", 14 | "zoom in/out using single clicks and/or dragging regions.", 15 | "set your preferences in your .xpprc file (shortcut='fx').", 16 | "add buttons for your favorite shortcuts in your .xpprc (e.g. @ BUT=Fit:wf)", 17 | "get continuous updating using the left mouse button on a Par/Var slider.", 18 | "use the mouse, arrows, , etc keys to quickly move around in AUTO.", 19 | "link to the HTML manual by setting the environment variable XPPHELP on your computer.", 20 | "view documentation using your favorite web browser by setting the environment variable XPPBROWSER on your computer.", 21 | "edit files using your favorite text editor by setting the environment variable XPPEDITOR on your computer.", 22 | "have XPP open to a default starting directory by setting the environment variable XPPSTART on your computer."}; 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /help/xppview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - VIEW AXES 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    View axes

    This selects one of 2 different types of graphs: 2D or 3D or brings up a new animation window or a space-time array window

    10 | If you select the 2D curve, a dialog box will appear asking you for
    11 |

    • the variables to place on the axes; 12 |
    • upper and lower limits of the two axes as in the window command; and 13 |
    • the labels for the axes

      14 |

    15 | 16 | If you select 3D, a more complicated dialog box appears asking for: 17 |

    18 |

      19 |
    • the variables to place on the axes; 20 |
    • their max and min values; 21 |
    • 4 more numbers, XLO, etc. XPP first scales the data to fit into a cube with corners (-1,-1,-1) and (1,1,1). Rotation of this cube is performed and then projected into the two-D window. XLO, etc define 22 | the scales of this projection and are thus unrelated to the values of your data. Use the Window|Fit option to have XPP set these for you. 23 |
    • Axes labels 24 |

      25 |

    26 |

    27 | -------------------------------------------------------------------------------- /help/xpphalf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | XPP - MAKE WINDOWS 4 | 5 | 6 | 7 | Back | Next | Contents 8 |


    9 |

    Make window

    10 | The option allows you to create and destroy graphics windows. There are several choices.

    11 |

      12 |
    • (C)reate
      makes a copy of the currently active window and makes itself active. You can change the graphs in this window without affecting the other windows.

      13 |

    • (K)ill all
      Removes all but the main graphics window.

      14 |

    • (D)estroy
      This destroys the currently active window. The main window cannot be destroyed.

      15 |

    • (B)ottom
      puts the active window on the bottom.

      16 |

    • (A)uto
      turns on a flag so that the window will automatically be redrawn when needed.

      17 |

    • (M)anual
      turns off the flag and the user must restore the picture manually.

      18 |

    • (S)imPlot on/off
      lets you plot the solution in all active windows while the simulation is running. This slows you down quite a bit.

      19 |

    20 | After a window is created, you can use the mouse to find the 21 | coordinates by pressing and moving in the window. The coordinates are 22 | given near the top of the window. 23 |

    24 | 25 | 26 | -------------------------------------------------------------------------------- /diagram.h: -------------------------------------------------------------------------------- 1 | #ifndef _diagram_h_ 2 | #define _diagram_h_ 3 | 4 | #include 5 | #include "auto_nox.h" 6 | 7 | void start_diagram(int n); 8 | int find_diagram(int irs, int n, int *index, int *ibr, int *ntot, int *itp, int *nfpar, double *a, double *uhi, double *ulo, double *u0, double *par, double *per, int *icp1, int *icp2, int *icp3, int *icp4); 9 | void edit_start(int ibr, int ntot, int itp, int lab, int nfpar, double a, double *uhi, double *ulo, double *u0, double *ubar, double *par, double per, int n, int icp1, int icp2, int icp3, int icp4,double *evr, double *evi); 10 | void edit_diagram(DIAGRAM *d, int ibr, int ntot, int itp, int lab, int nfpar, double a, double *uhi, double *ulo, double *u0, double *ubar, double *par, double per, int n, int icp1, int icp2, int icp3, int icp4,int flag2, double *evr, double *evi, double tp); 11 | void add_diagram(int ibr, int ntot, int itp, int lab, int nfpar, double a, double *uhi, double *ulo, double *u0, double *ubar, double *par, double per, int n, int icp1, int icp2, int icp3,int icp4,int flag2, double *evr, double *evi); 12 | void kill_diagrams(void); 13 | void redraw_diagram(void); 14 | void write_info_out(void); 15 | void write_init_data_file(void); 16 | void write_pts(void); 17 | void post_auto(void); 18 | void svg_auto(void); 19 | void bound_diagram(double *xlo, double *xhi, double *ylo, double *yhi); 20 | int save_diagram(FILE *fp, int n); 21 | int load_diagram(FILE *fp, int node); 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /scrngif.h: -------------------------------------------------------------------------------- 1 | #ifndef _scrngif_h_ 2 | #define _scrngif_h_ 3 | 4 | #include 5 | #include 6 | 7 | typedef struct GifTree { 8 | char typ; /* terminating, lookup, or search */ 9 | int code; /* the code to be output */ 10 | unsigned char ix; /* the color map index */ 11 | struct GifTree **node, *nxt, *alt; 12 | } GifTree; 13 | 14 | 15 | typedef struct { 16 | unsigned char r,g,b; 17 | } GIFCOL; 18 | 19 | 20 | void set_global_map(int flag); 21 | int ppmtopix(unsigned char r, unsigned char g, unsigned char b, int *n); 22 | void end_ani_gif(FILE *fp); 23 | void add_ani_gif(Window win, FILE *fp, int count); 24 | void screen_to_gif(Window win, FILE *fp); 25 | void get_global_colormap(Window win); 26 | void local_to_global(void); 27 | int use_global_map(unsigned char *pixels, unsigned char *ppm, int h, int w); 28 | int make_local_map(unsigned char *pixels, unsigned char *ppm, int h, int w); 29 | void gif_stuff(Window win, FILE *fp, int task); 30 | void write_global_header(int cols, int rows, FILE *dst); 31 | void GifLoop(FILE *fout, unsigned int repeats); 32 | void write_local_header(int cols, int rows, FILE *fout, int colflag, int delay); 33 | void make_gif(unsigned char *pixels, int cols, int rows, FILE *dst); 34 | int GifEncode(FILE *fout, unsigned char *pixels, int depth, int siz); 35 | void ClearTree(int cc, GifTree *root); 36 | unsigned char *AddCodeToBuffer(int code, short n, unsigned char *buf); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /ode/clustor.ode: -------------------------------------------------------------------------------- 1 | # clustering of weights in 1-d model 2 | # orientation - 6 populations 3 | table je % 11 -5 5 exp(-.4*t^2)/2.80249 4 | table ji % 41 -10 10 exp(-.08*t^2)/6.2664 5 | special ke[0..5]=conv(even,61,5,je,w0_[j]) 6 | special ki[0..5]=conv(even,61,5,ji,w0_[j]) 7 | s[0..60]=(w0_[j]+w1_[j]+w2_[j]+w3_[j]+w4_[j]+w5_[j])/6 8 | f(u)=1/(1+exp(-u)) 9 | w0_[0..60]'=f(re*(a0*w0_[j]+a1*(w1_[j]+w5_[j])+a2*(w2_[j]+w4_[j])-.5))*(1-s[j])\ 10 | -f(ri*(b0*w0_[j]+b1*(w1_[j]+w5_[j])+b2*(w2_[j]+w4_[j])-.5))*w0_[j] 11 | w1_[0..60]'=f(re*(a0*w1_[j]+a1*(w2_[j]+w0_[j])+a2*(w3_[j]+w5_[j])-.5))*(1-s[j])\ 12 | -f(ri*(b0*w1_[j]+b1*(w2_[j]+w0_[j])+b2*(w3_[j]+w5_[j])-.5))*w1_[j 13 | w2_[0..60]'=f(re*(a0*w2_[j]+a1*(w3_[j]+w1_[j])+a2*(w4_[j]+w0_[j])-.5))*(1-s[j])\ 14 | -f(ri*(b0*w2_[j]+b1*(w3_[j]+w1_[j])+b2*(w4_[j]+w0_[j])-.5))*w2_[j] 15 | w3_[0..60]'=f(re*(a0*w3_[j]+a1*(w4_[j]+w2_[j])+a2*(w5_[j]+w1_[j])-.5))*(1-s[j])\ 16 | -f(ri*(b0*w3_[j]+b1*(w4_[j]+w2_[j])+b2*(w5_[j]+w1_[j])-.5))*w3_[j] 17 | w4_[0..60]'=f(re*(a0*w4_[j]+a1*(w5_[j]+w3_[j])+a2*(w0_[j]+w2_[j])-.5))*(1-s[j])\ 18 | -f(ri*(b0*w4_[j]+b1*(w5_[j]+w3_[j])+b2*(w0_[j]+w2_[j])-.5))*w4_[j] 19 | w5_[0..60]'=f(re*(a0*w5_[j]+a1*(w0_[j]+w4_[j])+a2*(w1_[j]+w3_[j])-.5))*(1-s[j])\ 20 | -f(ri*(b0*w5_[j]+b1*(w0_[j]+w4_[j])+b2*(w1_[j]+w3_[j])-.5))*w5_[j] 21 | par a0=.33333,a1=.25,a2=.083333 22 | par b0=.33333,b1=.25,b2=.083333 23 | par re=10,ri=5 24 | @ total=500,dt=1,meth=qualrk 25 | done 26 | 27 | --------------------------------------------------------------------------------