²é¿´: 1466  |  »Ø¸´: 3

Ê·µÏ×Ðand

гæ (³õÈëÎÄ̳)

[ÇóÖú] ÇúÏßÄâºÏ·½·¨ ÒÑÓÐ1È˲ÎÓë

´ó¼ÒºÃ£¬ÎÒ×î½üÔÚ×öÒ»¸ö·ÇÏßÐÔÄâºÏµÄ¿ÎÌ⣬²ÎÊýÖ»ÒªÒ»±ä¶à¾ÍÄâºÏ²»³öÀ´£¬ÎÒÖªµÀÈ·¶¨µÄ¹«Ê½f=x.^2./(a(1)+sqrt(a(1).^2-(a(2)+1)*x.^2))+a(3)*x.^4+a(4)*x.^6+a(5)*x.^8+a(6)*x.^10+a(7)*x.^12+a(8)*x.^14+a(9)*x.^16+a(10)*x.^18+a(11)*x.^20);ÄâºÏ³öa£¬×Ô¼ºÐ´µÄ³ÌÐò

[x,y]=textread('·ÇÇòÃæÊý¾Ý.txt','%f %f');
plot(x,y,'o')
hold on
s = fitoptions('Method','NonlinearLeastSquares','Algorithm', 'levenberg-marquardt','Lower',[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 'Upper',[Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf]);
f = fittype('x.^2./(a(1)+sqrt(a(1).^2-(a(2)+1)*x.^2))+a(3)*x.^4+a(4)*x.^6+a(5)*x.^8+a(6)*x.^10+a(7)*x.^12+a(8)*x.^14+a(9)*x.^16+a(10)*x.^18+a(11)*x.^20','options',s);
[c,gof] = fit(x,y,f,'StartPoint',[4,0,0,0,0,0,0,0,0,0,0]);

ÕæÐÄÏ£ÍûÄܹ»µÃµ½ÄãÃǵİïÖú£¬×Ô¼º±àдµÄLMËã·¨£¬½á¹ûµ÷ÊÔûÎÊÌ⣬һÔËÐоͱÀÀ£ÁË£¬ÏÖÔÚ´øÓÃËû×Ô¼ºµÄº¯Êý£¬ÓÖ×ö²»³öÀ´£¬²»ÖªµÀÕâÑùµÄ·½³ÌÓÃÔõÑùµÄÄâºÏ·½·¨Ð§¹û×îºÃÄØ£¿matlabÀïÃæÓкöàÖÖÄâºÏËã·¨Âð£¬×Ô¼º¿´ÁË¿´»ù±¾¶¼ÊǾֲ¿×îÓŽ⣬ÓÐûÓÐÈ«¾Ö×îÓÅÄØ£¿Ï£ÍûÓо­ÑéµÄÈËÄܸøÒÔÖ¸µ¼¡£1stoptÈç¹ûÄâºÏµÄ»°ÄÜÉú³ÉexeÎļþÂð£¬ÎÒ×îÖÕÏë×ö³ÉÒ»¸öͨÓõijÌÐò£¬¶ø²»ÊÇÖ»ÒªÒ»´Î½á¹û¡£ÏÈлл¸÷λÁË
»Ø¸´´ËÂ¥

» ±¾Ìû¸½¼þ×ÊÔ´Áбí

  • »¶Ó­¼à¶½ºÍ·´À¡£ºÐ¡Ä¾³æ½öÌṩ½»Á÷ƽ̨£¬²»¶Ô¸ÃÄÚÈݸºÔð¡£
    ±¾ÄÚÈÝÓÉÓû§×ÔÖ÷·¢²¼£¬Èç¹ûÆäÄÚÈÝÉæ¼°µ½ÖªÊ¶²úȨÎÊÌ⣬ÆäÔðÈÎÔÚÓÚÓû§±¾ÈË£¬Èç¶Ô°æÈ¨ÓÐÒìÒ飬ÇëÁªÏµÓÊÏ䣺xiaomuchong@tal.com
  • ¸½¼þ 1 : ·ÇÇòÃæÊý¾Ý.txt
  • 2014-12-12 17:29:24, 13.58 K

» ÊÕ¼±¾ÌûµÄÌÔÌûר¼­ÍƼö

¶¯Á¦Ñ§ÄâºÏ

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

feixiaolin

ÈÙÓþ°æÖ÷ (ÎÄ̳¾«Ó¢)

ÓÅÐã°æÖ÷

¿¼ÂÇÕý½»¶àÏîʽ£¬»òÇбÈÑ©·òÄâºÏʲôµÄ£¬ÄãµÄ½×ÊýÌ«¸ßÁË¡£
2Â¥2014-12-12 20:36:34
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

Ê·µÏ×Ðand

гæ (³õÈëÎÄ̳)

ÒýÓûØÌû:
2Â¥: Originally posted by feixiaolin at 2014-12-12 20:36:34
¿¼ÂÇÕý½»¶àÏîʽ£¬»òÇбÈÑ©·òÄâºÏʲôµÄ£¬ÄãµÄ½×ÊýÌ«¸ßÁË¡£

ºÃ£¬ÎÒ¿´¿´£¬matlabÖÐÔõÑùʹÄâºÏµÄ½á¹ûֻȡʵÊý½âÄØ£¬ÎÒÄâºÏ³öÀ´½á¹ûºÃ¶àÐé²½°¡
3Â¥2014-12-12 22:28:23
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

dbb627

ÈÙÓþ°æÖ÷ (ÖøÃûдÊÖ)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
È«¾ÖËã·¨
CODE:
function Insphere_fit
[xdata,ydata]=textread('·ÇÇòÃæÊý¾Ý.txt','%f %f');
plot(xdata,ydata,'o')
hold on
myfun=@(x,xdata)xdata.^2./(x(1)+sqrt(x(1).^2-(x(2)+1)*xdata.^2))+x(3)*xdata.^4+x(4)*xdata.^6+x(5)*xdata.^8+x(6)*xdata.^10+x(7)*xdata.^12+x(8)*xdata.^14+x(9)*xdata.^16+x(10)*xdata.^18+x(11)*xdata.^20;
tic
x0=[4 rand(1,10)];
format shortg
ms=MultiStart;
F =@(x)norm(xdata.^2./(x(1)+sqrt(x(1).^2-(x(2)+1)*xdata.^2))+x(3)*xdata.^4+x(4)*xdata.^6+x(5)*xdata.^8+...
    x(6)*xdata.^10+x(7)*xdata.^12+x(8)*xdata.^14+x(9)*xdata.^16+x(10)*xdata.^18+x(11)*xdata.^20-ydata);
opts=optimset('Algorithm', 'interior-point');
problem=createOptimProblem('fmincon','x0',x0,...
    'objective',F,'lb',[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],...
    'ub',[Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf],'options',opts);
[xminm,fminm,flagm,outptm,manyminsm]=run(ms,problem,20)
t2=toc
figure;plot(xdata,ydata,'r-*',xdata,myfun(xminm,xdata),'bo-')
legend('real','model')
Text2=['ÀûÓÃÈ«¾ÖËã·¨ multistartºÍfmincon¹À¼ÆµÃµ½µÄ²ÎÊý,ºÄʱ',num2str(t2),'s'];
title(Text2)

MultiStart completed the runs from all start points.

All 20 local solver runs converged with a positive local solver exit flag.

xminm =

  Columns 1 through 5

       132.11       1497.3       12.388     -0.99669     -0.98238

  Columns 6 through 10

     -0.99812      0.68971     -0.16267     0.017723  -0.00074323

  Column 11

-4.2727e-006


fminm =

       788.62


flagm =

     1


outptm =

                funcCount: 15871
         localSolverTotal: 20
       localSolverSuccess: 20
    localSolverIncomplete: 0
    localSolverNoSolution: 0
                  message: [1x128 char]


manyminsm =

  1x20 GlobalOptimSolution

  Properties:
    X
    Fval
    Exitflag
    Output
    X0




t2 =

       59.298
ÇúÏßÄâºÏ·½·¨
untitled.jpg

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
4Â¥2014-12-14 23:52:47
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ Ê·µÏ×Ðand µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ²ÄÁÏר˶306Ó¢Ò»Êý¶þ +9 z1z2z3879 2026-03-16 11/550 2026-03-18 08:36 by zhukairuo
[¿¼ÑÐ] 334Çóµ÷¼Á +3 Ö¾´æ¸ßÔ¶ÒâÔÚ»úÐ 2026-03-16 3/150 2026-03-18 08:34 by lm4875102
[¿¼ÑÐ] ²ÄÁÏ£¬·ÄÖ¯£¬ÉúÎ0856¡¢0710£©£¬»¯Ñ§ÕÐÉúÀ² +3 Eember. 2026-03-17 7/350 2026-03-17 20:20 by »¨125533
[˶²©¼ÒÔ°] ºþ±±¹¤Òµ´óѧ ÉúÃü¿ÆÑ§Ó뽡¿µÑ§Ôº-¿ÎÌâ×éÕÐÊÕ2026¼¶Ê³Æ·/ÉúÎï·½Ïò˶ʿ +3 1ϲ´º8 2026-03-17 5/250 2026-03-17 17:18 by ber´¨cool×Ó
[¿¼ÑÐ] 302Çóµ÷¼Á +9 ¸ºÐÄÕßµ±Öï 2026-03-11 9/450 2026-03-17 17:13 by ruiyingmiao
[¿¼ÑÐ] 308Çóµ÷¼Á +4 ÊÇLupa°¡ 2026-03-16 4/200 2026-03-17 17:12 by ruiyingmiao
[¿¼ÑÐ] Áº³ÉΰÀÏʦ¿ÎÌâ×é»¶Ó­ÄãµÄ¼ÓÈë +8 һѼѼӴ 2026-03-14 10/500 2026-03-17 15:07 by һѼѼӴ
[¿¼ÑÐ] ¹¤¿Æ²ÄÁÏ085601 279Çóµ÷¼Á +3 À§ÓÚÐdz¿ 2026-03-17 3/150 2026-03-17 14:08 by ms629
[¿¼ÑÐ] »¯Ñ§µ÷¼Á0703 +8 °¡ÎÒÎÒµÄ 2026-03-11 8/400 2026-03-16 17:23 by ÎҵĴ¬Îҵĺ£
[¿¼ÑÐ] »·¾³¹¤³Ìµ÷¼Á +6 ´ó¿Édigkids 2026-03-16 6/300 2026-03-16 17:16 by barlinike
[¿¼ÑÐ] Ò»Ö¾Ô¸211 0703·½Ïò310·ÖÇóµ÷¼Á +3 ŬÁ¦·Ü¶·112 2026-03-15 3/150 2026-03-16 16:44 by houyaoxu
[¿¼ÑÐ] 285Çóµ÷¼Á +6 ytter 2026-03-12 6/300 2026-03-16 15:05 by njzyff
[¿¼ÑÐ] 294Çóµ÷¼Á +3 Zys010410@ 2026-03-13 4/200 2026-03-15 10:59 by zhq0425
[¿¼ÑÐ] Öпƴó²ÄÁÏר˶319Çóµ÷¼Á +3 ÃÏöβÄÁÏ 2026-03-13 3/150 2026-03-14 18:10 by houyaoxu
[¿¼ÑÐ] ²ÄÁÏ080500µ÷¼ÁÇóÊÕÁô +3 Ò»¿Åmeteor 2026-03-13 3/150 2026-03-14 10:54 by peike
[¿¼ÑÐ] 331Çóµ÷¼Á£¨0703Óлú»¯Ñ§ +5 ZY-05 2026-03-13 6/300 2026-03-14 10:51 by Jy?
[¿¼ÑÐ] Çó²ÄÁϵ÷¼Á 085600Ó¢Ò»Êý¶þ×Ü·Ö302 ǰÈý¿Æ235 ¾«Í¨»úÆ÷ѧϰ Ò»Ö¾Ô¸¹þ¹¤´ó +4 ÁÖyaxin 2026-03-12 4/200 2026-03-13 22:04 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 310Çóµ÷¼Á +3 ¡¾ÉÏÉÏÇ©¡¿ 2026-03-11 3/150 2026-03-13 16:16 by JourneyLucky
[¿¼ÑÐ] ²ÄÁÏר˶350 Çóµ÷¼Á +4 Íõ½ð¿Æ 2026-03-12 4/200 2026-03-13 16:02 by ruiyingmiao
[¿¼ÑÐ] 0817»¯Ñ§¹¤³ÌÓë¼¼Êõ¿¼ÑÐ312·Öµ÷¼Á +3 T123 tt 2026-03-12 3/150 2026-03-13 10:49 by houyaoxu
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û