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!