I see that assempde will take as its input either a boundary condition matrix or a boundary M-file, but both seem to give boundary conditions by specifying a simple formula (like x.^2+y.^2, from the example in the help files). I want to solve Poisson's equation using actual experimental data for the Neumann boundary conditions. It would seem reasonable to provide a matrix similar in form to the edge matrix "e", but containing local values of the Neumann boundary condition. Can it be done?
Thanks in advance from a lowly experimentalist to all you pde gurus!
Unless if you refer to Dirac Neumann bc, the local values Neumann's bc does not make sense. It must be something you can *apply* on another function defined on the boundary. Specifically, mathematician like to refer it as continuous linear application on the fractional Sobolev H^{1/2} space; or even more barbaric: the "H^{-1/2} space". The later does not have defined local value, unfortunately.
Bruno
Anyway, that's not the sticky part--what I'm unsure about is how to specify boundary conditions from measured data, instead of specifying them as a constant or an analytic function of coordinates.
--Doug
You can't. Physically, it does not make sense to measure the flux at one point locally. You need to know the flux on the boundary *entirely*. You might assume that your flux is constant or linear by edge, but you measure it at the nodes, but you cannot assume a partial flux. Take a semaphore, you can't estimate accurately the water going out a pond by measuring the water speed at one single point (or many few of them).
Constant Neumann du/dn = g on gamma (the boundary)
<=> specify integral (du/dn.f) dx := integral g.f dx, for all f
Dirac Neuman du/dn = g delta (xi)
<=> specify integral (du/dn.f) dx := g.f(x), for all f
However you won't be able to define the above integral if you only know du/dn at the nodes (you will need to know du/dn in the edge entirely)
Bruno
Though wbound makes a boundary M-file that is based on a simple formula, in exactly the same format as a boundary condition matrix, it's possible to write your own boundary M-file *any way you like*. As long as it takes (p,e,u,time) as inputs and returns [q,g,h,r] as outputs, it works fine with assempde. You just pass the filename of the boundary M-file as the first argument to assempde. So I've written a boundary M-file that takes the necessary inputs (p,e,u,time) but ignores them, instead constructing [q,g,h,r] from my measurements. And it works. Reading the help file for pdebound over and over was the key!
Bruno, I'm still not following your argument that Neumann boundary conditions can't work. I understand that they leave room for an arbitrary constant of integration, but that's OK for me, because in my application, the solution to Poisson's equation is a stream function. My real interest is its gradient, for which the constant of integration is irrelevant. You seem to be concerned about the fact that the nodes are discrete points, but so are my measurements, and so is every numerical grid; again I don't understand. In case we're still talking about two different things, here's what I mean by Neumann boundary conditions:
http://en.wikipedia.org/wiki/Neumann_boundary_condition
http://mathworld.wolfram.com/BoundaryConditions.html
You never get the right convergence property with *point-wise* Neumann condition, i.e., your PDE is ill posed; from that you might get all nasty stuff, and the numerical solution might be very far from the true solution, whatever it is.
But nevermind, nobody never get the sense why we bother to define all these Sobolev space anyway, it is not just for fun.
Bruno
I might not fully understand where your Neumann data are from (I understand from measurement), but you have to be careful about how to plug them into the PDE, even if you think you can define it in the boundary.m.
Bruno