Re: [問題] fsolve解非線性方程式

看板MATLAB作者 (外派越南工作者)時間10年前 (2013/11/04 21:27), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《liuzijan (未來加油)》之銘言: : 我的function m file: : function F=nonlinear(I) : I0=exp(-25); : b=12; : Rs=5000; : V=3; : F=I-I0.*exp(b.*(V-I.*Rs)); : end : 所以我在指令視窗下輸入 fsolve(@nonlinear, 1) 即可求解 : 但是假如我是想要改變參數 V=1:0.5:5 : 不管在 m file 或者指令視窗內輸入都會出現錯誤,應該要如何做呢? : 另外,假如我要聯立解多個非線性方程式,且方程式數目可能會超過100條, : 是否還是能使用fsolve指令來求解? 還是有更好的方法可以進行運算? : 請高手指點迷津 Thanks! 解出來不見得是非常MATCH 但看結果好像V數值影響結果不大 ------------------------------------------ function pttex134 global V clc V = 1:.5:5; a = length(V); for n = 1:a F(n) = fsolve(@nonlinear,10); end F function F=nonlinear(I) global V I0=exp(-25); b=12; Rs=5000; % V=3; F=I-I0.*exp(b.*(V-I.*Rs)); -------------------------------------------- -- 1.MATLAB programming 2.ASPEN process simulation package 3.FORTRN programming 4.Advance Engineering Mathematics 5.Process Control Theory 6.Chemical Engineering Basic Theory(Kinetic.thermodynamics.transport) 7.Numerical Method and Analysis 8.MATLAB Toolbox.Simulink system basic design -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 113.186.203.69
文章代碼(AID): #1ITw2_Se (MATLAB)
文章代碼(AID): #1ITw2_Se (MATLAB)