how do I find the minimum of an implicit equation with symbolic variable
Mostra commenti meno recenti
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
Risposte (1)
Sophie
il 26 Ott 2016
0 voti
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
Categorie
Scopri di più su Symbolic Math Toolbox in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!