Solving nonlinear equation with parameter

2 Ansichten (letzte 30 Tage)
Leszek
Leszek am 11 Jul. 2023
Kommentiert: Leszek am 12 Jul. 2023
Hi!
I'm totally new to Matlab evironment and I think that might be a very easy question, but I just can't find an answer.
I need to solve this equation for X:
ϵ, k, n and C are known constants, but I want to obtain solutions depending on τ.
I tried to write it whis way, but I think it requires more complicated solution

Akzeptierte Antwort

Torsten
Torsten am 11 Jul. 2023
Bearbeitet: Torsten am 11 Jul. 2023
Tau = 0:0.01:1;
kc0 = 270;
Ea1 = 21500;
Ea2 = 121500;
n = 0.63;
eps = 0.52;
Cch4 = 0.2;
Temp = 800 + 273;
kcmax = kc0*exp(-Ea1/8.314/Temp);
C0 = 0.5;
for i = 1:numel(Tau)
tau = Tau(i);
fun = @(x) kcmax*tau*Cch4^(n-1)/(1+eps*x)^n-x/(1-x)^n;
C(i) = fsolve(fun,C0,optimset('Display','none'));
C0 = C(i);
end
plot(Tau,C)

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by