9

How do I simulate the following partial differential equation using Low level FEM in Mathematica?

D[u[x,y], x] - D[u[x,y], y] = x Sin[x y] - y Sin[x y]

The answer is Cos[x y]

added)

The region is [-1,1] for x and [-1,1] for y.

The boundary condition is u[-1,y]=Cos[-y]

Xminer
  • 1
  • 7
  • 15
  • In what sense is this a differential equation? Normally you are looking for an unknown function that is defined through a differential equation. What is the unknown function? – Hugh Jan 16 '19 at 12:38
  • my code was wrong.at first,I did used Cos(xy) for creating PDE and solve by FEM. the unknown function is u[x,y] – Xminer Jan 16 '19 at 12:41
  • Do you have a region on which you wish to solve the equation and boundary conditions? – Hugh Jan 16 '19 at 12:43
  • region is {x,-1,1} and{y,-1,1}. Boundary Condition is u[-1,y]=Cos[-y] – Xminer Jan 16 '19 at 12:45
  • 1
    Can you specify what problem you encountered? Otherwise there is an entire tutorial on FiniteElementProgramming. – user21 Jan 16 '19 at 12:50
  • Also note that this specific equation is convection dominated and most likely will not give good results with the FEM. Are you tied to this specific equation? – user21 Jan 16 '19 at 12:51
  • I first read the tutorial, but it was a bit abstract to understand what the FEM itself is doing for me.
  • My problem is that I do not know how to convert any PDE to solve it with FEM. I can not understand the flow of bringing it to the matrix form after making the mesh or how to make the mesh.

    1. There is no particular reason to be concerned about this equation. It is okay with something like diffusion equations.
    – Xminer Jan 16 '19 at 13:01
  • For example, if you have a two-dimensional PDE, you can solve it by bringing it into a recursive expression with FDM.

    However, in 3 or 4 dimensional problem it feels a bit difficult. So I began studying FEM, but I 'm stacked for more than a week. I will attach the FEM code I tried.

    – Xminer Jan 16 '19 at 13:07
  • I need to understand a bit better what you want to do. What is the purpose of this? Do you need the matrices? What is your end goal? If you want to plot the solution using NDSolve is enough, or not? – user21 Jan 16 '19 at 13:16
  • My goal is to solve PDE with FEM other than NDSolve.

    I mentioned Matrix because of some example of FEM used Matrix Form.

    NDSolve is very useful, but it seems not to be able to deal with my problem. So I have to build my own solver with FEM

    – Xminer Jan 16 '19 at 13:22