laokang56970 发表于 2008-7-30 16:06

[求助]求助!matlab求解复杂非线性方程组,急急急!!!在线等

<div style="FONT-SIZE: 14px"><span style="LINE-HEIGHT: 180%">各位大侠,我的课题现在遇到了大麻烦。课题中的一组三个方程组成的非线性方程组,没办法解出来,请求大家帮忙,我是新手,matlab不熟,这么复杂的方程组,我不知道如何下手啊。问题如下:<br/>t(1:n)=;<br/>n=22;<br/>未知量:α、β、q!</span></div>
<div>&nbsp;</div>
<div><span class="bold"><font size="3">大家帮忙看看,我的程序哪里出错了</font></span><br/><br/>
<script language="JavaScript">
    var OsObject = "";
   if(navigator.userAgent.indexOf("MSIE")>0) {
        document.write("");
   }
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
        document.write("<br/><br/><br/><br/>");
   }
   if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
        //return "Safari";
   }  
   if(isCamino=navigator.userAgent.indexOf("Camino")>0){
        //return "Camino";
   }
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
        //return "Gecko";
   }

</script>

<div style="FONT-SIZE: 14px"><span style="LINE-HEIGHT: 180%">我自己编了个程序,不知道哪里出错了,一直是busy,不出结果,大家帮忙看看。拜托<br/>方程见上:<br/>程序如下:<br/>function F = equation08729(x,y,z)&nbsp;&nbsp;%x代表α;y代表β;z代表q<br/>syms x y z<br/>n=23;f1=0;f2=0;g2=0;h1=0;h2=0;h3=0;<br/><br/>t=;<br/>for i=2:n<br/>&nbsp; &nbsp; for j=1:i-1<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;f1=f1+t(j);<br/>&nbsp; &nbsp; end<br/>&nbsp; &nbsp; f2=f2+(t(i)+z*f1)^y-(z*f1)^y;<br/>&nbsp; &nbsp; g2=g2+log(t(i)+z*f1)-((t(i)+z*f1)/x)^y*log((t(i)+z*f1)/x)+(z*f1/x)^y*log(z*f1/x);<br/>&nbsp; &nbsp; h1=h1+f1/(t(i)+z*f1);<br/>&nbsp; &nbsp; h2=h2+f1^y;<br/>&nbsp; &nbsp; h3=h3+(t(i)+z*f1)^(y-1)*f1;<br/>end<br/>f3=y/x^(y+1)*f2+(y*(t(1)/x)^y-n-y+1)/x;<br/>g3=n/y+log(t(1)/x)-(t(1)/x)^y*log(t(1)/x)+g2;<br/>h4=(y-1)*h1+y*z^(y-1)/x^y*h2-y/x^y*h3;<br/><br/>F=;<br/>%%% = ;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% Make a starting guess at the solution<br/>%%%x0=80;y0=1;z0=0.5;<br/>options=optimset('Display','iter');&nbsp; &nbsp;% Option to display output<br/>set(0,'RecursionLimit',10000);<br/> = fsolve(@equation08729,,options);&nbsp;&nbsp;% Call optimizer</span></div></div><br/><br/>

laokang56970 发表于 2008-7-30 16:07

<br/>

liwenhui 发表于 2008-7-30 22:35

<p>我在程序里没找到错误,也不存在死循环,你的方程复杂,可能<font face="Verdana">需要一点时间才能算出来。我也经常碰到方程复杂的情况,常常是算上半小时也出不了结果,程序编制好了,到最后往往是拼计算机的配置高低。试试别的方法,数值方法逼近试试。</font></p>

laokang56970 发表于 2008-7-31 09:08

一定是程序有问题,我运行半天都没有反应,有时候程序还会自动退出,版主帮忙仔细看看

liwenhui 发表于 2008-7-31 18:02

<p>没有死循环呀!</p>
页: [1]
查看完整版本: [求助]求助!matlab求解复杂非线性方程组,急急急!!!在线等