Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
성호 조
성호 조 on 28 Mar 2022
Closed: Dyuman Joshi on 3 Oct 2023
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
비선형 연립방정식을 풀고 싶은데 실행하면 입력 인수가 부족하다고 나오네요 ㅠ
어떻게 해결해야 풀릴까요?

Answers (1)

Raj
Raj on 3 Oct 2023
안녕 성호 조
나는이 질문에 영어로 대답 것이다
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.

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!