Mathematica problems with certain differential equations and DSolve

霸气de小男生 提交于 2019-12-25 01:14:40

问题


Im having trouble getting started. I am in a Financial Engineering program, and I am trying to use a book written in 2003 to help me model partial differential equations, the black scholes model, etc.

But in the introductory chapter there is a very basic ODE interest rate problem, and my output is very different from the book.

DSolve[{y'[t] == ry[t], y[0] == P}, y[t], t] 

is what I put in. The book has a very neat solution of {{y(t)->P*exp^(rt)}}

What I get is something like (Note, I can't post the output)

{{y(t) -> integral_1_to_t ry(K[1]]dK[1] - integral_1_to_0 ry(K[1])dK[1]+P}}

What are the big K's? Is this just some rule output that can't generate a symbolic solution? Because of some problem with my set up or filesystem? Also, are there any suggestions for using old books on Mathematica where the code provided may be out of date? I just need to find a way to move forward and apply this to my studies.

Last, sometimes with other ODE's I will get results different than my source. I.E. I followed a Mathematica ODE tutorial and my output was different too. In some places my version of Mathematica won't calculate, or drops certain variable s or constants in the solution, or there is no output. I have browsed for general troubleshooting for DSolve, but have found no persistent and recognized bug. I am wondering if there is something wrong in my file system, or something else? Please help!


回答1:


You've an space missing between the r and the y[t].

Try:

DSolve[{y'[t] == r y[t], y[0] == P}, y[t], t]


来源:https://stackoverflow.com/questions/15210825/mathematica-problems-with-certain-differential-equations-and-dsolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!