Using fzero to solve an equation

1 vue (au cours des 30 derniers jours)
limellama
limellama le 30 Sep 2017
I am trying to plot the following equation:
Vm - (S0 - s)/t = Km/t * ln(S0/s)
where Vm, S0, and Km are given constants.
I want to plot s vs.t so I tried using fzero:
Km = 1.25;
Vm = 1.5;
S0 = 5;
fun = @(t,s)(Km/t)*log(S0-s) - Vm + (S0-s)/t;
I am trying to plot over the interval of 0 to 10. How can I make use of fzero syntax to plot this?

Réponses (1)

Star Strider
Star Strider le 1 Oct 2017
I defaulted to the Symbolic Math Toolbox to solve this:
syms s t
Km = 1.25;
Vm = 1.5;
S0 = 5;
eqn = Vm - (S0 - s)/t == Km/t * log(S0/s);
ss = solve(eqn, s);
s_fcn = matlabFunction(ss)
t = linspace(0, 10, 25);
figure(1)
plot(t, s_fcn(t))
grid
s_fcn = @(t)wrightOmega(t.*(-6.0./5.0)+log(4.0)+4.0).*(5.0./4.0);

Catégories

En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by