I want to solve this equation for Xp while I know all others parameters.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Majid Khalil
il 15 Nov 2022
Commentato: Majid Khalil
il 15 Nov 2022
''log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/(1-Xo)*(1-Xp) == -(K*P*(M/T)^0.5)/(1-Xo)*A/F''
clear all
close all
clc
%Defining variable
syms Xp % outlet conc.
Xo = 0.10; % inlet conc
K = 5.83e-2; % numerical constant
P = 3; % pure component vapore pressure
M = 114; % molecular weight of volatile component
T = 700; % absolute temp
A = 3; % area available for evaporation
F = 23; % feed flow rate
%Balance equation
log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/(1-Xo)*(1-Xp) == -(K*P*(M/T)^0.5)/(1-Xo)*A/F
%here is my code by i could not find the value of Xp
1 Commento
John D'Errico
il 15 Nov 2022
Is there a typo in that balance equation as you wrote it? It seems you may have missed an important pair of parens.
Risposta accettata
Torsten
il 15 Nov 2022
Modificato: Torsten
il 15 Nov 2022
%Defining variable
syms Xp % outlet conc.
Xo = 0.10; % inlet conc
K = 5.83e-2; % numerical constant
P = 3; % pure component vapore pressure
M = 114; % molecular weight of volatile component
T = 700; % absolute temp
A = 3; % area available for evaporation
F = 23; % feed flow rate
%Balance equation
solve(log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/(1-Xo)*(1-Xp) == -(K*P*(M/T)^0.5)/(1-Xo)*A/F,Xp)
fplot(log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/(1-Xo)*(1-Xp) + (K*P*(M/T)^0.5)/(1-Xo)*A/F,[0.01 1])
Più risposte (1)
John D'Errico
il 15 Nov 2022
Modificato: John D'Errico
il 15 Nov 2022
In almost all cases when you have a variable that lies both inside, and outside of a nonlinear function, like sin or cos, log and exp sometimes also, there will be no analytical solution.
However, exp and log are exceptions, that SOMETIMES allow for a solution. That solution often comes in the form of the LambertW function, pretty much explicitly derived as a solution for problems of this form.
syms Xp % outlet conc.
Xo = 0.10; % inlet conc
K = 5.83e-2; % numerical constant
P = 3; % pure component vapore pressure
M = 114; % molecular weight of volatile component
T = 700; % absolute temp
A = 3; % area available for evaporation
F = 23; % feed flow rate
Now you write:
%Balance equation
log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/(1-Xo)*(1-Xp) == -(K*P*(M/T)^0.5)/(1-Xo)*A/F
And personally, I think you have a typo in that line. I see that you wrote this INSIDE the log:
(Xp*(1-Xo))/(Xo*(1-Xp))
And outside of the log, you have something similar:
(Xp-Xo)/(1-Xo)*(1-Xp)
when I think you intended to write
(Xp-Xo)/((1-Xo)*(1-Xp))
This form is closer yet. Not close enough that a LambertW solution will be found. That extra pair of parens is important. In the latter case, you are dividing by (1-Xp). It seems far more likely you forgot the extra parens.
BalEq = log((Xp*(1-Xo))/(Xo*(1-Xp))) + (Xp-Xo)/((1-Xo)*(1-Xp)) == -(K*P*(M/T)^0.5)/(1-Xo)*A/F
solve(BalEq,Xp)
MATLAB is able to find a solution, but there is no analytical solution to be found.
0 Commenti
Vedere anche
Categorie
Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!