Thanks, Jonathan, that's very helpful. _____________________________________________
Douglas L. Borden Knight Equity Markets, L.P. 545 Washington Boulevard, Jersey City, NJ 07310 Tel: 201-239-2208 | Email: [email protected] Fax: 201-356-2279 | AIM: DBordenAtKnight Cell: 646-416-4875 | Skype: DBordenAtKnight LinkedIn: www.linkedin.com/in/douglasborden _____________________________________________ -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jonathan Guyer Sent: Wednesday, October 14, 2009 4:10 PM To: Multiple recipients of list Subject: Re: Need help getting started On Oct 13, 2009, at 12:01 PM, Borden, Doug wrote: > I've just started using FiPy for a problem in quantitative finance, > and I need a bit of help getting started. Welcome to the list. > I've cast a particular problem in trading as a stochastic control > problem, and after deriving the relevant Hamilton-Jacobi-Bellman > equation, I end up with a PDE to solve (see attached PDF). I have > two questions: > > 1) Do I only have a source term and a transient term, or can I > cast my problem with a convection term? > 2) How do I specify my boundary conditions? > > Any help you can offer would be greatly appreciated. Aside from the issues that Frederic raises about singularities, my thought is that from FiPy's perspective, because you are applying a boundary condition on all x at t = t_n, I don't think you have a transient term. Although you can certainly set an initial condition on a time-dependent problem, FiPy has no way to assign a terminal value. It may be more fruitful to think about two spatial dimensions that happen to be named x and t and that run from -xmax to +xmax and from 0 to t_n. You can then impose a conventional FixedValue boundary condition at t = t_n and it may be possible to solve the static problem in terms of these two "spatial" dimensions. In principle, I think d\phi/dt and d\phi/dx can then be cast to convection terms with wind vectors of [0,1] and [1,0] respectively, but I'm not sure how I'd capture the max() business. Also, because there would be nothing but convection and sources, it might be necessary to introduce a transient term for relaxation, but to recognize that it's in terms of an artificial time variable, not your "t". Daniel may hopefully have further insights into this, particularly on how best to pose the convection terms. Another possibility might be to set your t = t_n boundary condition as an initial (final?) condition on a one-dimensional problem in terms of x and then run backwards in time (TransientTerm(coeff=-1) should do it). I see that Wikipedia says as much, so it must be true. DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at its discretion, monitor and review the content of all e-mail communications. http://www.knight.com
