Using fzero to solve an equation
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
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);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!