Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

COMSOL Weak form modeling using Matlab Command line

Please login with a confirmed email address before reporting spam

Hi All,

I'm trying to build and solve a weak form equation generated from virtual work principle in Matlab via ''COMSOL with MATLAB''.

I know how to solve a weak form equation in COMSOL desktop, but my ultimate goal is to write a for-loop in Matlab and at each time step I will modify the weak form and then let COMSOL to solve this weak form equation over a domain, then I go to next step in the for loop. The structure of the algorithm in Matlab is written below.

for i=1:100
--First, build/modify the weak form equation;
--Second, let COMSOL to solve the weak form equation;
--Third, get the solution for the weak form problem from COMSOL to Matlab using Matlab commands;
end

During this process, I will not manually change the model in COMSOL desktop, all the modification is done through Matlab command lines in MATLAB using COMSOL with MATLAB. So I need to build and modify the weak form equation in MATLAB. Does anyone know how this can be done? Better if you can provide the command lines to build a weak form equation.

Thanks a lot.

0 Replies Last Post 11.04.2014, 00:11 GMT-4
COMSOL Moderator

Hello Jiacheng Wu

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.

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.