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.

a livelink problem for point probe coordinate

Please login with a confirmed email address before reporting spam

I'm testing the livelink version of my COMSOL code as attached. In general, I set two point probes at different locations (e.g. each end of a line). The COMSOL code is runing regardless whether the result is meaningful. But the .m file stops with error.

Somehow there is a bug regarding the following probe definition lines in .m file:

model.result.table('tbl1').name('Probe Table 1');

model.probe('pdom1').set('bndsnap1', true);
model.probe('pdom1').feature('ppb1').set('table', 'tbl1');
model.probe('pdom1').feature('ppb1').set('window', 'window1');
model.probe('pdom2').set('coords1', {'1'});
model.probe('pdom2').feature('ppb2').set('table', 'tbl1');
model.probe('pdom2').feature('ppb2').set('window', 'window1');

The Matlab error information as follow (unrecognized coordinate or units):

??? Java exception occurred:
Exception:
com.comsol.nativeutil.properties.InvalidPropertyValueException:
Invalid property value
Messages:
Invalid property value
- Property: coords1

X is Y#Coordinates#a matrix of real numbers
- : Expected size is 1×1
- : Expected unit is: m.


Anyone has a hint of the correct livelink setting regarding the probe?


3 Replies Last Post 2011年12月17日 GMT-5 07:55
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月5日 GMT-4 07:07
Hi

This looks like a bug in the m-file generation.

This line

model.probe('pdom2').set('coords1', {'1'});

should instead be

model.probe('pdom2').set('coords1', 1);


We will fix this in the next release of Comsol.


--
Lars Gregersen
Comsol Denmark
Hi This looks like a bug in the m-file generation. This line model.probe('pdom2').set('coords1', {'1'}); should instead be model.probe('pdom2').set('coords1', 1); We will fix this in the next release of Comsol. -- Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月6日 GMT-4 22:18

Hi

This looks like a bug in the m-file generation.

This line

model.probe('pdom2').set('coords1', {'1'});

should instead be

model.probe('pdom2').set('coords1', 1);


We will fix this in the next release of Comsol.


--
Lars Gregersen
Comsol Denmark


hi, i encounter the same problem!
...
model.param.set('d_plate', '20');
...
model.probe('pdom1').name('Point_top center plate');
model.probe('pdom1').set('method', 'none');
model.probe('pdom1').set('coords3', {'0' 'd_plate' '0'});
...

??? Undefined function or variable
'd_plate'.

Error in ==> MFT0609 at 626
model.probe('pdom1').set('coords3', {'0' d_plate '0'});
[QUOTE] Hi This looks like a bug in the m-file generation. This line model.probe('pdom2').set('coords1', {'1'}); should instead be model.probe('pdom2').set('coords1', 1); We will fix this in the next release of Comsol. -- Lars Gregersen Comsol Denmark [/QUOTE] hi, i encounter the same problem! ... model.param.set('d_plate', '20'); ... model.probe('pdom1').name('Point_top center plate'); model.probe('pdom1').set('method', 'none'); model.probe('pdom1').set('coords3', {'0' 'd_plate' '0'}); ... ??? Undefined function or variable 'd_plate'. Error in ==> MFT0609 at 626 model.probe('pdom1').set('coords3', {'0' d_plate '0'});

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年12月17日 GMT-5 07:55
Hi Lars,

I am Kenneth from the institute of electrical engineering (IEE), Chinese academy of sciences (CAS).

The attached is my M file,
==========one line code is showing:======
model.param.set('J0', '1[A/m^2]', 'Current density in coil');
==========now, I want to use 3 to replace 1 =======
==========if I input the following code in MATLAB command window,the results is right=======
mod8=model;
mod8.param.set('J0', '3[A/m^2]', 'Current density in coil');
mod8.geom('geom1').run;
mod8.mesh('mesh1').run;
mod8.sol('sol1').runAll;
mod8.result.export('data1').run;
=========but I want to optimise the J0 'value for many times, so I define a variable 'hq' ,but lead to many errors==
mod8.param.set('J0', 'hq[A/m^2]', 'Current density in coil');
mod8.geom('geom1').run;
mod8.mesh('mesh1').run;
mod8.sol('sol1').runAll;
mod8.result.export('data1').run;
=========could you tell me how I can realize my object?=====
Thank you very much!

Kenneth


Hi Lars, I am Kenneth from the institute of electrical engineering (IEE), Chinese academy of sciences (CAS). The attached is my M file, ==========one line code is showing:====== model.param.set('J0', '1[A/m^2]', 'Current density in coil'); ==========now, I want to use 3 to replace 1 ======= ==========if I input the following code in MATLAB command window,the results is right======= mod8=model; mod8.param.set('J0', '3[A/m^2]', 'Current density in coil'); mod8.geom('geom1').run; mod8.mesh('mesh1').run; mod8.sol('sol1').runAll; mod8.result.export('data1').run; =========but I want to optimise the J0 'value for many times, so I define a variable 'hq' ,but lead to many errors== mod8.param.set('J0', 'hq[A/m^2]', 'Current density in coil'); mod8.geom('geom1').run; mod8.mesh('mesh1').run; mod8.sol('sol1').runAll; mod8.result.export('data1').run; =========could you tell me how I can realize my object?===== Thank you very much! Kenneth

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.