Hello Guillaume Tyson
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
Jun 8, 2015, 11:49 p.m. EDT
Hi, i encounter a problem, which is similar. Are you sure the future computation base on E*Udotdot + D*Udot + K*U == L rather than Ec*Udotdot + Dc*Udot + Kc*U == Lc. Do you know the relationship between Ec and E . I want the matrix for the future computation in temporal discretion. And I find Null*E*Null' does not equal to Ec.
Could you express for me in details!
Thanks a lot!
Hi, i encounter a problem, which is similar. Are you sure the future computation base on E*Udotdot + D*Udot + K*U == L rather than Ec*Udotdot + Dc*Udot + Kc*U == Lc. Do you know the relationship between Ec and E . I want the matrix for the future computation in temporal discretion. And I find Null*E*Null' does not equal to Ec.
Could you express for me in details!
Thanks a lot!
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
Jun 9, 2015, 7:06 a.m. EDT
Hi,
So if you check in the COMSOL documentation you'll find in "About the Time-Dependent Solver" exactly what equation COMSOL solves.
I'm not quite sure I understand what the "eliminated" matrices are but to answer your question, what I am sure of is that with the matrices from above, the equation is written:
E*Udotdot + D*Udot + K*U == F
Where F is a new vector containing the flux terms for the different dofs. There are two ways to calculate F:
-Either you use the complete system residuals at each time step that are actually in matrix L. This means that at any time step you would calculate F by:
F = E*Udotdot + D*Udot + K*U + L
This is very slow.
-Or you assemble F yourself from the boundary conditions of your problem. This can be tricky and I had to ask support for help but it works very well and is very fast.
Also maybe your problem comes from the presence of additional dofs. You can turn them off by clicking the "Show" button in the Model Builder then ticking "Discretization". You'll see that in your model interface, under the "Equation" drop-down menu a "Discretization" drop-down menu has appeared. "Compute boundary fluxes" should be checked, turn this option off and then the vector U in Matlab should have as many lines as the system matrices.
Hope this helps,
Regards,
Guillaume
Hi,
So if you check in the COMSOL documentation you'll find in "About the Time-Dependent Solver" exactly what equation COMSOL solves.
I'm not quite sure I understand what the "eliminated" matrices are but to answer your question, what I am sure of is that with the matrices from above, the equation is written:
E*Udotdot + D*Udot + K*U == F
Where F is a new vector containing the flux terms for the different dofs. There are two ways to calculate F:
-Either you use the complete system residuals at each time step that are actually in matrix L. This means that at any time step you would calculate F by:
F = E*Udotdot + D*Udot + K*U + L
This is very slow.
-Or you assemble F yourself from the boundary conditions of your problem. This can be tricky and I had to ask support for help but it works very well and is very fast.
Also maybe your problem comes from the presence of additional dofs. You can turn them off by clicking the "Show" button in the Model Builder then ticking "Discretization". You'll see that in your model interface, under the "Equation" drop-down menu a "Discretization" drop-down menu has appeared. "Compute boundary fluxes" should be checked, turn this option off and then the vector U in Matlab should have as many lines as the system matrices.
Hope this helps,
Regards,
Guillaume
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Jun 15, 2015, 10:51 p.m. EDT
Thank a lot~
the problem i am concerned is the mass or damping matrix.
for example, briefly, how to extract the mass matrix of poisson equation with certain boundary condition.
Could you give me future help ?
Best regards!
- Zhu Shuai
Thank a lot~
the problem i am concerned is the mass or damping matrix.
for example, briefly, how to extract the mass matrix of poisson equation with certain boundary condition.
Could you give me future help ?
Best regards!
- Zhu Shuai
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Jun 16, 2015, 2:44 a.m. EDT
Hi,
The problem is that you can't really extract the boundary conditions. After the call MAT = mphmatrix(model, 'sol1', 'out', {'L'}), MAT.L will be the load vector. As soon as you specify a solution number ( ie mphmatrix(model, 'sol1', 'out', {'L'}, i) for the i-th solution time) MAT.L will become your equation residuals.
You should probably aim to rebuild the the load vector manually in MATLAB.
Regards,
Guillaume
Hi,
The problem is that you can't really extract the boundary conditions. After the call MAT = mphmatrix(model, 'sol1', 'out', {'L'}), MAT.L will be the load vector. As soon as you specify a solution number ( ie mphmatrix(model, 'sol1', 'out', {'L'}, i) for the i-th solution time) MAT.L will become your equation residuals.
You should probably aim to rebuild the the load vector manually in MATLAB.
Regards,
Guillaume
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Jun 16, 2015, 4:10 a.m. EDT
Thanks you!
So, we can also operate the boundary condition for the mass matrix in the same way. Is there any easy way to implement it via Comsol ?
Best Regards!
---ZhuShuai
Thanks you!
So, we can also operate the boundary condition for the mass matrix in the same way. Is there any easy way to implement it via Comsol ?
Best Regards!
---ZhuShuai
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Dec 13, 2015, 5:01 p.m. EST
Hi Guillaume,
Have you found the reason of this added 'internal DOFs'? Or did you get the correlation between the solution vector U (via getU) and other vectors? I need to extract the U, modify it and then assign it back to variables, thus I have to know how the U is formatted.
Regards
Hao
Hi Guillaume,
Have you found the reason of this added 'internal DOFs'? Or did you get the correlation between the solution vector U (via getU) and other vectors? I need to extract the U, modify it and then assign it back to variables, thus I have to know how the U is formatted.
Regards
Hao
Lars Gregersen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Dec 14, 2015, 6:55 a.m. EST
Hi Hao
You can use the function mphxmeshinfo to get information the matrices returned by mphmatrix and the internal degrees of freedom. The data returned by mphxmeshinfo is documented in the Programming Reference Manual under XMeshInfo in the chapter on solvers.
Rregards
Lars Gregersen
Comsol Denmark
Hi Hao
You can use the function mphxmeshinfo to get information the matrices returned by mphmatrix and the internal degrees of freedom. The data returned by mphxmeshinfo is documented in the Programming Reference Manual under XMeshInfo in the chapter on solvers.
Rregards
Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
Dec 14, 2015, 7:44 p.m. EST
Thanks Lars, I will check that part.
Thanks Lars, I will check that part.
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
Nov 16, 2016, 4:03 a.m. EST
It seems that 5.2a version has fixed this bug about Lc&L stuff. Just in case anyone would face this problem.
Hi,
The problem is that you can't really extract the boundary conditions. After the call MAT = mphmatrix(model, 'sol1', 'out', {'L'}), MAT.L will be the load vector. As soon as you specify a solution number ( ie mphmatrix(model, 'sol1', 'out', {'L'}, i) for the i-th solution time) MAT.L will become your equation residuals.
You should probably aim to rebuild the the load vector manually in MATLAB.
Regards,
Guillaume
It seems that 5.2a version has fixed this bug about Lc&L stuff. Just in case anyone would face this problem.
[QUOTE]
Hi,
The problem is that you can't really extract the boundary conditions. After the call MAT = mphmatrix(model, 'sol1', 'out', {'L'}), MAT.L will be the load vector. As soon as you specify a solution number ( ie mphmatrix(model, 'sol1', 'out', {'L'}, i) for the i-th solution time) MAT.L will become your equation residuals.
You should probably aim to rebuild the the load vector manually in MATLAB.
Regards,
Guillaume
[/QUOTE]