フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

입력인수가 부족하다는 오류가 발생합니다.

1 回表示 (過去 30 日間)
성호 조
성호 조 2022 年 3 月 28 日
閉鎖済み: Dyuman Joshi 2023 年 10 月 3 日
function F = comp(x)
F(1) = (((x(1)+x(2)-x(6))*(2*x(1)+x(2)+x(3)+x(4))^2))/((100-x(1)-x(3)+x(5)-x(6))*((1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^4)) - 2.937*10^5;
F(2) = ((x(1)+x(2)-x(6))*(2*x(1)+x(2)+x(3)+x(4)))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^3) - 1.046*10^7;
F(3) = ((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(2*x(1)+x(2)+x(3)+x(4)))/((100-x(1)-x(3)+x(5)-x(6))*(1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))) - 0.02808;
F(4) = (2*x(1)+x(2)+x(3)+x(4))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))) - 5.555*10^5;
F(5) = (100-x(1)-x(3)+x(5)-x(6))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))^2) - 1.978*10^6;
F(6) = (((1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^2)*(100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))^2)/((x(1)+x(2)-x(6))*(100-x(1)-x(3)+x(5)-x(6))) - 1.166*10^(-9);
end
function chem
fun = @comp;
x0 = [0,0,0,0,0,0];
x= fsolve(fun,x0)
CO = 100-x(2)+x(3)-x(4)-2*x(5)+2*x(6)
CO2 = 100-x(1)-x(3)+x(5)-x(6)
H2 = 1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6)
CH4 = x(1)+x(2)-x(6)
H2O = 2*x(1)+x(2)+x(3)+x(4)
C = x(4)+x(5)
end
비선형 연립방정식을 풀고 싶은데 실행하면 입력 인수가 부족하다고 나오네요 ㅠ
어떻게 해결해야 풀릴까요?

回答 (1 件)

Raj
Raj 2023 年 10 月 3 日
안녕 성호 조
나는이 질문에 영어로 대답 것이다
I understand that you are getting “input arguments are insufficient” error while running your script.
This is due to the function ‘comp’ in your file. This error throws up when the compiler tries to run the function ‘comp’.
Try following the workaround I gave in a similar question of yours to solve the issue:
I hope this helps.

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!