Using fzero to solve an equation

1 回表示 (過去 30 日間)
limellama
limellama 2017 年 9 月 30 日
回答済み: Star Strider 2017 年 10 月 1 日
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?

回答 (1 件)

Star Strider
Star Strider 2017 年 10 月 1 日
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);

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by