Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

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

$
0
0
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

Viewing all articles
Browse latest Browse all 26527

Trending Articles