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.

[Solved] Livelink for Matlab material definition issue

Please login with a confirmed email address before reporting spam

Hello,

My problem is the following:

I am defining a RF model:

[...]
model.physics().create('rfw1', 'ElectromagneticWaves', 'geom1');
model.study().create('study1');
s1 = model.study('study1');
s1.feature().create('struct','ModeAnalysis');
[...]

This physics/study requires to define the relative permittivity, permeability and electrical conductivity.

To define my material from Matlab, I use without success with version 4.3a:

[...]
mat1 = model.material.create(['mat' num2str(I)]);
mat1.materialmodel('def').set('mur','1');
[...]

or

[...]
mat1 = model.material.create(['mat' num2str(I)]);
mat1.materialmodel('def').set('Relative permeability','1');
[...]

When I look at it within the GUI, I see that the requested field is not filled but there is another with the same property name (equal to the Name property) see attachement. Of course, the computation failed since the required field is not propoerly filled.

Where is my mistake?

Thank you all,

Denis





3 Replies Last Post 2013年5月29日 GMT-4 04:46
COMSOL Moderator

Hello Pierre Sillard

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: 1 decade ago 2013年5月27日 GMT-4 21:18
Hi

how do you solve the problem . I found material cannot create from matlab. i donot know what is wrong.

colin
Hi how do you solve the problem . I found material cannot create from matlab. i donot know what is wrong. colin

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年5月28日 GMT-4 09:32
Denis,

the easiest way is to learn how to teach yourself.

Make a simple model using the Comsol's interface. There you'll just create an electromagnetic study and there you will define a simple geometry with an associated material.

File > Reset history
File > Save as M-file

Then in matlab, open the previously saved M-file. There you'll see how a material has to be defined.
--
cheers,
Felipe BM
Denis, the easiest way is to learn how to teach yourself. Make a simple model using the Comsol's interface. There you'll just create an electromagnetic study and there you will define a simple geometry with an associated material. File > Reset history File > Save as M-file Then in matlab, open the previously saved M-file. There you'll see how a material has to be defined. -- cheers, Felipe BM

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年5月29日 GMT-4 04:46
Thanks, Felipe, that is the solution. Best Regards, Denis
Thanks, Felipe, that is the solution. Best Regards, Denis

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.