|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
本帖最后由 subwaylo 于 2015-11-17 13:56 编辑
- function F = myfun1(x,a)
- mu=x(1);
- delte=x(2);
- alpha=a;
- i1z =- 2*ellipticE((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2))*((alpha - mu)^2/delte^2 + 1)^(1/4) - (2*ellipticK((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2)))/(((2*(alpha - mu))/delte - 2*((alpha - mu)^2/delte^2 + 1)^(1/2))*((alpha - mu)^2/delte^2 + 1)^(1/4)) - (ellipticK((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2))*(alpha - mu))/(delte*((alpha - mu)^2/delte^2 + 1)^(1/4));
- i1z1 =(2*ellipticK((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2)))/(((alpha + mu)^2/delte^2 + 1)^(1/4)*((2*(alpha + mu))/delte + 2*((alpha + mu)^2/delte^2 + 1)^(1/2))) - 2*ellipticE((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2))*((alpha + mu)^2/delte^2 + 1)^(1/4) + (ellipticK((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2))*(alpha + mu))/(delte*((alpha + mu)^2/delte^2 + 1)^(1/4));
- i2z =ellipticK((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2))/(3*((alpha - mu)^2/delte^2 + 1)^(1/4)) - (2*ellipticE((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2))*((alpha - mu)^2/delte^2 + 1)^(1/4)*(alpha - mu))/(3*delte) - (2*ellipticK((-((alpha - mu)/(2*delte) - ((alpha - mu)^2/delte^2 + 1)^(1/2)/2)/((alpha - mu)^2/delte^2 + 1)^(1/2))^(1/2))*(alpha - mu))/(3*delte*((2*(alpha - mu))/delte - 2*((alpha - mu)^2/delte^2 + 1)^(1/2))*((alpha - mu)^2/delte^2 + 1)^(1/4));
- i2z1 =ellipticK((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2))/(3*((alpha + mu)^2/delte^2 + 1)^(1/4)) + (2*ellipticE((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2))*((alpha + mu)^2/delte^2 + 1)^(1/4)*(alpha + mu))/(3*delte) - (2*ellipticK((((alpha + mu)/(2*delte) + ((alpha + mu)^2/delte^2 + 1)^(1/2)/2)/((alpha + mu)^2/delte^2 + 1)^(1/2))^(1/2))*(alpha + mu))/(3*delte*((alpha + mu)^2/delte^2 + 1)^(1/4)*((2*(alpha + mu))/delte + 2*((alpha + mu)^2/delte^2 + 1)^(1/2)));
-
- F=[i1z+i1z1; i2z+i2z1-(4/3)*(delte)^(-3/2)];
- x0 = [0.01; 0.01]; % 取初值
- options = optimset('Display','off');
- a=0:0.01:5; % 变量取值范围[0 5]
- for i=1:1:length(a)
- kk=a(i);
- x = fsolve(@myfun1, x0, options,kk);%求解非线性方程组
- x1(i)=x(1); x2(i)=x(2);
- end
- plot(a,x1,'-b',a,x2,'-r'); xlabel('k'); legend('x1','x2')
复制代码
matlab新手,只是照着论坛上的程序模仿的,运行后直接卡死,是不是计算量太大,有没有好的解决办法,谢谢大家啦 |
|