Solving arrays in an equation to a variable
Show older comments
syms T p
pfun=fun_EthanolDampfdruck(T);
TSiede=vpasolve(pfun==1.01325,T,300); %Boilingtemperature of Ethanol at 1.013 bar
fprintf('The vapor pressure of Ethanol is %4.2f °C at a system pressure of 1.013bar ',TSiede-273.15)
R=8.314; %universal Gas constant J/(mol*K)
q=38720; %Heat of vaporization in J/mol at 78.27°C and 1.013bar
p=[1.013; 1.05; 1.08; 1.013; 1.05; 1.08; 1.013; 1.05; 1.08; 1.013; 1.05; 1.08; 1.013; 1.05; 1.08; 1.013; 1.05; 1.08; 1.013; 1.05; 1.08];
TS=zeros(1,length(p));
for i=1:length(p)
TS(i)=vpasolve(pfun==p(i),T,300);
end
x=[0.1; 0.1; 0.1; 0.15; 0.15; 0.15; 0.18; 0.18; 0.18; 0.20; 0.20; 0.20; 0.21; 0.21; 0.21; 0.22; 0.22; 0.22; 0.23; 0.23; 0.23]; %Weightfraction of A in Ethanol-Solution
T=[81.62; 82.53; 83.25; 84.98; 85.92; 86.63; 87.84; 88.75; 89.45; 90.07; 90.88; 91.6; 91.24; 92.04; 92.74; 92.5; 93.33; 94.03; 93.72; 94.52; 95.23]; %Temperature in °C
T=T+273.15; %Temperature in K
for i=1:length(T)
px(i)=fun_EthanolDampfdruck(T(i));
end
px;
dp=px-p'; %Delta Partialpressure of the solution to pure Ethanol
dTb=TS'-T % Delta Boiltingtemperature of the Solution to pure Ethanol
syms m
for i=length(dTb)
m(i)=solve(dTb(i)==m*(1-x(i))/x(i)*R*T(i)^2/q,m) % Equation is dTb=m*(1-x)/x*R*T^2/q
end
With my Code m shows me the following image with only one solution at m(1,21). dTb,x,T are all 21x1. How can i get m for dTb/x/T(1:21). If there is a basic failure in my Script please let me know, im new to matlab :)

5 Comments
Kevin
on 26 Jun 2023
Torsten
on 26 Jun 2023
We need to know the array dTb.
Dyuman Joshi
on 27 Jun 2023
Kevin
on 27 Jun 2023
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
