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.

Bug in matlab livelink, 2D cut line 'genpoints'

Please login with a confirmed email address before reporting spam

Hi just want to give a heads up to anyone experiencing problems with retrieving data from a 2D cut-line in matlab.

My objective: To get average air gap magnetic field over one pole span, by using 2D cut-line in the middle of the air gap using livelink-matlab.

Problem: Even though the entire model is defined in [mm], and my entire geometry is successfully built, the points defining the 2D-cutline is for some reason defined as [m], so obviously the result from the 2D cut-line is wrong. This is very difficult to detect, since no error is displayed. Also, if the matlab model is saved and opened in Comsol, the 2D cut-line points will be automatically evaluated as [mm], and give correct results.

This is the commandline in matlab defining the points of the cut-line which is evaluated as [m]:

model.result.dataset('cln1').set('genpoints', {'0' '-g/2'; 'tp*r_avg' '-g/2'});

where 'g' [mm] is my air gap , 'tp' [rad] is my pole span , and 'r_avg' [mm] is average radius. (axial flux PM machine)

The only fix I can find is to do like this:
model.result.dataset('cln1').set('genpoints', {'0' '-g/2000'; 'tp*r_avg/1000' '-g/2000'});

I tried this but did not work:
model.result.dataset('cln1').set('genpoints', {'0[mm]' '-g/2[mm]'; 'tp*r_avg[mm]' '-g/2[mm]'});
model.result.dataset('cln1').set('genpoints', {'0[m]' '-g/2[m]'; 'tp*r_avg[m]' '-g/2[m]'});
model.result.dataset('cln1').set('genpoints', {'0[mm]' '-g/2'; 'tp*r_avg' '-g/2'});


_________
If anyone has any other fix than this, please let me know...

Thx

1 Reply Last Post 2013年6月24日 GMT-4 03:11
Reine Granström COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年6月24日 GMT-4 03:11
Dear Sigbjørn,

Please send your .m file to support@comsol.com so that we can further investigate the behavior.

Best regards,
Reine Granström
COMSOL Support
Dear Sigbjørn, Please send your .m file to support@comsol.com so that we can further investigate the behavior. Best regards, Reine Granström COMSOL Support

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.