I am having a problem with the syms function in matlab and I was wondering if anyone could help. The help would be greatly appreciated.
The code is to caclulate the bubblepoint of a mixture which contains n components.
The beginning of the code can be seen below. The last line is where the error :Error converting from sym to double: Unable to convert expression into double array
P_total = input('Please enter the total pressure in mm Hg: \n');
n = input('Please enter the number of components:\n');
x = zeros(1, n); % Liquid phase mole fractions
y = zeros(1, n); % Vapour phase mole fractions
load Antoine_coefficients.txt % reading in the file which contains the Antoine Coefficients of the components
fprintf(' 1 = Acetaldehyde\n 2 = Acetic Acid \n 3 = Acetone \n 4 = Acetylene \n 5 = Ammonia\n 6 = Argon\n 7 = Benzene \n')
for ite = 1: n
fprintf('Please enter the corresponding number for the component %i in the feed stream: \n', i);
comp(i) = input(' ');
data1 = Antoine_coefficients(comp(i),:);
a(i) = data1(1);
b(i) = data1(2);
c(i) = data1(3);
for i = 1:1:n
fprintf('Please input the liquid phase mole fraction of component %i: \n', i);
x(1, i) = input(' ');
% bubble point temp. calc
syms T [1:n]
for i = 1:1:n
% y1 = x1 * Psat/Ptotal
y(i) = x(i).*(10.^Antoine(a(i), b(i), c(i), T)./P_total); % Antoine is the user defined function which calculates Psat
I would really appreciate any help.
Thank in advance!