As you can see in the image, I am not able to post my question to the site, it being flagged for "code that is not properly formatted", even though my question contains no code at all, just math.

enter image description here

Full text of question follows. Help appreciated!

I am attempting to follow this tutorial in the documentation on using FEM to solve PDEs. I am having difficulty understanding how to formulate the Neumann boundary condition for my free-boundary problem. In the notation of the tutorial, it seems integral to be able to write down the equation in the form (I drop the "time" terms since they are not relevant to my question) $$ \nabla \cdot (-c(t,X,u,\nabla_X u) \nabla u-\alpha (t,X,u,\nabla _Xu) u+\gamma (t,X,u,\nabla _Xu)) + \beta (t,X,u,\nabla _Xu)\cdot \nabla u+a(t,X,u,\nabla _Xu) u - f(t,X,u,\nabla _Xu) = 0\ , $$ since the term in the first set of parentheses is used to define the Neumann boundary condition: $$ \overset{\rightharpoonup }{n}\cdot (c \nabla u-\gamma +\alpha u)=g-q u\ . $$

Well, my PDE for $F = F(p, w)$ is

$$ \frac{1}{2}\sigma^2 p^2 \partial_p^2 F + \mu p \partial p + (\rho w + \xi) \partial_w F + (p \partial_w F)^\gamma - \beta F = 0\ , $$

where all of the lowercase Greek-letters are constants.

(i) I am first of all unclear as to how best to re-write this in the standard form above, since I have a first-order derivative in $w$ but a second-order derivative in $p$. In fact, I can see multiple ways to re-write the equation, but am unsure which one is correct.

(ii) Once this has been accomplished, I would like the following "smooth-fit" conditions to hold on the boundary $\partial \Omega$ of the domain over which I solve the PDE:

$$ F = G,\ \quad \partial_p F = \partial_p G, \quad \partial_w F = \partial_w G. $$

Here $G(p, w)$ is a known function. The first condition is a Dirichlet condition which is straightforward to implement. How would I formulate the latter two conditions in the Mathematica syntax for the Neumann boundary condition?

  • 3
    This often happens when using TeX on this site, since we're really more geared towards code. You can initially post with the TeX bracketed with triple-backticks (```) and then edit to remove the backticks and get the TeX formatted correctly again. I would recommend posting the code you've tried though if you're following a tutorial
    – b3m2a1
    Commented Jul 3, 2023 at 17:11
  • Thanks for the hack, it worked. This feature is quite annoying though - I've never had trouble on the other SE websites. (mathematica.meta.stackexchange.com/q/2736/7984) While I completely understand its necessity, perhaps this is a way to lower the "sensitivity" on the code- formatting detection? Do you think this is a request worth submitting?
    – Anthony
    Commented Jul 4, 2023 at 7:24
  • You can try to bring it up with Stack Exchange the company but odds are low they'll do anything with it
    – b3m2a1
    Commented Jul 5, 2023 at 14:57


You must log in to answer this question.

Browse other questions tagged .