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.

Accessing individual variables (source term, convection coeffs...) for coefficient of PDE form using MATLAB livelink

Please login with a confirmed email address before reporting spam

Hi,
I am using COMSOL Coefficient of PDE form. I want to implement Gauss Quadrature for Discrete ordinates method (discretization in angular space). The way I am doing it is:
Each PDE equation represents a particular direction.
a. Extract solution vectors in Matlab . The size of the vectors is [1,number_mesh_in_x]. For 4 'angular' directions the , the size will be [4,mesh_in_x].
b. Implment gauss quadrature by taking this array as the input.
c. Return this to COMSOL PDE Coefficient 'f' -> Source term.
I am stuck here as I am unable to access this variable from Matlab.
I tried using:
a. model.physics('I').feature('cfeq1').set('f', 'I_guess',pass_array here_for_a_direction**);
b. model.param.set('I_guess',{pass_cell here_for_a_direction**}, 'W/(m^2)');
** -> After computing values of I_guess (defined as a parameter in COMSOL) by quadrature function in MATLAB,

1. Could you please tell how to access the individual coefficients for a particular PDE.
2. Is it possible to pass an array as a coefficient in the coefficient of PDE form?


0 Replies Last Post 22.11.2015, 21:55 GMT-5
COMSOL Moderator

Hello Yash Ganatra

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.