Serving the Quantitative Finance Community

 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 26th, 2020, 1:52 pm

Looking at the Riemann method for the problem, for example here (and Garabedian's PDE book, which I found I had purchased), I think the orig problem is solvable quasi-analytically, in principle, as follows.

1. Take the problem to be:
(*) [$]u_t = \rho \, u_{xy}[$] with 
bc: u is given on two adjacent edges and 
ic: [$]u(t=0,x,y)=u_0(x,y)[$] is given (arbitrary, as long as compatible with the bc).

2. Take the Laplace transform with respect to time of (*), with [$]U(x,y;s) = \int_0^{\infty} e^{-s t} u(t,x,y) \, dt[$]. This yields

(**) [$]U_{xy} + c \, U = f(x,y)[$], where [$]c = s/\rho[$] and [$]f = -u_0/\rho[$], and where the function [$]U(x,y)[$] is known on two adjacent edges.

3. So, that's a Goursat problem again, and the solution to (**) is given at the link or various books in terms of the edge and initial functions, using the Riemann function [$]R = J_0(\sqrt{4 c (x-\xi)(y-\eta)})[$].

4. Do a numerical Laplace inversion w.r.t. [$]s[$] of the solution in Step 3 to get numbers. 
Or don't, as the argument shows what bc and ic's `work', which was actually the original question. 
Last edited by Alan on April 26th, 2020, 2:08 pm, edited 1 time in total.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Re: Finite difference - CFD technique

April 26th, 2020, 2:07 pm

Thank you, Alan. It is nice to see that you have put lessons on characteristics to good use!
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

April 27th, 2020, 9:26 am

The main goal was to prove the well-posedness of the time-dependent Goursat problem and it looks as that has been achieved (an 'exact' solutions is not needed).
The final specific issue is BC; let's write the pde in the canonical form for [$]\rho < 0[$]

 [$]u_t = \rho \, u_{xy}[$] 

Then in that case my claim is that BC be prescribed for [$]x= 0, y = 0[$]. For [$]\rho > 0[$] we can define [$]z = 1-y[$] to put the pde into canonical form and thence we can conclude that BC in this case are on [$]x = 0, y = 1[$]. I have verified these conclusion experimentally.

The basic ansatz is tacking [$]u_t[$] onto the canonical form [$]\rho \, u_{xy}[$] and taking it from there. This allows us to get the BCs.
Last edited by Cuchulainn on April 27th, 2020, 10:03 am, edited 6 times in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

April 27th, 2020, 9:35 am

Thank you, Alan. It is nice to see that you have put lessons on characteristics to good use!
I think [$]c = -s/\rho[$]? (?)
[$]f = u_0/\rho[$],

But I don't think it affects the conclusions.
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 27th, 2020, 1:23 pm

Yeah, [$]c = -s/\rho[$]. I think orig. f is ok. Note there are 4 pairs of adjacent edges.

If you code up an fdm numerical solution example good to, let's say, 4+ digits, I'd be happy to try to code up the corresponding 'exact' solution to compare. 
(But not for a few days, as have another project I need to finish today). I'm slightly worried about the sign of c, so we should do [$]\rho = \pm 1[$].

Might be an interesting and tricky exercise for both of us: the dreaded cross-derivative for you, and a numerical Laplace inversion for me, which can be problematic. Plus, I'm curious to see the evolution of some initial function.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Re: Finite difference - CFD technique

April 27th, 2020, 5:33 pm

Don't you want to do the 2D wave equation before anything else? That's what I'd recommend. Waves on a string. Infinite string, semi infinite, finite. Just before jumping in with something more complicated...
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 27th, 2020, 7:25 pm

I would code the stationary solution here first, which is equivalent.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Re: Finite difference - CFD technique

April 27th, 2020, 7:46 pm

No, I mean analytically, understanding how waves bounce back in a finite string for example. "Domain of influence" and "domain of dependence" are key things to understand. (You could just go to numerics, or to transforms, but I think <30 minutes spent on those two topics will pay dividends later!)
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 27th, 2020, 8:26 pm

Well, we do study some of those things in physics. Actually, I have indeed been reading Ch. 3-5 in Garabedian's PDE book, both as a refresher and learning some new things. Without that, I wouldn't be attempting this.  
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

April 28th, 2020, 7:09 pm

A defined process to find the charactetristic curves (ODEs) of a range of 2d second order elliptic, hyperbolic and mixed pde is in Courant and Hibert Vol, II. (recommended) So it is just solving a quadratic equation.
One use case is removing mixed derivatives

https://forum.wilmott.com/viewtopic.php?f=4&t=102228

and here I've done it for the stochastic dividend pde

https://forum.wilmott.com/viewtopic.php?f=11&t=101316
Last edited by Cuchulainn on April 28th, 2020, 7:38 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

April 28th, 2020, 7:23 pm

Don't you want to do the 2D wave equation before anything else? That's what I'd recommend. Waves on a string. Infinite string, semi infinite, finite. Just before jumping in with something more complicated...
That's a very good idea (lateral thinking), certainly more known about it than Goursat pde. And for investigating 1) where them characteristics, 2) existence and uniqueness.
Then the pde is

[$]\frac{\partial u}{\partial t} = \rho ( \frac{\partial^2 u}{\partial \xi^2} -  \frac{\partial^2 u}{\partial \eta^2})[$]  (1)

(Again, I could find nothing on pde (1))

The most relevant case I think is a string fastened at one end and the other end is flapping all over the place.

You could possibly do the Laplace transform trick as before, solve by d'Alembert's solution (?) and then invert to prove it is a well-posed problem.

https://en.wikipedia.org/wiki/Wave_equation

The eventual numerical solution is for Goursat.
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 29th, 2020, 4:05 am

Is all this for your bivariate distribution stuff? (I see it in my copy of your C++ book).
If so, then the exact Goursat problem solutions are certainly not going to interest you, as they will just reproduce the 2D integrals you start with.
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

April 29th, 2020, 11:15 am

Is all this for your bivariate distribution stuff? (I see it in my copy of your C++ book).
If so, then the exact Goursat problem solutions are certainly not going to interest you, as they will just reproduce the 2D integrals you start with.
No, although it is related. It is time-independent and a piece of serendipity.
A well-known issue that all fd schemes have is how to deal with mixed derivatives. Some approaches are better than others. Basically, MD screws everything up. This particular one is to solve Goursat pde as one/last leg in an ADI/splitting scheme.

A solution does not need to be found. The goal is qualitative .. proving [$]Goursat(x,y;t)[$] is well-posed.
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Finite difference - CFD technique

April 29th, 2020, 4:42 pm

Speaking of mixed derivatives, I noticed an interesting thing about the problem 
[$]u_{xy}=0[$] with u specified on two adjacent edges. Take the standard case, where the adjacent edges lie along the x and y axis.

Now, take the difference formula for [$]u_{xy}[$] at a grid point (x,y) to be what one might call the "downstream cross-derivative". Using that, proceed to solve the problem by starting at the interior corner near the origin and then filling things in as shown in the attachment.

The interesting thing, to me anyway, is that the fdm scheme is exact, regardless of the lattice spacing h! Probably well-known, but I learned something.

Of course, if you took the two bc edges to be some other pair, you'd just point the cross-derivative in that direction, and it would still yield an exact solution.

[attachment=0]exactfdm2.jpg[/attachment][/font]
Attachments
exactfdm2.jpg
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Finite difference - CFD technique

July 25th, 2022, 11:29 pm