Using fzero to solve an equation

1 Ansicht (letzte 30 Tage)
limellama
limellama am 30 Sep. 2017
Beantwortet: Star Strider am 1 Okt. 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?

Antworten (1)

Star Strider
Star Strider am 1 Okt. 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);

Kategorien

Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by