Effacer les filtres
Effacer les filtres

how do I find the minimum of an implicit equation with symbolic variable

3 vues (au cours des 30 derniers jours)
A K
A K le 26 Oct 2016
Réponse apportée : Sophie le 26 Oct 2016
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

Réponses (1)

Sophie
Sophie le 26 Oct 2016
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

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by