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.
RF Modal Analyisis + Livelink: ploting other modes.
Posted 2012年2月15日 GMT-5 14:12 RF & Microwave Engineering, Interfacing, Results & Visualization Version 4.2a 1 Reply
Please login with a confirmed email address before reporting spam
Hi to all,
as I've seen in the Livelink for Matlab introduction tutorial, a good way to learn to use Livelink is by saving the comsol file as an .m file and then opening it on the Matlab editor.
So far so good the file ran and finished without any error message. After that, on the Matlab's Command Window I'd executed:
>> mphplot(ans,'pg1')
and I get a beautiful plot of the last mode I'd calculated for the last parameter (parameter sweep for parameter 'M').
Unfortunately, I haven't been able to find a way to plot other modes for the same M (or for another value of M).
At the end of this message I'm including the last lines of my .m file, which I believe are necessary for you to know how I'm storing the solutions.
Cheers,
--
Felipe
(...)
model.sol('sol1').feature('st1').name('Compile Equations: Mode Analysis');
model.sol('sol1').feature('st1').set('studystep', 'mode');
model.sol('sol1').feature('v1').set('control', 'mode');
model.sol('sol1').feature('e1').set('control', 'mode');
model.sol('sol1').feature('e1').set('transform', 'effective_mode_index');
model.sol('sol1').feature('e1').set('shift', 'chute');
model.sol('sol1').feature('e1').feature('aDef').set('complexfun', true);
model.sol('sol1').runAll;
model.batch('p1').set('control', 'param');
model.batch('p1').set('pname', {'M'});
model.batch('p1').set('plist', '{1,0.8}');
model.batch('p1').set('err', true);
model.batch('p1').feature('so1').set('seq', 'sol1');
model.batch('p1').feature('so1').set('psol', 'sol2');
model.batch('p1').feature('so1').set('param', {'"M","1"' '"M","0.8"'});
model.batch('p1').attach('std5');
model.batch('p1').run;
model.result('pg1').name('Electric Field (emw)');
model.result('pg1').set('data', 'dset2');
model.result('pg1').set('solnum', '5');
model.result('pg1').set('outersolnum', '1');
model.result('pg1').feature('surf1').set('unit', '');
out = model;
as I've seen in the Livelink for Matlab introduction tutorial, a good way to learn to use Livelink is by saving the comsol file as an .m file and then opening it on the Matlab editor.
So far so good the file ran and finished without any error message. After that, on the Matlab's Command Window I'd executed:
>> mphplot(ans,'pg1')
and I get a beautiful plot of the last mode I'd calculated for the last parameter (parameter sweep for parameter 'M').
Unfortunately, I haven't been able to find a way to plot other modes for the same M (or for another value of M).
At the end of this message I'm including the last lines of my .m file, which I believe are necessary for you to know how I'm storing the solutions.
Cheers,
--
Felipe
(...)
model.sol('sol1').feature('st1').name('Compile Equations: Mode Analysis');
model.sol('sol1').feature('st1').set('studystep', 'mode');
model.sol('sol1').feature('v1').set('control', 'mode');
model.sol('sol1').feature('e1').set('control', 'mode');
model.sol('sol1').feature('e1').set('transform', 'effective_mode_index');
model.sol('sol1').feature('e1').set('shift', 'chute');
model.sol('sol1').feature('e1').feature('aDef').set('complexfun', true);
model.sol('sol1').runAll;
model.batch('p1').set('control', 'param');
model.batch('p1').set('pname', {'M'});
model.batch('p1').set('plist', '{1,0.8}');
model.batch('p1').set('err', true);
model.batch('p1').feature('so1').set('seq', 'sol1');
model.batch('p1').feature('so1').set('psol', 'sol2');
model.batch('p1').feature('so1').set('param', {'"M","1"' '"M","0.8"'});
model.batch('p1').attach('std5');
model.batch('p1').run;
model.result('pg1').name('Electric Field (emw)');
model.result('pg1').set('data', 'dset2');
model.result('pg1').set('solnum', '5');
model.result('pg1').set('outersolnum', '1');
model.result('pg1').feature('surf1').set('unit', '');
out = model;
1 Reply Last Post 2012年2月16日 GMT-5 08:26