关于一个超定方程求解
方程如图function q=myfun(k)
uf=0.33;
db=0.0149;
m=1; % you can change m here m=1 2 3
beta=1;
beta1=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta^2)+1);
beta2=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta^2)-1);
beta3=sqrt(1+2/((1-uf)*db*m^2*beta^2));
q=[beta1*beta3*(1+db*m^2^beta^2*(beta2^2+1))*tanh(m*pi*beta*beta1/2)+...
beta2*beta3*(1-db*m^2^beta^2*(beta1^2-1))*tan(m*pi*beta*beta2/2)-...
db*m^2*beta^2*(beta1^2+beta2^2)*tanh(m*pi*beta*beta3/2);
beta1*beta3*(1+db*m^2^beta^2*(beta2^2+1))*cosh(m*pi*beta*beta1/2)-...
beta2*beta3*(1-db*m^2^beta^2*(beta1^2-1))/tan(m*pi*beta*beta2/2)-...
db*m^2*beta^2*(beta1^2+beta2^2)*cosh(m*pi*beta*beta3/2)];
end
用matlab写了个m函数,本想用fsolve发现不行
所以求助于1stopt
我写的1stopt代码老说字符串不对
回复 楼主 的帖子
另外 问下1stopt有没有续行,类似于...[ 本帖最后由 sigma665 于 2008-5-31 12:17 编辑 ]
超定方程求解
用MAPLE 的fsolve可求出m=1时k=0.2994356158,不知是否符合你的要求回复 3楼 的帖子
可否共享下你的maple程序 原帖由 sigma665 于 2008-5-31 09:59 发表 http://www.chinavib.com/forum/images/common/back.gif另外 问下1stopt有没有续行,类似于...
1stOpt不用换行号,不加“;",则自动视为一行。如
Function y=a+b+c+d+e+f;
等同与:
Function y=a+b+c+
d+e+f;
能否把你写的1stOpt代码贴出来,也好发现错在哪。 Title "Type your title here";
Parameters k;
//Variable ;
Constant uf=0.33,
db=0.0149,
m=4,
beta0=1;
beta3=sqrt(1+2/((1-uf)*db*m^2*beta0^2));
ConstStr beta1=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)+1);
beta2=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)-1);
Function
beta1*beta3*(1+db*m^2^beta0^2*(beta2^2+1))*tanh(m*pi*beta0*beta1/2)+
beta2*beta3*(1-db*m^2^beta0^2*(beta1^2-1))*tan(m*pi*beta0*beta2/2)-
db*m^2*beta0^2*(beta1^2+beta2^2)*tanh(m*pi*beta0*beta3/2)=0;
beta1*beta3*(1+db*m^2^beta0^2*(beta2^2+1))*cosh(m*pi*beta0*beta1/2)-
beta2*beta3*(1-db*m^2^beta0^2*(beta1^2-1))/tan(m*pi*beta0*beta2/2)-
db*m^2*beta0^2*(beta1^2+beta2^2)*cosh(m*pi*beta0*beta3/2)=0
代码现在没问题了
每次算的都不一样,能否一下就给出全部解 几点错误:
1:beta0=1;
beta3=sqrt(1+2/((1-uf)*db*m^2*beta0^2));
应该为:
beta0=1,
beta3=sqrt(1+2/((1-uf)*db*m^2*beta0^2));
2:ConstStr beta1=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)+1);
beta2=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)-1);
应该为:
ConstStr beta1=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)+1),
beta2=sqrt((sqrt(k^2*db^2+4*k)-k*db)/(2*m^2*beta0^2)-1);
3:另外,第二个式子是否正确?
maple程序
> restart;> uf := .33; `δb` := 0.149e-1; m := 1; beta := 1;
> beta1 := ((sqrt(ka^2*`δb`^2+4*ka)-ka*`δb`)/(2*m^2*beta^2)+1)^(1/2); beta2 := ((sqrt(ka^2*`δb`^2+4*ka)-ka*`δb`)/(2*m^2*beta^2)-1)^(1/2); beta3 := (1+2/((1-uf)*`δb`*m^2*beta^2))^(1/2);
> eq1 := beta1*beta3(1+`δb`*m^2*beta^2*(1+beta2^2))*tanh((1/2)*m*Pi*beta*beta1)+beta2*beta3*(1-`δb`*m^2*beta^2*(beta1^2-1))*tanh((1/2)*m*Pi*beta*beta2)-`δb`*m^2*beta^2*(beta1^2+beta2^2)*tanh((1/2)*m*Pi*beta*beta3);
> fsolve(eq1, ka);
0.2994356158
页:
[1]