vpa command for solving a root(), after solve() command

조회 수: 18 (최근 30일)
Toon Mertens
Toon Mertens 2016년 12월 31일
답변: Star Strider 2016년 12월 31일
Hi,
I'm trying to find the optimum T in the following equation:
n_ov = ((alf_eff * (2 * pi * sigG^2 * C_max * K * (1 - exp( (-r^2) / (2 * sigG^2) ))) - eps_eff * r^2 * sigB * T^4 - (B*(T-T_l)) / P_in) * (1 - T_l / T))
First I derive T;
dT = diff(n_ov, T)
To find the optimum T, I search T where dT = 0.
T_opt = solve(dT == 0, T)
I got the following results:
root(4*P_in*r^2*sigB*z^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z^4*exp(r^2/(2*sigG^2)) + B*z^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z, 1)
root(4*P_in*r^2*sigB*z^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z^4*exp(r^2/(2*sigG^2)) + B*z^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z, 2)
root(4*P_in*r^2*sigB*z^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z^4*exp(r^2/(2*sigG^2)) + B*z^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z, 3)
root(4*P_in*r^2*sigB*z^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z^4*exp(r^2/(2*sigG^2)) + B*z^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z, 4)
root(4*P_in*r^2*sigB*z^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z^4*exp(r^2/(2*sigG^2)) + B*z^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z, 5)
For this I now I can use the vpa command. I did the same as explained in the matlab documentation vpa() .
So I just try to solve T_opt with the vpa command
T_opt_vpa = vpa(T_opt)
This returns me exactly the same as I just tried with the solve() command, the only difference is that z now z1 is.
root(4*P_in*r^2*sigB*z1^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z1^4*exp(r^2/(2*sigG^2)) + B*z1^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z1, 1)
root(4*P_in*r^2*sigB*z1^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z1^4*exp(r^2/(2*sigG^2)) + B*z1^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z1, 2)
root(4*P_in*r^2*sigB*z1^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z1^4*exp(r^2/(2*sigG^2)) + B*z1^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z1, 3)
root(4*P_in*r^2*sigB*z1^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z1^4*exp(r^2/(2*sigG^2)) + B*z1^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z1, 4)
root(4*P_in*r^2*sigB*z1^5*exp(r^2/(2*sigG^2)) - 3*P_in*T_l*r^2*sigB*z1^4*exp(r^2/(2*sigG^2)) + B*z1^2*exp(r^2/(2*sigG^2)) - 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi*exp(r^2/(2*sigG^2)) + 2*C_max*K*P_in*T_l*alf_eff*sigG^2*pi - B*T_l^2*exp(r^2/(2*sigG^2)), z1, 5)
Anybody an idea what I'm doing wrong? Thanks in advance

채택된 답변

Star Strider
Star Strider 2016년 12월 31일
You have a fifth-degree polynomial in ‘z’: z^5 in all 5 terms. Analytic representations do not exist for polynomials larger than fourth-degree. You will have to substitute numeric values for your variables and solve it numerically.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by