how do I find the minimum of an implicit equation with symbolic variable
1 次查看(过去 30 天)
显示 更早的评论
Hi i was wondering how you would solve an implicit equation to determine the value of the symbolic variable when the equation is set to zero. My code is outlined:
%
function reboiler_temp=bubble_point(x,A,B,C,P,bubble_components);
% calculate the temperature for the individual components
syms T % Here i don't know T but i want to solve for it later when the function = 0
temp=0;
%bubble_temp=zeros(bubble_components); % there are two values for each function input, i need to find the sum then equate it to 0
for i=1:bubble_components
bubble_temp(i)=10^(A(i)-B(i)/(T+C(i)))*x(i);
temp=temp+bubble_temp(i);
end
reboiler_temp=abs(P-temp);
reboiler_temp=solve(reboiler_temp==0,T)
return;
end
I seem to be getting the wrong solution for this coding, does anyone know if this is a correct approach to deal with symbolic terms
0 个评论
回答(1 个)
Sophie
2016-10-26
I guess you have to use symbolic variables here instead of A(i),B(i),C(i). And only in the end substitute elements in result using subs
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!