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.
how to assign a value to the application varaibles in matlab script?
Posted 2011年1月27日 GMT-5 23:33 RF & Microwave Engineering, Modeling Tools & Definitions, Parameters, Variables, & Functions, Studies & Solvers Version 3.5a 1 Reply
Please login with a confirmed email address before reporting spam
Hi, guys,
I bulit a RF modle with the wavelength as physical variable. Now I save it as a M-file in matlab. The problem is how can I assign a value to the wavelength?
I wrote it as following (main part), but it did not work.
-----------------------
a = 0.5;
% Application mode 1
clear appl
appl.mode.class = 'InPlaneWaves';
appl.name = 'rfweh';
appl.module = 'RF';
appl.sshape = 2;
appl.assignsuffix = '_rfweh';
clear prop
prop.field='TES';
prop.inputvar='lambda';
appl.prop = prop;
clear bnd
bnd.type = {'SC','cont'};
bnd.ind = [1,1,1,2,1,2,1,2,1,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,2,2,2,2,2, ...
2,2];
appl.bnd = bnd;
clear equ
equ.coordOn = {{1;1},{1;0},{0;1},{0;0},{0;0}};
equ.epsilonr = {1,1,1,1,3};
equ.Stype = {'coord','coord','coord','none','none'};
equ.ind = [1,2,1,3,4,3,1,2,1,5];
appl.equ = equ;
appl.var = {'lambda0','a'};
fem.appl{1} = appl;
fem.frame = {'ref'};
fem.border = 1;
clear units;
units.basesystem = 'SI';
fem.units = units;
---------------------------
But if I change the 'a' to '0.5' in the line appl.var = {'lambda0','a'};, it works.
How can I assign a self-defined variable to the wavelength and bulit a loop using the script language?
Thanks in advance!
I bulit a RF modle with the wavelength as physical variable. Now I save it as a M-file in matlab. The problem is how can I assign a value to the wavelength?
I wrote it as following (main part), but it did not work.
-----------------------
a = 0.5;
% Application mode 1
clear appl
appl.mode.class = 'InPlaneWaves';
appl.name = 'rfweh';
appl.module = 'RF';
appl.sshape = 2;
appl.assignsuffix = '_rfweh';
clear prop
prop.field='TES';
prop.inputvar='lambda';
appl.prop = prop;
clear bnd
bnd.type = {'SC','cont'};
bnd.ind = [1,1,1,2,1,2,1,2,1,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,2,2,2,2,2, ...
2,2];
appl.bnd = bnd;
clear equ
equ.coordOn = {{1;1},{1;0},{0;1},{0;0},{0;0}};
equ.epsilonr = {1,1,1,1,3};
equ.Stype = {'coord','coord','coord','none','none'};
equ.ind = [1,2,1,3,4,3,1,2,1,5];
appl.equ = equ;
appl.var = {'lambda0','a'};
fem.appl{1} = appl;
fem.frame = {'ref'};
fem.border = 1;
clear units;
units.basesystem = 'SI';
fem.units = units;
---------------------------
But if I change the 'a' to '0.5' in the line appl.var = {'lambda0','a'};, it works.
How can I assign a self-defined variable to the wavelength and bulit a loop using the script language?
Thanks in advance!
1 Reply Last Post 2011年1月28日 GMT-5 11:38