MATLAB: Solve a system of equations.

solve system of coupled equations

Could any one please help me write the code to solve this system of equations?
Fcl=1/(1+0.155*Iclo*h);
hr=4*5.67*0.00000001*0.72*facl*((0.5*(Tcl+To)+273)^3);
To=(hr*Tr+hc*Ta)/h;
Tcl=To+Fcl(Tsk(i)-To);
h=hc+hr;
Unknown: Fcl hr To Tcl h.
Others are known.
I'm a beginner, I follow the format but error always shoot out. Want quick respond thank you.

Best Answer

Is Fcl a function or a value? If it is a value then you need explicit multiplication with respect to (Tsk(i)-To)
Note that by default "i" refers to sqrt(-1) so your Tsk(i) may be trying to index Tsk(sqrt(-1)) unless you have assigned something else to i
The statements you show by themselves are not enough: you need to define numeric values for the other variables or you need to declare them as syms . If you take the syms route then I recommend changing Tsk(i) to just plain Tsk since the indexing does not matter to the solution of the equations.
The solution involves the roots of a polynomial of degree 7 whose leading term is equivalent to
158193*Iclo*facl*(31*Iclo*Ta*hc-31*Iclo*Tr*hc-200*Tr+200*Tsk(i))^3 * x^7
Because it is a 7 degree polynomial, the answer you get is going to be in terms of RootOf() and there is unlikely to be a closed form solution in the standard operations. You are going to need to solve for numeric roots by using vpasolve() or using double()
Related Question