plotting ode warning with nor plot returned
1 次查看(过去 30 天)
显示 更早的评论
Trying to plot both of these ODEs against each other.
he error that is being returned is.
Warning: Error updating ParameterizedFunctionLine.
The following error was reported evaluating the function in FunctionLine update: Unable to convert expression into double array.
and the code is.
syms A(t) B(t)
N = 1000;
gamma = 0.1;
beta = 0.95;
eqns = [diff(A,t) == -beta*(B/N)*A+gamma*B, diff(B,t) == beta*(B/N)*(N-B)-gamma*B];
S = dsolve(eqns);
fplot(A,B)
0 个评论
回答(2 个)
Star Strider
2020-1-18
It helps to look at the dsolve results:
Bsol = S.B
Asol = S.A
that are:
Bsol =
0
17000/19
-17000/(19*(exp(C1 - (17*t)/20) - 1))
Asol =
C3
exp(-(17*t)/20)*(C2 + (2000*exp((17*t)/20))/19)
2000/19 - C4/(19*(exp((17*t)/20) - exp(C1)))
Provide numerical values for the initial conditions ‘C1’ and ‘C2’ and the rest, and the plot should magically appear!
0 个评论
Walter Roberson
2020-1-18
You dsolve() and store the answer but then you try to fplot the unprocessed A and B. At the very least you would want to plot S.A and S.B
However you would need to add boundary conditions in order to get S.A and S.B in a form that you can plot.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!