How to extract the stiffness matrix K in multi-body dynamics (mbd) Transient simulation using MATLAB?

Please login with a confirmed email address before reporting spam

As the title indicates, when I attempted to use the mphmatrix function, I encountered an error: "The solution does not contain an active Variables node"


1 Reply Last Post 2026/04/02 22:13 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 3 hours ago 2026/04/02 22:13 GMT-4

After some time of trial and error, I figured out how to extract the matrix in the MBD simulation. Due to some reason, these matrices will not be automatically assembled. Before using the mphmatrix function, you need to add this statement: model.sol("sol1").feature("a1").set("K", true); Then it can be successfully extracted. Incidentally, this is something I obtained by copying the code of the "Assemble" node from the COMSOL software.

After some time of trial and error, I figured out how to extract the matrix in the MBD simulation. Due to some reason, these matrices will not be automatically assembled. Before using the mphmatrix function, you need to add this statement: model.sol("sol1").feature("a1").set("K", true); Then it can be successfully extracted. Incidentally, this is something I obtained by copying the code of the "Assemble" node from the COMSOL software.

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.