Solving symbolic equation using solve
이전 댓글 표시
Hi,
I am trying to minimize the value of phi here. I want the values of E for which phi becomes zero but the code is not providing any solution, also there is some problem in the execution of solve function.
Can someone please help with the proper function to be used here for minimization.
b = [(5/60) (10/60) ];
syms E xfun Ifun phi phidiff
xfun = sym(zeros(10,2));
Ifun = sym(zeros(10,2));
phi = sym(zeros(10,2));
phidiff = sym(zeros(10,1));
E_Vyas = zeros(10,1);
for prog = 1:1:2
for conv = 1:1:10
xfun(conv,prog) = -(E)./(8.314.*T(conv,prog)); %here T is temperature file(10 by 2 matrix)
Ifun(conv,prog) = (T(conv,prog).*exp(xfun(conv,prog)))-(Eiget(-xfun(conv,prog))./8.314);
end
end
for conv = 1:1:10
phi(conv) = (Ifun(conv,1).*b(2))./(Ifun(conv,2).*b(1)) + (Ifun(conv,2).*b(1))./(Ifun(conv,1).*b(2));
phidiff = diff(phi,E);
E_Vyas(conv) = (real(solve(phidiff,E)))/1000;
conv;
show = E_Vyas(conv);
end
E_Vyas = smooth(E_Vyas,0.1,'loess');
function [Eix] = Eiget(xfun) %function for approximation for I(E,T)
A = log((0.56146./xfun)+0.65).*(1+xfun);
B = (xfun.^4).*(exp(7.7*xfun)).*((2+xfun).^3.7);
Eix= (((A.^-7.7)+B).^-0.13)-((exp(-xfun))./xfun);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!