24小时热门版块排行榜    

查看: 2632  |  回复: 0

colored

铜虫 (初入文坛)

[求助] 关于 fsolve 函数的使用

楼主现在正在做一个仿真,遇到一些困难,请各位路过的高手帮帮忙!
问题如下:主函数产生六个参数lamdad, miud, etad,lamdae,miue,etae,function 需要这六个参数中的一些,请问要怎么读取这些值,而且在主函数中还要用fsolve函数来求解一个三元的非线性方程组(方程组为F)。
------------------------------------------------------------------------------------------------------
主函数:
for ii = 1 : cd +dd
       [lamdad, miud, etad] = fun_myunified(ii, ad, bd, cd, dd);
            for jj = 1 : ce + de
                  [lamdae,miue,etae] = fun_myunified(jj, ae, be, ce, de);
------------------------------------------------------------------------------------------------------
function output = fun(*,*,*)
F = [x(1)*gamma(x(2)+1/x(3))/(x(2)^(1/x(3))*gamma(x(2)))  - 2* miue.*miud .* (betae./etad).^((miud-miue)./2) .* average_gg((miud+miue)/2 , miud-miue, xi);
     x(1)^2*gamma(x(2)+2/x(3))/(x(2)^(2/x(3))*gamma(x(2))) - 2* miue.*miud .* (betae./etad).^((miud-miue)./2) .* average_gg((miud+miue)/2+1 , miud-miue, xi);
     x(1)^3*gamma(x(2)+3/x(3))/(x(2)^(3/x(3))*gamma(x(2))) - 2* miue.*miud .* (betae./etad).^((miud-miue)./2) .* average_gg((miud+miue)/2+2 , miud-miue, xi)];
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
在主函数中又需要用fsolve解出来的三个参数。
-------------------------------------------------------------------------------------------------------
主函数:
for ii = 1 : cd +dd
       [lamdad, miud, etad] = fun_myunified(ii, ad, bd, cd, dd);
            for jj = 1 : ce + de
                  [lamdae,miue,etae] = fun_myunified(jj, ae, be, ce, de);
                   x0 = [1; 1; 1];  % Make a starting guess at the solution
                  options = optimoptions('fsolve','Display','iter'); % Option to display output
                  [x1,fval1] = fsolve(@fun,x0,options); % Call solver
---------------------------------------------------------------------------------------------------------
谢谢!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 colored 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +10 医学老男孩 2026-08-13 28/1400 2026-08-13 22:44 by 医学老男孩
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +3 启萌科技 2026-08-12 10/500 2026-08-13 20:42 by hmhminy
[基金申请] 静等基金结果 +8 gjjjzhong 2026-08-10 21/1050 2026-08-13 17:56 by 且听虎啸
[基金申请] FileCode能看出啥? +10 要乐观耀哥 2026-08-10 28/1400 2026-08-13 17:51 by 医学老男孩
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 不应该看fileCode +7 且听虎啸 2026-08-12 9/450 2026-08-13 14:27 by flydreamws
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 分享一下我之前已中青C的计划书的filecode +4 布布和一二 2026-08-11 5/250 2026-08-13 12:56 by cratir
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[论文投稿] 职称评审,求友友推荐见刊最快的期刊 +4 工厂打螺丝 2026-08-08 4/200 2026-08-12 09:18 by hansi2025
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 10/500 2026-08-12 09:12 by 布布和一二
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[硕博家园] 读博的好处 +3 lnee 2026-08-11 3/150 2026-08-11 18:10 by 希望我好好的
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
信息提示
请填处理意见