Cannot execute Figure(3).
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
Was doing my assignments and have managed to solve all except last one, where, I couldn't execute Figure(3) to plot the graph in mathlab.
Here's my code so far. (please see Figure(3) code if there's anything wrong)
k=0.000124; %mass transfer coefficient
d=0.00057; %diameter of the membrane tube
Q=3.4*10.^-8; %flow rate of water
z=linspace(0,0.5); %distance along the length of membrane tube
y=1-exp(-(((k*pi*d)/Q))*z); %Given Equation. Let y be (C/Cr)
figure(1); %Question 3a
plot(z,y);
xlabel('Distance')
ylabel('Concentration')
grid on;
%----------------------------%
%To study the effect of diameter of membrane%
D=[0.0004275;0.00057;0.0007125]; %Calculate manually on 0.75d, d, 1.25d;
Y=1-exp(-(((k*pi*D)/Q))*z); %Given Equation. Let Y be C/Cr to study the diameter of the membrane
figure(2); %effect of diameter of the membrane
plot(z,Y);
xlabel('Distance')
ylabel('Concentration')
legend('0.75d','d','1.25d')
grid on;
%------------------------------------%
%Effect on flow rate%
q=[0.000000025;0.000000034;0.000000042]; %Calculate manually on 0.75Q, Q, 1.25Q;
f=1-exp(-(((k*pi*d)/q))*z);
figure(3); %effect of flow rate
plot(z,f);
xlabel('Distance')
ylabel('Concentration')
legend('0.75Q','Q','1.25Q')
grid on;
Thank you and appreciate your help! :)
1 Kommentar
Antworten (1)
Walter Roberson
am 29 Sep. 2022
q=[0.000000025;0.000000034;0.000000042]; %Calculate manually on 0.75Q, Q, 1.25Q;
f=1-exp(-(((k*pi*d)/q))*z);
The / operator is not division and the * operator is not multiplication. The * and / operators are matrix operations, inner product for * and matrix division for /
You need to use .* and ./ instead
0 Kommentare
Siehe auch
Kategorien
Mehr zu Title finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

