Quantcast
Channel: Solving, solving\ - Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 3988

Solving differential equations (Diffusion and Reaction) using the Mathematics Physics

$
0
0
Hi all

I'm trying to learn a bit of mathematical modeling of chemical reactions whilst combining it with the Mathematics physics of COMSOL. I am however, in a bit of trouble and I hope you can help me out with a few problems.

Problem 1) - Example 8.4
I have the following second order differential equation with the boundary conditions:
d^2y/dx^2-phi^2*y=0
x=0, dy/dx=0
x=1, y=1
This yields the analytical solution: y=cosh(phi*x)/cosh(phi).
My numerical solution is implemented using the General Form (PDE) in 1-D and writing the following as the source term with remaining parameters equal to zero:
f = -d^2y/dx^2+phi^2*y
with zero flux at x=0 and Dirichlet (y=1) at x=1.
The solutions are (I feel) pretty off, as the equations are relatively simple.

Problem 2) - Example 8.5
Equations are the same however, I now change the Dirichlet boundary condition to a Robin bc.
The bc is giving as:
x=1, dy/dx=Bi*(1-y), where y is evaluated a x=1
This produces the analytical solution:
y=cosh(phi*x)/(cosh(phi)+(phi/Bi)*sinh(phi))
I have tried implementing the Robin bc through the flux/source bc in COMSOL where g and q both are equal to Bi.
My numerical solution is off and doesn't seem to change with changing the parameter Bi.

Any help would be greatly appreciated. Models are attached as example 8.4 for problem 1 and example 8.5 for problem 2.

Best regards

Mikael




Viewing all articles
Browse latest Browse all 3988

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>