Question

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!

Was it helpful?

Solution

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]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top