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:
9 years ago
8 juin 2015, 23:49 UTC−4
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:
9 years ago
9 juin 2015, 07:06 UTC−4
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
15 juin 2015, 22:51 UTC−4
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
16 juin 2015, 02:44 UTC−4
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
16 juin 2015, 04:10 UTC−4
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
13 déc. 2015, 17:01 UTC−5
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
14 déc. 2015, 06:55 UTC−5
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
14 déc. 2015, 19:44 UTC−5
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
16 nov. 2016, 04:03 UTC−5
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]