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 vs matlab parameters

Please login with a confirmed email address before reporting spam

Hi All !!

I have a question about passing argument from comsol to matlab when using Comsol with matlab.

to pass parameter with comsol, it is possible, as explainedin the documentation to use instruction like, for example,

model.param.set('side', '3.4');
where side is a parameter and 3.4 its value...the value can be subsequently varied if needed during parametric studies...as explained in the doc.

Note that in a "model.param.set" instruction only scalar can be passed according to the doc

but It is also possible to use
" side" defined as a matlab variable in other comsol instruction such as for eg

model.geom('geom1').feature('c1').set('r', side);
WITHOUT declaring it as a model.param

it works aparently the same

But in fact it is ALSO more powerful because you can pass more complexmatlab arrays like a list of coordinates, possibly of variable length to build for example a bezier curve whose structure and topology will then possibly evolve

In light of this I fail to understand the necessity of model.param... and why the doc does not mention this possibility of using directy matlab variables directly in comsol expression.

EXCEPT IF THERE IS SOME NON OBVIOUS PITFALL to this approach that i cannot see at the moment.
[I am still Young on my learning curve...]

So my question :

does any of you is aware or have experienced downside in using matlab variables in comsol expression in lieu of, apparently much more restrictive, comsol defined parameters??

needless to say, asmentionned above, that to the best of my knowledge, Comsol doc is mute on this subject... [ but I would love to be proven wrong on that..would make my life easier..]

Thanks,
JF



0 Replies Last Post Oct 4, 2010, 11:35 a.m. EDT
COMSOL Moderator

Hello Jean-Francois Leon

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.