您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 数据通信与网络 > matlab在数学领域的应用报告
11中的三个根。,在求8][0,041.76938.7911.1-)(23xxxxffunctiony=mj()forx0=0:0.01:8x1=x0^3-11.1*x0^2+38.79*x0-41.769;if(abs(x1)1.0e-8)x0endend2.血液中某药物浓度随时间的变化值:t(h)0.250.51.01.52.03.04.06.08.010.0C(mg/L)19.3018.1515.3614.1012.899.327.555.243.862.88求t=0.45,1.75,5.0,6.0时的浓度C.分别用n=4,5,9的拉格朗日插值计算;并用样条函数插值计算,并比较结果。拉格朗日插值:functions=lagr(n)x=[0.250.51.01.52.03.04.06.08.010.0];y=[19.3018.1515.3614.1012.899.327.555.243.862.88];x0=[0.451.755.06.0];m=length(x0);fori=1:mD=abs(x-x0(i));I=1;whileI=n+1fora=1:length(x)ifD(a)==min(D)c(I)=a;D(a)=max(D)+1;break2endendI=I+1;endb=sort(c);z=x0(i);t=0.0;fork=1:length(b)u=1.0;forj=1:length(b)ifj~=ku=u*(z-x(b(j)))/(x(b(k))-x(b(j)));endendt=t+u*y(b(k));ends(i)=t;end样条函数差值:Interp1(x,y,x0,’spline’)Spline(x,y,x0)3.给定某药物浓度随时间的变化值,1)分别采用样条函数和三点公式(设h=0.1)求结点处的导数值,并比较结果。2)求该时间段的平均浓度(定步长S法)样条函数:x=[0.250.51.01.52.03.04.06.08.010.0];y=[19.3018.1515.3614.1012.899.327.555.243.862.88];pp=csape(x,y,'not-a-knot');df=fnder(pp);df1=ppval(df,x)三点公式:functiondf=sandian()t=[0.250.51.01.52.03.04.06.08.010.0];c=[19.3018.1515.3614.1012.899.327.555.243.862.88];h=0.1;n=length(t);fori=1:nx0=t(i);y0=c(i);y1=spline(t,c,x0+h);y2=spline(t,c,x0+2*h);3y3=spline(t,c,x0-h);y4=spline(t,c,x0-2*h);switchicase1df(i)=(-3*y0+4*y1-y2)/(2*h);casendf(i)=(y4-4*y3+3*y0)/(2*h);otherwisedf(i)=(y1-y3)/(2*h);endendend平均浓度:functionaveragec=simpson()t=[0.250.51.01.52.03.04.06.08.010.0];c=[19.3018.1515.3614.1012.899.327.555.243.862.88];m=(t(1)+t(10))/2;y=spline(t,c,m);averagec=(c(1)+4*y+c(10))/6;end4.计算:x=0:8;y=1./(sqrt(2.*pi)).*exp(-(x-4).^2./2);z=trapz(x,y)functiony=jifen(x)y=1./(sqrt(2.*pi)).*exp(-(x-4).^2./2);q1=quad('jifen',0,8,1.0e-8)q2=quadl('jifen',0,8,1.0e-8)5.大肠杆菌比生长速率测定。在一定培养条件下,培养大肠杆菌,实验数据如下表。求:该条件下,大肠杆菌的最大比生长速率μm,半饱和常数Ks,并作模型检验。S(mg/L)μ(h-1)S(mg/L)μ(h-1)82)4(10;80,21)(2xexfx460.061220.60130.121530.66330.241700.69400.312210.70640.432100.731020.53s=[613334064102122153170221210];mu=[0.060.120.240.310.430.530.600.660.690.700.73];spmu=s./mu;n=length(s);a=polyfit(s,spmu,1);mum=1/a(1)ks=a(2)/a(1)lxx=sum(s.^2)-1/n*(sum(s))^2;lyy=sum(spmu.^2)-1/n*(sum(spmu))^2;lxy=sum(s.*spmu)-1/n*sum(s)*sum(spmu);r=lxy/(sqrt(lxx*lyy))R=corrcoef(s,spmu)Qr=lxy^2/lxx;Q=(lxx*lyy-lxy^2)/lxx;F=Qr/(Q/(n-2))6.多元线性回归Pa=[9.08.68.47.57.06.86.56.0]';Pb=[8.37.06.24.23.93.52.62.2]';Pc=[2.74.45.48.39.19.710.911.8]';r=[1.971.050.730.250.180.130.070.04]';k0=ones(8,1);alpha=0.05;r0=log(r);Pa0=log(Pa);Pb0=log(Pb);5Pc0=log(Pc);p=[k0Pa0Pb0Pc0];[b,bint,r,rint,stats]=regress(r0,p,alpha)k=exp(b(1))m=r'*rp1=[Pa0Pb0Pc0];stepwise(p1,r0)7.作二次正交回归。x1=[1111-1-1-1-1-1.681.680000000000]';x2=[11-1-111-1-100-1.681.6800000000]';x3=[1-11-11-11-10000-1.681.68000000]';y=[730.2780.5266.7224.5783.1837.5622.6538.3536.2221.2214.2926.2702.4680.1868.5788.3856.5853.4772.6848.4]';x=[x1x2x3];alpha=0.05;rstool(x,y,'linear',alpha)
本文标题:matlab在数学领域的应用报告
链接地址:https://www.777doc.com/doc-2887287 .html