Using fzero to solve an equation

1 view (last 30 days)
limellama
limellama on 30 Sep 2017
Answered: Star Strider on 1 Oct 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?

Answers (1)

Star Strider
Star Strider on 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);

Categories

Find more on Problem-Based Optimization Setup in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!