欢迎来到天天文库
浏览记录
ID:38580385
大小:47.50 KB
页数:5页
时间:2019-06-15
《Boltzmann 函数曲线拟合的 Lisp 程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Boltzmann函数曲线拟合的Lisp程序 1原程序在计算机中,将以下原代码写入记事本中并保存文件名为“bzlm.lsp”(setqsmx(lambda(/kwia1a2b1b2c1c2sx)(setqwi(mapcar'(lambda(x/)(expt2.718282(/(-xm3)m4)))xi)k0a1(apply'+(mapcar'(lambda(y/w)(setqw(nthkwi)k(1+k))(/y(+1w)))yi))k0a2(apply'+(mapcar'(lambda(y/w)(setqw(nthkwi)k(1+k))(/(*yw)(+1w)))yi))b1(
2、apply'+(mapcar'(lambda(w/)(/1(expt(+1w)2)))wi))b2(apply'+(mapcar'(lambda(w/)(/w(expt(+1w)2)))wi))c1b2c2(apply'+(mapcar'(lambda(w/)(expt(/w(+1w))2))wi))m1(/(-(*a1c2)(*a2c1))(-(*b1c2)(*b2c1)))m2(/(-(*b1a2)(*b2a1))(-(*b1c2)(*b2c1)))k0sx(apply'+(mapcar'(lambda(x/yw)(setqw(nthkwi)y(nthkyi)k(1+k))(e
3、xpt(-y(+(/(-m1m2)(+1w))m2))2))xi)))(if(cars_min)(if(4、(while(<=m3rm3)(while(<=m4rm4)(if(>=m41)(smx))(setqm4(+m4q4)))(setqm3(+m3q3)m4tm4))(setqm3(nth3s_min)m4(lasts_min)))s_min))(setqcy(lambda(/m1m2m3m4)(ifsc(progn(setqm1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc)yc(+(/(-m1m2)(+1(expt2.718282(/(-xcm3)m4))))m2))(set_tile"cy"(vl-princ-to-stringyc))))))(s5、etqcx(lambda(/m1m2m3m4tm)(ifsc(progn(setqm1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc))(if(and((setqtm(-(/(-m1m2)(-ycm2))1))0))(progn(setqxc(+m3(*m4(logtm))))(set_tile"cx"(vl-princ-to-stringxc)))(alert"超出取值范围!"))))))(setqdraw(lambda(/lxlyx1x2temm1m2m3m4i)(setqlx(max(abs(setqx2(apply'maxxi)))6、(abs(setqx1(apply'minxi))))ly(max(abs(apply'maxyi))(abs(apply'minyi)))m1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc))(entmake(list'(0."LINE")'(100."AcDbEntity")(cons10'(0-10))(cons11(list0ly))'(62.4)))(entmake(list'(0."LINE")'(100."AcDbEntity")(cons10(list(*-1lx)0))(cons11(listlx0))'(62.4)))(setqtem7、'((0."SPLINE")(100."AcDbEntity")(100."AcDbSpline")(70.8)(71.3)(72.13)(73.9)(74.7)(62.1))i0lxnil)(while(<=x1x2)(setqly(+(/(-m1m2)(+1(expt2.718282(/(-x1m3)m4))))m2))(if(=(remi2)0)(setqlx(cons(list11x1ly)lx))(setqlx(cons(list10x1ly)lx)))(s
4、(while(<=m3rm3)(while(<=m4rm4)(if(>=m41)(smx))(setqm4(+m4q4)))(setqm3(+m3q3)m4tm4))(setqm3(nth3s_min)m4(lasts_min)))s_min))(setqcy(lambda(/m1m2m3m4)(ifsc(progn(setqm1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc)yc(+(/(-m1m2)(+1(expt2.718282(/(-xcm3)m4))))m2))(set_tile"cy"(vl-princ-to-stringyc))))))(s
5、etqcx(lambda(/m1m2m3m4tm)(ifsc(progn(setqm1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc))(if(and((setqtm(-(/(-m1m2)(-ycm2))1))0))(progn(setqxc(+m3(*m4(logtm))))(set_tile"cx"(vl-princ-to-stringxc)))(alert"超出取值范围!"))))))(setqdraw(lambda(/lxlyx1x2temm1m2m3m4i)(setqlx(max(abs(setqx2(apply'maxxi)))
6、(abs(setqx1(apply'minxi))))ly(max(abs(apply'maxyi))(abs(apply'minyi)))m1(nth1sc)m2(nth2sc)m3(nth3sc)m4(nth4sc))(entmake(list'(0."LINE")'(100."AcDbEntity")(cons10'(0-10))(cons11(list0ly))'(62.4)))(entmake(list'(0."LINE")'(100."AcDbEntity")(cons10(list(*-1lx)0))(cons11(listlx0))'(62.4)))(setqtem
7、'((0."SPLINE")(100."AcDbEntity")(100."AcDbSpline")(70.8)(71.3)(72.13)(73.9)(74.7)(62.1))i0lxnil)(while(<=x1x2)(setqly(+(/(-m1m2)(+1(expt2.718282(/(-x1m3)m4))))m2))(if(=(remi2)0)(setqlx(cons(list11x1ly)lx))(setqlx(cons(list10x1ly)lx)))(s
此文档下载收益归作者所有