matlab中用for+fzero求带2个变参数的方程解 ,为什么总显示变参未为定义.请赐教,多谢了。
我functionf=dbcalculate(db,z,jg,jf,a)%db为要求的未知值,z为变参jg为变参,jf已知参数,a为已知参数f=-(db)./(1.65....
我
function f=dbcalculate(db,z,jg,jf,a) % db为要求的未知值,z为变参jg为变参,jf已知参数,a为已知参数
f=-(db)./(1.65.*10.^(-4))+1.48.*10.^(-2).*(z./(1.65.*10.^(-4))).^1.09.*0.004352.^(-1.388).*(1.65.*10.^(-4).*9.81./jg.^2).^(-0.759).*(1.65.*10.^(-4).*jf.*10.^6).^0.449.*(1.65.*10.^(-4).*a.*10.^9).^(-0.303)
具体的程序如下
jg=[0.9759 0.9188 0.8688 0.8251 0.7869 0.7551 0.726 0.7008 0.6792 0.6608 0.6453 0.6325 0.6223 0.6145 0.6091 0.6058 0.6047 0.6058 0.6091 0.6146 0.6224 0.6326 0.6453 0.6608 0.6792 0.7008 0.7259 0.7549 0.7883 0.8265 0.8703 0.9204 0.9775 1.0429 1.1177 1.2033 1.3011 1.413 1.5409 1.6866 1.852 2.0386 2.2466 2.4748 2.7189 2.9712 3.2194 3.4458 3.6298 3.7506 3.7927 3.7505 3.6298 3.4458 3.2195 2.9714 2.719 2.4748 2.2467 2.0388 1.8523 1.6868 1.541 1.4131 1.3012 1.2034 1.1179 1.0412]jf=14.4*10^(-7)
a=67.26*10^(-3)
z=0.01:0.01:0.68
for i=1:1:68
fzero(@(db,z,jg,jf,a) dbcalculate(db,z,jg,jf,a),10^(-3))
end 展开
function f=dbcalculate(db,z,jg,jf,a) % db为要求的未知值,z为变参jg为变参,jf已知参数,a为已知参数
f=-(db)./(1.65.*10.^(-4))+1.48.*10.^(-2).*(z./(1.65.*10.^(-4))).^1.09.*0.004352.^(-1.388).*(1.65.*10.^(-4).*9.81./jg.^2).^(-0.759).*(1.65.*10.^(-4).*jf.*10.^6).^0.449.*(1.65.*10.^(-4).*a.*10.^9).^(-0.303)
具体的程序如下
jg=[0.9759 0.9188 0.8688 0.8251 0.7869 0.7551 0.726 0.7008 0.6792 0.6608 0.6453 0.6325 0.6223 0.6145 0.6091 0.6058 0.6047 0.6058 0.6091 0.6146 0.6224 0.6326 0.6453 0.6608 0.6792 0.7008 0.7259 0.7549 0.7883 0.8265 0.8703 0.9204 0.9775 1.0429 1.1177 1.2033 1.3011 1.413 1.5409 1.6866 1.852 2.0386 2.2466 2.4748 2.7189 2.9712 3.2194 3.4458 3.6298 3.7506 3.7927 3.7505 3.6298 3.4458 3.2195 2.9714 2.719 2.4748 2.2467 2.0388 1.8523 1.6868 1.541 1.4131 1.3012 1.2034 1.1179 1.0412]jf=14.4*10^(-7)
a=67.26*10^(-3)
z=0.01:0.01:0.68
for i=1:1:68
fzero(@(db,z,jg,jf,a) dbcalculate(db,z,jg,jf,a),10^(-3))
end 展开
展开全部
不用这么复杂,这样就可以了
syms db
jg=[0.9759 0.9188 0.8688 0.8251 0.7869 0.7551 0.726 0.7008 0.6792 0.6608 0.6453 0.6325 0.6223 0.6145 0.6091 0.6058 0.6047 0.6058 0.6091 0.6146 0.6224 0.6326 0.6453 0.6608 0.6792 0.7008 0.7259 0.7549 0.7883 0.8265 0.8703 0.9204 0.9775 1.0429 1.1177 1.2033 1.3011 1.413 1.5409 1.6866 1.852 2.0386 2.2466 2.4748 2.7189 2.9712 3.2194 3.4458 3.6298 3.7506 3.7927 3.7505 3.6298 3.4458 3.2195 2.9714 2.719 2.4748 2.2467 2.0388 1.8523 1.6868 1.541 1.4131 1.3012 1.2034 1.1179 1.0412];
jf=14.4*10^(-7);
a=67.26*10^(-3);
z=0.01:0.01:0.68;
for ii=1:68
DBr(ii)=solve(-(db)/(1.65*10^(-4))+1.48*10^(-2)*(z(ii)/(1.65*10^(-4)))^1.09*0.004352^(-1.388)*(1.65*10^(-4)*9.81/jg(ii)^2)^(-0.759)*(1.65*10^(-4)*jf*10^6)^0.449*(1.65*10^(-4)*a*10^9)^(-0.303));
end
DB=double(DBr')
syms db
jg=[0.9759 0.9188 0.8688 0.8251 0.7869 0.7551 0.726 0.7008 0.6792 0.6608 0.6453 0.6325 0.6223 0.6145 0.6091 0.6058 0.6047 0.6058 0.6091 0.6146 0.6224 0.6326 0.6453 0.6608 0.6792 0.7008 0.7259 0.7549 0.7883 0.8265 0.8703 0.9204 0.9775 1.0429 1.1177 1.2033 1.3011 1.413 1.5409 1.6866 1.852 2.0386 2.2466 2.4748 2.7189 2.9712 3.2194 3.4458 3.6298 3.7506 3.7927 3.7505 3.6298 3.4458 3.2195 2.9714 2.719 2.4748 2.2467 2.0388 1.8523 1.6868 1.541 1.4131 1.3012 1.2034 1.1179 1.0412];
jf=14.4*10^(-7);
a=67.26*10^(-3);
z=0.01:0.01:0.68;
for ii=1:68
DBr(ii)=solve(-(db)/(1.65*10^(-4))+1.48*10^(-2)*(z(ii)/(1.65*10^(-4)))^1.09*0.004352^(-1.388)*(1.65*10^(-4)*9.81/jg(ii)^2)^(-0.759)*(1.65*10^(-4)*jf*10^6)^0.449*(1.65*10^(-4)*a*10^9)^(-0.303));
end
DB=double(DBr')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询