So apparently my textbook is out of date

1 回表示 (過去 30 日間)
Tessa
Tessa 2014 年 10 月 22 日
コメント済み: Star Strider 2014 年 10 月 23 日
I've been working out of DeVries' text on mathematical modeling for biological systems, and am working on the chapter that actually teaches you how to do all of this in Matlab. One of the examples I'm working through concerns the SIR model, and asks you to use the dsolve function to solve an ODE symbolically and for non-explicit solution, as such:
I = dsolve('DI = -1 + a/(b*S)','S')
According to the textbook, I should get a nice solved equation out of this (though it doesn't say what it should look like). However, when I actually type it into the terminal, I get
Warning, it is required that the numerator of the given ODE depends on the highest derivative. Returning NULL.
Warning, it is required that the numerator of the given ODE depends on the highest derivative. Returning NULL.
Warning, cannot find an explicit solution
{Error using maplemex Error, (in MTM:-dsolve) invalid input: indices received E, which is not valid for its 1st argument, t Error in dsolve (line 13) r = sym(maplemex(0,'MTM:-dsolve',varargin{:},'returnlist=true')); Error in matlab2211324625 (line 4) I = dsolve('DI = -1 + a/(b*S)','S');}
I'm assuming (as is my professor) that somewhere along the line, Matlab updated their formatting, and now the example equation is set up correctly. Can anyone give me any pointers on how it's supposed to look?
Thanks!

回答 (1 件)

Matt Tearle
Matt Tearle 2014 年 10 月 22 日
編集済み: Matt Tearle 2014 年 10 月 22 日
What version of MATLAB are you running? (Enter version at the command prompt and it will tell you, if you're not sure.) The code you pasted works fine for me on 14b, so, if anything, you're perhaps using an older version than whatever is used in the textbook.
You could also try this:
syms I(S) a b
Isol = dsolve(diff(I) == -1 + a/(b*S))
(I get the same result -- C2 - S + (a*log(S))/b -- either way.)
  6 件のコメント
Matt Tearle
Matt Tearle 2014 年 10 月 23 日
I just noticed that you have your university in your profile, but I'm having a hard time figuring out your license options. You could try calling Customer Support and see if they can work out if you have any kind of license available (through the school) -- 508 647 7000 (8:30-5:30 Eastern)
Star Strider
Star Strider 2014 年 10 月 23 日
There is also Julia, although I don’t know if it has a symbolic toolbox.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by