| 查看: 381 | 回复: 2 | ||
[求助]
Matlab 解方程问题求教!!!
|
|
代码1,求解sym类型参数方程中未知数。 以下是MATLAB程序代码,我运行之后提示“FZERO cannot continue because user supplied function_handle ==> @(x)(sum((y'./beta')./(1/alpha_t*ones(size(gamma))-1./gamma))-K) failed with the error below.”,作为新手有点看不懂,不会改了,求大神帮忙,先谢谢了。 需要输入的内容如下: the number of the variables:8 K:12.2 y:[0.04 0.44 6.16 24.98 37.23 25.43 5.69 0.05] alpha_t:0.527 d:[60.7 28.3 13.2 6.1 2.9 1.3 0.6 0.3] 程序代码 clc;clear;close all n=input('the number of the variables:'); K=input('K:'); y=input('y:'); alpha_t=input('alpha_t:'); d=input('d:'); if (length(y)~=n||length(d)~=n) disp('please input the same number as n'); break; end syms beta; gamma=sym(zeros(n,1)); for i=1:n sum1=0; sum2=0; if i==1 for j=i+1:n aij=sqrt(1-(1-d(j)/d(i))^1.02); sum2=sum2+aij/beta*y(j); end gamma(1)=1/(y(1)/beta+sum2+sum1); end if i==n for j=1:i-1 bij=1-(1-d(i)/d(j))^1.5; sum1=sum1+(1-bij*(1-1/beta))*y(j); gamma(i)=1/(y(i)/beta+sum1+sum2); end end if i<n&&1<i for j=1:i-1 bij=1-(1-d(i)/d(j))^1.5; sum1=sum1+(1-bij*(1-1/beta))*y(j); end for j=i+1:n aij=sqrt(1-(1-d(j)/d(i))^1.02); sum2=sum2+aij/beta*y(j); end gamma(i)=1/(y(i)/beta+sum1+sum2); end end fun=@(x)(sum((y'./beta')./(1/alpha_t*ones(size(gamma))-1./gamma))-K); x1=0; x2=1; x=fzero(fun,0.6) abs(fun(x)) beta1=x; disp(['beta:']) beta1; |
» 猜你喜欢
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
新西兰Robinson研究所招收全奖PhD
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有95人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复
笼目材料中量子自旋液体基态的证据
已经有0人回复
数学教学论硕士可以读数学物理博士吗?
已经有0人回复
德国亥姆霍兹Hereon中心汉堡分部招镁合金腐蚀裂变SCC课题方向2026公派博士生
已经有4人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有11人回复
求助NH4V4O10晶体的CIF文件
已经有0人回复
英国全奖博士招聘-深度学习与量子物理
已经有0人回复
间接带隙半导体有效质量求助
已经有0人回复

2楼2016-03-22 21:13:59
3楼2016-03-22 23:38:30











回复此楼