Hello again,
Thanks to the help of those on the forum I was able to incorporate weak constraints to get accurate flux calculations in my diffusion models. However, I am trying to understand how exactly the lagrange multipliers work in terms of the final matrix construction and there is very little documentation in the comsol manuals and guides. I tried looking up some papers but they are written at a very high level of math that I'm not able to grasp the details of.
I tried writing out a simple heat diffusion problem in 1D with 3 mesh elements and solving with direct elimination, and then incorporating the lagrange multiplier via the approach shown here: www.softeng.rl.ac.uk/st/projec...s/html/Intro/intro-node68.html
I just wrote out the weak form and calculated the matrix by hand which isn't very hard for a 3 element 1D problem.
However, when I do this, I get the same answer for flux using either method (directly elimination or lagrange multipliers) once I solve the system of equations. BUT, when I do the same thing in COMSOL with the same problem definition, same constraints, and same number of elements, same basis function order, etc., the lagrange multiplier value I get matches up perfectly with the analytical solution. I would like to know how this is implemented, so that I can understand what is going on when I choose these constraints.
If anyone is able to explain it to me or provide me with a link I would be very grateful!
Thanks to the help of those on the forum I was able to incorporate weak constraints to get accurate flux calculations in my diffusion models. However, I am trying to understand how exactly the lagrange multipliers work in terms of the final matrix construction and there is very little documentation in the comsol manuals and guides. I tried looking up some papers but they are written at a very high level of math that I'm not able to grasp the details of.
I tried writing out a simple heat diffusion problem in 1D with 3 mesh elements and solving with direct elimination, and then incorporating the lagrange multiplier via the approach shown here: www.softeng.rl.ac.uk/st/projec...s/html/Intro/intro-node68.html
I just wrote out the weak form and calculated the matrix by hand which isn't very hard for a 3 element 1D problem.
However, when I do this, I get the same answer for flux using either method (directly elimination or lagrange multipliers) once I solve the system of equations. BUT, when I do the same thing in COMSOL with the same problem definition, same constraints, and same number of elements, same basis function order, etc., the lagrange multiplier value I get matches up perfectly with the analytical solution. I would like to know how this is implemented, so that I can understand what is going on when I choose these constraints.
If anyone is able to explain it to me or provide me with a link I would be very grateful!