Cannot execute Figure(3).
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Réponses (1)
Walter Roberson
le 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 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!