From 054483f28db1a47e79c7519327390998ce1cd326 Mon Sep 17 00:00:00 2001 From: Symeon Symeonidis Date: Mon, 30 Apr 2018 17:44:47 +0300 Subject: [PATCH] Symeon Symeonidis --- Examples/MetamaterialUnitCellExample.m | 190 ++++++ Examples/MicrostripExample.m | 143 ++++ Examples/MonopoleExample.m | 98 +++ Examples/MonopoleMultipleMonitors.m | 103 +++ Examples/MonopolesInsideHumanPhantomExample.m | 258 +++++++ Examples/TwoDipolesExample.m | 199 ++++++ Examples/TwoDipolesMuscleExample.m | 245 +++++++ Examples/TwoMonopolesMultipleMonitors.m | 125 ++++ Home/CstActivateLocalWCS.m | 34 + Home/CstDefaultUnits.m | 42 ++ Home/CstDefineBackroundMaterial.m | 97 +++ Home/CstDefineUnits.m | 42 ++ Home/CstMeshInitiator.m | 36 + Home/CstSaveProject.m | 16 + Home/CstTDMMeshSettings.m | 103 +++ LICENSE.txt | 640 ++++++++++++++++++ Materials/CstAir.m | 54 ++ Materials/CstBone.m | 78 +++ Materials/CstCopperAnnealedLossy.m | 65 ++ Materials/CstCopperPureLossy.m | 126 ++++ Materials/CstFR4lossy.m | 51 ++ Materials/CstMuscle.m | 86 +++ Materials/CstRogersTMM10ilossy.m | 51 ++ Materials/CstTeflonPTFElossy.m | 58 ++ Materials/Cstblood.m | 85 +++ Materials/Cstcreatedielectricmaterial.m | 50 ++ Modeling/CstAdd.m | 18 + Modeling/CstAlignWCSwithFace.m | 17 + Modeling/CstAlignWCSwithPoint.m | 17 + Modeling/CstPickEdge.m | 16 + Modeling/CstPickFace.m | 17 + Modeling/CstPickMidPoint.m | 17 + Modeling/CstSphere.m | 31 + Modeling/CstSubtract.m | 18 + Modeling/Cstbrick.m | 38 ++ Modeling/Cstcylinder.m | 56 ++ PostProcessing/CstExportFarfieldSource.m | 82 +++ .../CstExportFarfieldSourceAngleStep.m | 81 +++ .../CstExportFarfieldSourceAngleStepOrigin.m | 87 +++ PostProcessing/CstExportSparametersTXT.m | 23 + PostProcessing/CstExportTouchstone.m | 28 + PostProcessing/farfieldTXTread.m | 26 + Simulation/CstDefineEfieldMonitor.m | 31 + Simulation/CstDefineFarfieldMonitor.m | 31 + Simulation/CstDefineFrequencyRange.m | 31 + Simulation/CstDefineFrequencydomainSolver.m | 122 ++++ Simulation/CstDefineHfieldMonitor.m | 30 + Simulation/CstDefineOpenBoundary.m | 77 +++ Simulation/CstDefineTimedomainSolver.m | 40 ++ Simulation/CstDiscreteFacePort.m | 37 + Simulation/CstDiscretePort.m | 35 + Simulation/CstWaveguidePort.m | 38 ++ 52 files changed, 4119 insertions(+) create mode 100644 Examples/MetamaterialUnitCellExample.m create mode 100644 Examples/MicrostripExample.m create mode 100644 Examples/MonopoleExample.m create mode 100644 Examples/MonopoleMultipleMonitors.m create mode 100644 Examples/MonopolesInsideHumanPhantomExample.m create mode 100644 Examples/TwoDipolesExample.m create mode 100644 Examples/TwoDipolesMuscleExample.m create mode 100644 Examples/TwoMonopolesMultipleMonitors.m create mode 100644 Home/CstActivateLocalWCS.m create mode 100644 Home/CstDefaultUnits.m create mode 100644 Home/CstDefineBackroundMaterial.m create mode 100644 Home/CstDefineUnits.m create mode 100644 Home/CstMeshInitiator.m create mode 100644 Home/CstSaveProject.m create mode 100644 Home/CstTDMMeshSettings.m create mode 100644 LICENSE.txt create mode 100644 Materials/CstAir.m create mode 100644 Materials/CstBone.m create mode 100644 Materials/CstCopperAnnealedLossy.m create mode 100644 Materials/CstCopperPureLossy.m create mode 100644 Materials/CstFR4lossy.m create mode 100644 Materials/CstMuscle.m create mode 100644 Materials/CstRogersTMM10ilossy.m create mode 100644 Materials/CstTeflonPTFElossy.m create mode 100644 Materials/Cstblood.m create mode 100644 Materials/Cstcreatedielectricmaterial.m create mode 100644 Modeling/CstAdd.m create mode 100644 Modeling/CstAlignWCSwithFace.m create mode 100644 Modeling/CstAlignWCSwithPoint.m create mode 100644 Modeling/CstPickEdge.m create mode 100644 Modeling/CstPickFace.m create mode 100644 Modeling/CstPickMidPoint.m create mode 100644 Modeling/CstSphere.m create mode 100644 Modeling/CstSubtract.m create mode 100644 Modeling/Cstbrick.m create mode 100644 Modeling/Cstcylinder.m create mode 100644 PostProcessing/CstExportFarfieldSource.m create mode 100644 PostProcessing/CstExportFarfieldSourceAngleStep.m create mode 100644 PostProcessing/CstExportFarfieldSourceAngleStepOrigin.m create mode 100644 PostProcessing/CstExportSparametersTXT.m create mode 100644 PostProcessing/CstExportTouchstone.m create mode 100644 PostProcessing/farfieldTXTread.m create mode 100644 Simulation/CstDefineEfieldMonitor.m create mode 100644 Simulation/CstDefineFarfieldMonitor.m create mode 100644 Simulation/CstDefineFrequencyRange.m create mode 100644 Simulation/CstDefineFrequencydomainSolver.m create mode 100644 Simulation/CstDefineHfieldMonitor.m create mode 100644 Simulation/CstDefineOpenBoundary.m create mode 100644 Simulation/CstDefineTimedomainSolver.m create mode 100644 Simulation/CstDiscreteFacePort.m create mode 100644 Simulation/CstDiscretePort.m create mode 100644 Simulation/CstWaveguidePort.m diff --git a/Examples/MetamaterialUnitCellExample.m b/Examples/MetamaterialUnitCellExample.m new file mode 100644 index 0000000..d1610d7 --- /dev/null +++ b/Examples/MetamaterialUnitCellExample.m @@ -0,0 +1,190 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +CstDefaultUnits(mws) +ComponentList = 'component1'; + + +CstCopperPureLossy(mws) +CstFR4lossy(mws) + +g = 3; %gap +h = 2.5; %substrate height +l1 = 22; %outer ring width +l2 = 15; %inner ring width +ls = 25; %substrate length +lw = 1.4; %wire width +s = 1.5; %split width +t = 0.17; %thickness +w = 2; %ring width + +Name = 'Substrate'; +component = 'component1'; +material = 'FR-4 (lossy)'; +Xrange = [-ls/2 ls/2]; +Yrange = [-ls/2 ls/2]; +Zrange = [-h 0]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Ring1'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-l1/2 l1/2]; +Yrange = [-l1/2 l1/2]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Cut1'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-(l1/2)+w (l1/2)-w]; +Yrange = [-(l1/2)+w (l1/2)-w]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Ring1'; +component2 = 'component1:Cut1'; +CstSubtract(mws,component1,component2) + +Name = 'Ring1'; +id = 12; +CstPickMidPoint(mws,Name,id) +CstAlignWCSwithPoint(mws) + +Name = 'Cut2'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-g/2 g/2]; +Yrange = [0 w]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Ring1'; +component2 = 'component1:Cut2'; +CstSubtract(mws,component1,component2) + +SetNormal = [0 0 1]; +SetOrigin = [0 0 0]; +SetUVector = [1 0 0]; + +CstActivateLocalWCS(mws, SetNormal, SetOrigin, SetUVector, 0) + +Name = 'Ring2'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-(l1/2)+w+s (l1/2)-w-s]; +Yrange = [-(l1/2)+w+s (l1/2)-w-s]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Cut3'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-(l1/2)+2*w+s (l1/2)-2*w-s]; +Yrange = [-(l1/2)+2*w+s (l1/2)-2*w-s]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Ring2'; +component2 = 'component1:Cut3'; +CstSubtract(mws,component1,component2) + +Name = 'Ring2'; +id = 10; +CstPickMidPoint(mws,Name,id) +CstAlignWCSwithPoint(mws) + +Name = 'Cut4'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-g/2 g/2]; +Yrange = [0 -w]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Ring2'; +component2 = 'component1:Cut4'; +CstSubtract(mws,component1,component2) + + +CstActivateLocalWCS(mws, SetNormal, SetOrigin, SetUVector, 0) + +Name = 'Substrate'; +id = 2; +CstPickFace(mws,Name,id) +CstAlignWCSwithFace(mws) + +Name = 'Wire'; +component = 'component1'; +material = 'Copper (pure)'; +Xrange = [-(lw/2) (lw/2)]; +Yrange = [-(ls/2) (ls/2)]; +Zrange = [0 t]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) +CstActivateLocalWCS(mws, SetNormal, SetOrigin, SetUVector, 0) +CstDefineFrequencyRange(mws,7,13) +CstMeshInitiator(mws) +minfrequency = 7; + +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = ls/2; +ZmaxSpace = ls/2; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +Xmin = 'open'; +Xmax = 'electric'; +Ymin = 'electric'; +Ymax = 'electric'; +Zmin = 'magnetic'; +Zmax = 'magnetic'; +CstDefineOpenBoundary(mws,minfrequency,Xmin,Xmax,Ymin,Ymax,Zmin,Zmax) + + +PortNumber = 1; +Xrange = [-13 -13]; +Yrange = [-13 13]; +Zrange = [-3 0]; +XrangeAdd = [0 0]; +YrangeAdd = [0 0]; +ZrangeAdd = [0 0]; +CstWaveguidePort(mws,PortNumber, Xrange, Yrange, Zrange, XrangeAdd, YrangeAdd, ZrangeAdd, 'Full','xmin') + +PortNumber = 2; +Xrange = [13 13]; +Yrange = [-13 13]; +Zrange = [-3 0]; +XrangeAdd = [0 0]; +YrangeAdd = [0 0]; +ZrangeAdd = [0 0]; +CstWaveguidePort(mws,PortNumber, Xrange, Yrange, Zrange, XrangeAdd, YrangeAdd, ZrangeAdd, 'Full','xmax') + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-40) + + + diff --git a/Examples/MicrostripExample.m b/Examples/MicrostripExample.m new file mode 100644 index 0000000..947545b --- /dev/null +++ b/Examples/MicrostripExample.m @@ -0,0 +1,143 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +CstDefaultUnits(mws) +ComponentList = 'component1'; +CstDefineFrequencyRange(mws,1.5,3.5) +CstMeshInitiator(mws) + +minfrequency = 1.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +CstCopperAnnealedLossy(mws) +CstFR4lossy(mws) + +W = 28.45; +L = 28.45; +Fi = 9; +Wf = 1.137; +Gpf = 1; +Lg = 2*L; +Wg = 2*W; +Ht = 0.035; +Hs = 1.6; + +Name = 'Groundplane'; +component = 'component1'; +material = 'Copper (annealed)'; +Xrange = [-0.5*Wg 0.5*Wg]; +Yrange = [-0.5*Lg 0.5*Lg]; +Zrange = [0 Ht]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Substrate'; +component = 'component1'; +material = 'FR-4 (lossy)'; +Xrange = [-0.5*Wg 0.5*Wg]; +Yrange = [-0.5*Lg 0.5*Lg]; +Zrange = [Ht Ht+Hs]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Patch'; +component = 'component1'; +material = 'Copper (annealed)'; +Xrange = [-W/2 W/2]; +Yrange = [-L/2 L/2]; +Zrange = [Ht+Hs Ht+Hs+Ht]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + + +Name = 'Empty space'; +component = 'component1'; +material = 'Copper (annealed)'; +Xrange = [-((Wf/2)+Gpf) ((Wf/2)+Gpf)]; +Yrange = [-L/2+Fi -L/2]; +Zrange = [Ht+Hs Ht+Hs+Ht]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Patch'; +component2 = 'component1:Empty space'; +CstSubtract(mws,component1,component2) + +Name = 'FeedLine'; +component = 'component1'; +material = 'Copper (annealed)'; +Xrange = [-Wf/2 Wf/2]; +Yrange = [-L/2+Fi -Lg/2]; +Zrange = [Ht+Hs Ht+Hs+Ht]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +component1 = 'component1:Patch'; +component2 = 'component1:FeedLine'; +CstAdd(mws,component1,component2) + +Name = 'Substrate'; +id = 3; +CstPickFace(mws,Name,id) + + +PortNumber = 1; +Xrange = [-36 36]; +Yrange = [-36 -36]; +Zrange = [0.035 1.635]; +XrangeAdd =[3*Wf 3*Wf]; +YrangeAdd =[0 0]; +ZrangeAdd =[Ht+Hs 4*Hs]; +Coordinates = 'Picks'; +Orientation = 'positive'; +CstWaveguidePort(mws,PortNumber, Xrange, Yrange, Zrange, XrangeAdd, YrangeAdd, ZrangeAdd,Coordinates,Orientation) + +for monitorindex = 1.5:0.5:3.5 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineHfieldMonitor(mws,strcat('h-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-40) + +exportpath = '...\cst api\NameofyourFile';%NameofyourFile should be the same with the name of the file of line 133 bellow + +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s1p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = s_params(1,:); +s11 = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +plot(freq,s11); grid on; + + + + + diff --git a/Examples/MonopoleExample.m b/Examples/MonopoleExample.m new file mode 100644 index 0000000..b66d6ce --- /dev/null +++ b/Examples/MonopoleExample.m @@ -0,0 +1,98 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +Geometry = 'mm'; +Frequency = 'GHz'; +Time = 'ns'; +TemperatureUnit = 'Kelvin'; +Voltage = 'V'; +Current = 'A'; +Resistance = 'Ohm'; +Conductance = 'S'; +Capacitance = 'PikoF'; +Inductance = 'NanoH'; + +CstDefineUnits(mws,Geometry, Frequency, Time, TemperatureUnit, Voltage, Current, Resistance, Conductance, Capacitance, Inductance) +CstMeshInitiator(mws) + + +CstDefineFrequencyRange(mws,0.5,4) +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +Name = 'Groundplane'; +component = 'component1'; +material = 'PEC'; +Xrange = [-40 40]; +Yrange = [-40 40]; +Zrange = [0 2]; + +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Conductor'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [8 38]; + +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +PortNumber = 1; +SetP1 = [0 0 2]; +SetP2 = [0 0 8]; + +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + + +monitorindex = 2.25; +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +CstSaveProject(mws) + +CstDefineTimedomainSolver(mws,-30) + + +exportpath = '...\cst api\NameofyourFile';%NameofyourFile should be the same with the name of the file of line 90 bellow + +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s1p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = s_params(1,:); +s11 = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +plot(freq,s11); grid on; + + + diff --git a/Examples/MonopoleMultipleMonitors.m b/Examples/MonopoleMultipleMonitors.m new file mode 100644 index 0000000..715fef7 --- /dev/null +++ b/Examples/MonopoleMultipleMonitors.m @@ -0,0 +1,103 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +Geometry = 'mm'; +Frequency = 'GHz'; +Time = 'ns'; +TemperatureUnit = 'Kelvin'; +Voltage = 'V'; +Current = 'A'; +Resistance = 'Ohm'; +Conductance = 'S'; +Capacitance = 'PikoF'; +Inductance = 'NanoH'; + +CstDefineUnits(mws,Geometry, Frequency, Time, TemperatureUnit, Voltage, Current, Resistance, Conductance, Capacitance, Inductance) +CstMeshInitiator(mws) + + +CstDefineFrequencyRange(mws,0.5,4) +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +Name = 'Groundplane'; +component = 'component1'; +material = 'PEC'; +Xrange = [-40 40]; +Yrange = [-40 40]; +Zrange = [0 2]; + +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Conductor'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [8 38]; + +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +PortNumber = 1; +SetP1 = [0 0 2]; +SetP2 = [0 0 8]; + +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + + + +for monitorindex = 0.5:0.5:4 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-30) + + +exportpath = '...\cst api\NameofyourFile'; %NameofyourFile should be the same with the name of the file of line 93 bellow + +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s1p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = s_params(1,:); +s11 = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +plot(freq,s11); grid on; + +for monitorindex = 0.5:0.5:4 +exportpath = strcat('...\cst api\farff',num2str(monitorindex),'.txt'); +CstExportFarfieldSource(mws, exportpath, monitorindex) +end diff --git a/Examples/MonopolesInsideHumanPhantomExample.m b/Examples/MonopolesInsideHumanPhantomExample.m new file mode 100644 index 0000000..edfdd54 --- /dev/null +++ b/Examples/MonopolesInsideHumanPhantomExample.m @@ -0,0 +1,258 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +Geometry = 'mm'; +Frequency = 'GHz'; +Time = 'ns'; +TemperatureUnit = 'Kelvin'; +Voltage = 'V'; +Current = 'A'; +Resistance = 'Ohm'; +Conductance = 'S'; +Capacitance = 'PikoF'; +Inductance = 'NanoH'; + +CstDefineUnits(mws,Geometry, Frequency, Time, TemperatureUnit, Voltage, Current, Resistance, Conductance, Capacitance, Inductance) + +Name = 'Muscle'; +component = 'component1'; +material = 'Muscle'; +Xrange = [-65 65]; +Yrange = [-77 157.5]; +Zrange = [4.1 80]; +CstMuscle(mws) +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Bone'; +component = 'component1'; +material = 'Bone'; +OuterRadius = 17.5; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 30; +Zrange = [-40 120]; +CstBone(mws) +Cstcylinder(mws, Name, component, material, 'Y', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Muscle'; +component2 = 'component1:Bone'; +CstSubtract(mws,component1,component2) +Cstcylinder(mws, Name, component, material, 'Y', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Coat1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 30; +Zrange = [2.1 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'Coat2'; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +component1 = 'component1:Muscle'; +component2 = 'component1:Coat1'; +CstSubtract(mws,component1,component2) +component1 = 'component1:Bone'; +component2 = 'component1:Coat2'; +CstSubtract(mws,component1,component2) + +Name = 'Coat1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 50; +Zrange = [2.1 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'Coat2'; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Muscle'; +component2 = 'component1:Coat1'; +CstSubtract(mws,component1,component2) +component1 = 'component1:Bone'; +component2 = 'component1:Coat2'; +CstSubtract(mws,component1,component2) + + + +Name = 'Coat1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0.8; +Xcenter = 0; +Ycenter = 30; +Zrange = [2.1 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Coatcap1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 30; +Zrange = [45 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'Coat2'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0.8; +Xcenter = 0; +Ycenter = 50; +Zrange = [2.1 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Coatcap2'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 1.4; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 50; +Zrange = [45 45.2]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Coat1'; +component2 = 'component1:Coatcap1'; +CstAdd(mws,component1,component2) +component1 = 'component1:Coat2'; +component2 = 'component1:Coatcap2'; +CstAdd(mws,component1,component2) + +Name = 'Conductor1'; +component = 'component1'; +material = 'PEC'; +OuterRadius = 0.8; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 30; +Zrange = [2 40]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Conductor2'; +component = 'component1'; +material = 'PEC'; +OuterRadius = 0.8; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 50; +Zrange = [2 40]; +CstTeflonPTFElossy(mws) +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Groundplane1'; +component = 'component1'; +material = 'PEC'; +Xrange = [-40 40]; +Yrange = [-51 39]; +Zrange = [-4 -2]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +Name = 'Groundplane2'; +component = 'component1'; +material = 'PEC'; +Xrange = [-40 40]; +Yrange = [41 129]; +Zrange = [-4 -2]; +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +PortNumber = 1; +SetP1 = [0 50 2]; +SetP2 = [0 50 -2]; +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + + +PortNumber = 2; +SetP1 = [0 30 2]; +SetP2 = [0 30 -2]; +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + +CstDefineFrequencyRange(mws,0.5,4) + +for monitorindex = 0.5:0.5:4 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-30) + +exportpath = '...\cst api\NameofyourFile'; %NameofyourFile should be the same with the name of the file of line 235 bellow +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s2p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = squeeze(s_params(1,:,:)); +spar = spar'; +sdb = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +S11 = sdb(:,1); +S21 = sdb(:,2); +figure +subplot(2,1,1) +plot(freq,S11); grid on; +title('S11') +subplot(2,1,2) +plot(freq,S21); grid on; +title('S21') + +for monitorindex = 0.5:0.5:4 +port = 1; +exportpath = strcat('...\cstapitest\farff1',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +port = 2; +exportpath = strcat('...\cstapitest\farff2',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +end diff --git a/Examples/TwoDipolesExample.m b/Examples/TwoDipolesExample.m new file mode 100644 index 0000000..41c2f47 --- /dev/null +++ b/Examples/TwoDipolesExample.m @@ -0,0 +1,199 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +CstDefaultUnits(mws) +CstMeshInitiator(mws) +ComponentList = 'component1'; +CstCopperAnnealedLossy(mws) + +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +material = 'Copper (annealed)'; +Name = 'Conductor1'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [-30 30]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Conductor2'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 240; +Zrange = [-30 30]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Gap1'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [-5 5]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Gap2'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 240; +Zrange = [-5 5]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +position = 1; +CstPickEdge(mws,'Gap1',position) + +position = 2; +CstPickEdge(mws,'Gap1',position) + +PortNumber = 1; +SetP1 = [1 0 -5]; +SetP2 = [1 0 5]; +CstDiscreteFacePort(mws,PortNumber,SetP1,SetP2) + +position = 1; +CstPickEdge(mws,'Gap2',position) + +position = 2; +CstPickEdge(mws,'Gap2',position) + +PortNumber = 2; +SetP1 = [0 241 -5]; +SetP2 = [0 241 5]; +CstDiscreteFacePort(mws,PortNumber,SetP1,SetP2) +CstTeflonPTFElossy(mws) + +Name = 'Coat1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 1; +Xcenter = 0; +Ycenter = 0; +Zrange = [-30 30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'Coat2'; +Ycenter = 240; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'CoatCap1a'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [-31 -30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'CoatCap1b'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 0; +Zrange = [30 31]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'CoatCap2a'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 240; +Zrange = [-31 -30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'CoatCap2b'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 0; +Ycenter = 240; +Zrange = [30 31]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Coat1'; +component2 = 'component1:CoatCap1a'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat1'; +component2 = 'component1:CoatCap1b'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat2'; +component2 = 'component1:CoatCap2a'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat2'; +component2 = 'component1:CoatCap2b'; +CstAdd(mws,component1,component2) + + +CstDefineFrequencyRange(mws,0.5,4) + +for monitorindex = 0.5:0.5:4 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineHfieldMonitor(mws,strcat('h-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-30) + + +exportpath = '...\cst api\NameofyourFile'; %NameofyourFile should be the same with the name of the file of line 185 bellow +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s2p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = squeeze(s_params(1,:,:)); +spar = spar'; +sdb = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +S11 = sdb(:,1); +S21 = sdb(:,2); +figure +subplot(2,1,1) +plot(freq,S11); grid on; +title('S11') +subplot(2,1,2) +plot(freq,S21); grid on; +title('S21') diff --git a/Examples/TwoDipolesMuscleExample.m b/Examples/TwoDipolesMuscleExample.m new file mode 100644 index 0000000..dcbd57f --- /dev/null +++ b/Examples/TwoDipolesMuscleExample.m @@ -0,0 +1,245 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +CstDefaultUnits(mws) +CstMeshInitiator(mws) +ComponentList = 'component1'; +CstCopperAnnealedLossy(mws) + + +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +Name = 'Muscle'; +component = 'component1'; +material = 'Muscle'; +Xrange = [-90 110]; +Yrange = [-60 60]; +Zrange = [-50 50]; +CstMuscle(mws) +Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +material = 'Copper (annealed)'; +Name = 'Minus1'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [-31 31]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Minus2'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [-31 31]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Muscle'; +component2 = 'component1:Minus1'; +CstSubtract(mws,component1,component2) +component1 = 'component1:Muscle'; +component2 = 'component1:Minus2'; +CstSubtract(mws,component1,component2) + +material = 'Copper (annealed)'; +Name = 'Conductor1'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [-30 30]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Conductor2'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [-30 30]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Gap1'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [-5 5]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Gap2'; +OuterRadius = 1; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [-5 5]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +position = 1; +CstPickEdge(mws,'Gap1',position) + +position = 2; +CstPickEdge(mws,'Gap1',position) + +PortNumber = 1; +SetP1 = [-29 0 -5]; +SetP2 = [-29 0 5]; +CstDiscreteFacePort(mws,PortNumber,SetP1,SetP2) + +position = 1; +CstPickEdge(mws,'Gap2',position) + +position = 2; +CstPickEdge(mws,'Gap2',position) + +PortNumber = 2; +SetP1 = [51 0 -5]; +SetP2 = [51 0 5]; +CstDiscreteFacePort(mws,PortNumber,SetP1,SetP2) +CstTeflonPTFElossy(mws) + +Name = 'Coat1'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 1; +Xcenter = -30; +Ycenter = 0; +Zrange = [-30 30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'Coat2'; +Xcenter = 50; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'CoatCap1a'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [-31 -30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'CoatCap1b'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [30 31]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'CoatCap2a'; +component = 'component1'; +material = 'Teflon (PTFE) (lossy)'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [-31 -30]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + + +Name = 'CoatCap2b'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [30 31]; +Cstcylinder(mws, Name, component, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +component1 = 'component1:Coat1'; +component2 = 'component1:CoatCap1a'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat1'; +component2 = 'component1:CoatCap1b'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat2'; +component2 = 'component1:CoatCap2a'; +CstAdd(mws,component1,component2) + +component1 = 'component1:Coat2'; +component2 = 'component1:CoatCap2b'; +CstAdd(mws,component1,component2) + + +CstDefineFrequencyRange(mws,0.5,4) + +for monitorindex = 0.5:0.5:4 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineHfieldMonitor(mws,strcat('h-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-30) + + +exportpath = '...\cst api\NameofyourFile'; %NameofyourFile should be the same with the name of the file of line 218 bellow +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s2p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = squeeze(s_params(1,:,:)); +spar = spar'; +sdb = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +S11 = sdb(:,1); +S21 = sdb(:,2); +figure +subplot(2,1,1) +plot(freq,S11); grid on; +title('S11') +subplot(2,1,2) +plot(freq,S21); grid on; +title('S21') + +StepTheta = 0.25; +StepPhi = 0.25; +matrixindex = 1; + +for monitorindex = 0.5:0.5:4 +port = 1; +exportpath = strcat('...\cstapitest\farff1',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +port = 2; +exportpath = strcat('...\cstapitest\farff2',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +end diff --git a/Examples/TwoMonopolesMultipleMonitors.m b/Examples/TwoMonopolesMultipleMonitors.m new file mode 100644 index 0000000..1fb6941 --- /dev/null +++ b/Examples/TwoMonopolesMultipleMonitors.m @@ -0,0 +1,125 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +addpath('...\Home'); +addpath('...\Materials'); +addpath('...\Modeling'); +addpath('...\PostProcessing'); +addpath('...\Simulation'); +addpath('...\cst api'); +addpath('..\cstapitest'); + +cst = actxserver('CSTStudio.application'); +mws = cst.invoke('NewMWS'); + +CstDefaultUnits(mws) +CstMeshInitiator(mws) +ComponentList = 'component1'; +CstCopperAnnealedLossy(mws) + +minfrequency = 0.5; +x='expanded open'; +CstDefineOpenBoundary(mws,minfrequency,x,x,x,x,x,x) +XminSpace = 0; +XmaxSpace = 0; +YminSpace = 0; +YmaxSpace = 0; +ZminSpace = 0; +ZmaxSpace = 0; +CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) + +Name = 'Groundplane1'; +material = 'Copper (annealed)'; +Xrange = [-60 0]; +Yrange = [-30 30]; +Zrange = [0 2]; +Cstbrick(mws, Name, ComponentList, material, Xrange, Yrange, Zrange) + +Name = 'Groundplane2'; +material = 'Copper (annealed)'; +Xrange = [20 80]; +Yrange = [-30 30]; +Zrange = [0 2]; +Cstbrick(mws, Name, ComponentList, material, Xrange, Yrange, Zrange) + +Name = 'Conductor1'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = -30; +Ycenter = 0; +Zrange = [8 38]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +Name = 'Conductor2'; +OuterRadius = 2; +InnerRadius = 0; +Xcenter = 50; +Ycenter = 0; +Zrange = [8 38]; +Cstcylinder(mws, Name, ComponentList, material, 'Z', OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +PortNumber = 1; +SetP1 = [-30 0 2]; +SetP2 = [-30 0 8]; +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + +PortNumber = 2; +SetP1 = [50 0 2]; +SetP2 = [50 0 8]; +CstDiscretePort(mws,PortNumber,SetP1,SetP2) + +CstDefineFrequencyRange(mws,0.5,4) + +for monitorindex = 0.5:0.5:4 +CstDefineEfieldMonitor(mws,strcat('e-field', num2str(monitorindex)), monitorindex) +CstDefineHfieldMonitor(mws,strcat('h-field', num2str(monitorindex)), monitorindex) +CstDefineFarfieldMonitor(mws,strcat('Farfield',num2str(monitorindex)), monitorindex) +end + + +CstSaveProject(mws) +CstDefineTimedomainSolver(mws,-30) + +exportpath = '...\cst api\NameofyourFile'; %NameofyourFile should be the same with the name of the file of line 97 bellow +format = 'db'; + +CstExportTouchstone(mws,exportpath, format) +data = read(rfdata.data,'NameofyourFile.s2p'); +freq = data.Freq; +s_params = extract(data,'S_PARAMETERS',50); +spar = squeeze(s_params(1,:,:)); +spar = spar'; +sdb = 20*log10(sqrt(real(spar).^2 + imag(spar).^2)); +S11 = sdb(:,1); +S21 = sdb(:,2); +figure +subplot(2,1,1) +plot(freq,S11); grid on; +title('S11') +subplot(2,1,2) +plot(freq,S21); grid on; +title('S21') + +StepTheta = 1; +StepPhi = 1; +matrixindex = 1; + +for monitorindex = 0.5:0.5:4 +port = 1; +exportpath = strcat('...\cstapitest\farff1',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +port = 2; +exportpath = strcat('...\cstapitest\farff2',num2str(monitorindex),'.txt'); +CstExportFarfieldSourceAngleStep(mws,exportpath,monitorindex,port,StepTheta,StepPhi) +end + diff --git a/Home/CstActivateLocalWCS.m b/Home/CstActivateLocalWCS.m new file mode 100644 index 0000000..738fe71 --- /dev/null +++ b/Home/CstActivateLocalWCS.m @@ -0,0 +1,34 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstActivateLocalWCS(mws, SetNormal, SetOrigin, SetUVector, Activate) + +%SetNormal = [0 0 1] +%SetOrigin = [0 0 0] +%SetUVector = [1 0 0] +%Activate = 1 or 0; + + +if Activate == 1 +WCS = invoke(mws,'WCS'); +invoke(WCS,'ActivateWCS','local'); +invoke(WCS,'SetNormal',num2str(SetNormal(1)),num2str(SetNormal(2)),num2str(SetNormal(3))); +invoke(WCS,'SetOrigin',num2str(SetOrigin(1)),num2str(SetOrigin(2)),num2str(SetOrigin(3))); +invoke(WCS,'SetUVector',num2str(SetUVector(1)),num2str(SetUVector(2)),num2str(SetUVector(3))); +end +if Activate == 0 + WCS = invoke(mws,'WCS'); + invoke(WCS,'ActivateWCS','Global'); +end + + +end \ No newline at end of file diff --git a/Home/CstDefaultUnits.m b/Home/CstDefaultUnits.m new file mode 100644 index 0000000..2423569 --- /dev/null +++ b/Home/CstDefaultUnits.m @@ -0,0 +1,42 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefaultUnits(mws) + +%define units (Default selection) +Geometry = 'mm'; +Frequency = 'GHz'; +Time = 'ns'; +TemperatureUnit = 'Kelvin'; +Voltage = 'V'; +Current = 'A'; +Resistance = 'Ohm'; +Conductance = 'S'; +Capacitance = 'PikoF'; +Inductance = 'NanoH'; + +Units = invoke(mws,'Units'); +invoke(Units,'Geometry',Geometry); +invoke(Units,'Frequency',Frequency); +invoke(Units,'Time',Time); +invoke(Units,'TemperatureUnit',TemperatureUnit); +invoke(Units,'Voltage',Voltage); +invoke(Units,'Current',Current); +invoke(Units,'Resistance',Resistance); +invoke(Units,'Conductance',Conductance); +invoke(Units,'Capacitance',Capacitance); +invoke(Units,'Inductance',Inductance); + +end + + + diff --git a/Home/CstDefineBackroundMaterial.m b/Home/CstDefineBackroundMaterial.m new file mode 100644 index 0000000..27cfc88 --- /dev/null +++ b/Home/CstDefineBackroundMaterial.m @@ -0,0 +1,97 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineBackroundMaterial(mws,XminSpace,XmaxSpace, YminSpace, YmaxSpace, ZminSpace, ZmaxSpace) +%'@ define background +%Normaly the values are: +% XminSpace = 0; +% XmaxSpace = 0; +% YminSpace = 0; +% YmaxSpace = 0; +% ZminSpace = 0; +% ZmaxSpace = 0; +Background = invoke(mws,'Background'); +invoke(Background,'ResetBackground'); +invoke(Background,'XminSpace',num2str(XminSpace)); +invoke(Background,'XmaxSpace',num2str(XmaxSpace)); +invoke(Background,'YminSpace',num2str(YminSpace)); +invoke(Background,'YmaxSpace',num2str(YmaxSpace)); +invoke(Background,'ZminSpace',num2str(ZminSpace)); +invoke(Background,'ZmaxSpace',num2str(ZmaxSpace)); +invoke(Background,'ApplyInAllDirections','False'); + +material = invoke(mws,'Material'); +invoke(material,'Reset'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'MaterialUnit','Frequency','Hz'); +invoke(material,'MaterialUnit','Geometry','m'); +invoke(material,'MaterialUnit','Time','s'); +invoke(material,'MaterialUnit','Temperature','Kelvin'); +invoke(material,'Epsilon','1.0'); +invoke(material,'Mue','1.0'); +invoke(material,'Sigma','0.0'); +invoke(material,'TanD','0.0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstSigma'); +invoke(material,'EnableUserConstTanDModelOrderEps','False'); +invoke(material,'ConstTanDModelOrderEps','1'); +invoke(material,'SetElParametricConductivity','False'); +invoke(material,'ReferenceCoordSystem','Global'); +invoke(material,'CoordSystemType','Cartesian'); +invoke(material,'SigmaM','0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstSigma'); + + +invoke(material,'EnableUserConstTanDModelOrderMue','False'); +invoke(material,'ConstTanDModelOrderMue','1'); +invoke(material,'SetMagParametricConductivity','False'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'MaximalOrderNthModelFitEps','10'); +invoke(material,'ErrorLimitNthModelFitEps','0.1'); +invoke(material,'UseOnlyDataInSimFreqRangeNthModelEps','False'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'MaximalOrderNthModelFitMue','10'); + + +invoke(material,'ErrorLimitNthModelFitMue','0.1'); +invoke(material,'UseOnlyDataInSimFreqRangeNthModelMue','False'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'NLAnisotropy','False'); +invoke(material,'NLAStackingFactor','1'); +invoke(material,'NLADirectionX','1'); +invoke(material,'NLADirectionY','0'); +invoke(material,'NLADirectionZ','0'); +invoke(material,'Rho','0.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.0'); +invoke(material,'HeatCapacity','0.0'); +invoke(material,'MetabolicRate','0'); +invoke(material,'BloodFlow','0'); +invoke(material,'VoxelConvection','0'); +invoke(material,'MechanicsType','Unused'); +invoke(material,'Colour','0.6','0.6','0.6'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','True'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'ChangeBackgroundMaterial'); + +end diff --git a/Home/CstDefineUnits.m b/Home/CstDefineUnits.m new file mode 100644 index 0000000..b828348 --- /dev/null +++ b/Home/CstDefineUnits.m @@ -0,0 +1,42 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineUnits(mws,Geometry, Frequency, Time, TemperatureUnit, Voltage, Current, Resistance, Conductance, Capacitance, Inductance) + +% define units +% Geometry = 'mm' +% Frequency = 'GHz' +% Time = 'ns' +% TemperatureUnit = 'Kelvin' +% Voltage = 'V' +% Current = 'A' +% Resistance = 'Ohm' +% Conductance = 'S' +% Capacitance = 'PikoF' +% Inductance = 'NanoH' + +Units = invoke(mws,'Units'); +invoke(Units,'Geometry',Geometry); +invoke(Units,'Frequency',Frequency); +invoke(Units,'Time',Time); +invoke(Units,'TemperatureUnit',TemperatureUnit); +invoke(Units,'Voltage',Voltage); +invoke(Units,'Current',Current); +invoke(Units,'Resistance',Resistance); +invoke(Units,'Conductance',Conductance); +invoke(Units,'Capacitance',Capacitance); +invoke(Units,'Inductance',Inductance); + +end + + + diff --git a/Home/CstMeshInitiator.m b/Home/CstMeshInitiator.m new file mode 100644 index 0000000..9785d96 --- /dev/null +++ b/Home/CstMeshInitiator.m @@ -0,0 +1,36 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstMeshInitiator(mws) + +%' switch on FD-TET setting for accurate farfields + + +FDSolver = invoke(mws,'FDSolver'); +invoke(FDSolver,'ExtrudeOpenBC','True'); + +Mesh = invoke(mws,'Mesh'); +invoke(Mesh,'FPBAAvoidNonRegUnite','True'); +invoke(Mesh,'ConsiderSpaceForLowerMeshLimit','False'); +invoke(Mesh,'MinimumStepNumber','5'); + +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings, 'SetMeshType','Hex'); +invoke(MeshSettings, 'Set','RatioLimitGeometry','20'); +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings, 'SetMeshType','HexTLM'); +invoke(MeshSettings, 'Set','RatioLimitGeometry','20'); + +PostProcess1D = invoke(mws,'PostProcess1D'); +invoke(PostProcess1D,'ActivateOperation','vswr','true'); +invoke(PostProcess1D,'ActivateOperation','yz-matrices','true'); +end \ No newline at end of file diff --git a/Home/CstSaveProject.m b/Home/CstSaveProject.m new file mode 100644 index 0000000..28052a8 --- /dev/null +++ b/Home/CstSaveProject.m @@ -0,0 +1,16 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstSaveProject(mws) + +mws.invoke('saveas','project1.cst','false'); +end \ No newline at end of file diff --git a/Home/CstTDMMeshSettings.m b/Home/CstTDMMeshSettings.m new file mode 100644 index 0000000..833fb6e --- /dev/null +++ b/Home/CstTDMMeshSettings.m @@ -0,0 +1,103 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstTDMMeshSettings(mws, CellsPerWavelenth, MinimumCell) + +%'@ set mesh properties (Hexahedral) +Mesh = invoke(mws,'Mesh'); +invoke(Mesh,'MeshType','PBA'); +invoke(Mesh,'SetCreator','High Frequency'); + +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings,'SetMeshType','Hex'); +invoke(MeshSettings,'Set','Version','1%'); + + +%'MAX CELL - WAVELENGTH REFINEMENT +invoke(MeshSettings,'Set','StepsPerWaveNear',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','StepsPerWaveFar',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','WavelengthRefinementSameAsNear','1'); +%'MAX CELL - GEOMETRY REFINEMENT +invoke(MeshSettings,'Set','StepsPerBoxNear',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','StepsPerBoxFar',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','MaxStepNear',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','MaxStepFar',num2str(CellsPerWavelenth)); +invoke(MeshSettings,'Set','ModelBoxDescrNear','maxedge'); +invoke(MeshSettings,'Set','ModelBoxDescrFar','maxedge'); +invoke(MeshSettings,'Set','UseMaxStepAbsolute','0'); +invoke(MeshSettings,'Set','GeometryRefinementSameAsNear','1'); +%'MIN CELL +invoke(MeshSettings,'Set','UseRatioLimitGeometry','1'); +invoke(MeshSettings,'Set','RatioLimitGeometry',num2str(MinimumCell)); +invoke(MeshSettings,'Set','MinStepGeometryX','0'); +invoke(MeshSettings,'Set','MinStepGeometryY','0'); +invoke(MeshSettings,'Set','MinStepGeometryZ','0'); +invoke(MeshSettings,'Set','UseSameMinStepGeometryXYZ','1'); + +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings,'SetMeshType','Hex'); +invoke(MeshSettings,'Set','FaceRefinementOn','0'); +invoke(MeshSettings,'Set','FaceRefinementPolicy','2'); +invoke(MeshSettings,'Set','FaceRefinementRatio','2'); +invoke(MeshSettings,'Set','FaceRefinementStep','0'); +invoke(MeshSettings,'Set','FaceRefinementNSteps','2'); +invoke(MeshSettings,'Set','EllipseRefinementOn','0'); +invoke(MeshSettings,'Set','EllipseRefinementPolicy','2'); +invoke(MeshSettings,'Set','EllipseRefinementRatio','2'); +invoke(MeshSettings,'Set','EllipseRefinementStep','0'); +invoke(MeshSettings,'Set','EllipseRefinementNSteps','2'); +invoke(MeshSettings,'Set','FaceRefinementBufferLines','3'); +invoke(MeshSettings,'Set','EdgeRefinementOn','1'); +invoke(MeshSettings,'Set','EdgeRefinementPolicy','1'); +invoke(MeshSettings,'Set','EdgeRefinementRatio','2'); +invoke(MeshSettings,'Set','EdgeRefinementStep','0'); +invoke(MeshSettings,'Set','EdgeRefinementBufferLines','3'); +invoke(MeshSettings,'Set','RefineEdgeMaterialGlobal','0'); +invoke(MeshSettings,'Set','RefineAxialEdgeGlobal','0'); +invoke(MeshSettings,'Set','BufferLinesNear','3'); +invoke(MeshSettings,'Set','UseDielectrics','1'); +invoke(MeshSettings,'Set','EquilibrateOn','0'); +invoke(MeshSettings,'Set','Equilibrate','1.5'); +invoke(MeshSettings,'Set','IgnoreThinPanelMaterial','0'); + +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings,'SetMeshType','Hex'); +invoke(MeshSettings,'Set','SnapToAxialEdges','1'); +invoke(MeshSettings,'Set','SnapToPlanes','1'); +invoke(MeshSettings,'Set','SnapToSpheres','1'); +invoke(MeshSettings,'Set','SnapToEllipses','1'); +invoke(MeshSettings,'Set','SnapToCylinders','1'); +invoke(MeshSettings,'Set','SnapToCylinderCenters','1'); +invoke(MeshSettings,'Set','SnapToEllipseCenters','1'); + + +Discretizer = invoke(mws,'Discretizer'); +invoke(Discretizer,'MeshType','PBA'); +invoke(Discretizer,'PBAType','Fast PBA'); +invoke(Discretizer,'AutomaticPBAType','True'); +invoke(Discretizer,'FPBAAccuracyEnhancement','enable'); +invoke(Discretizer,'ConnectivityCheck','False'); +invoke(Discretizer,'ConvertGeometryDataAfterMeshing','True'); +invoke(Discretizer,'UsePecEdgeModel','True'); +invoke(Discretizer,'GapDetection','False'); +invoke(Discretizer,'FPBAGapTolerance','1e-3'); +invoke(Discretizer,'SetMaxParallelMesherThreads','Hex','12'); +invoke(Discretizer,'SetParallelMesherMode','Hex','Maximum'); +invoke(Discretizer,'PointAccEnhancement','0'); +invoke(Discretizer,'UseSplitComponents','True'); +invoke(Discretizer,'EnableSubgridding','False'); +invoke(Discretizer,'PBAFillLimit','99'); +invoke(Discretizer,'AlwaysExcludePec','False'); +end + + + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..a71cf1e --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,640 @@ + + Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos + simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + + + + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + \ No newline at end of file diff --git a/Materials/CstAir.m b/Materials/CstAir.m new file mode 100644 index 0000000..8a0c435 --- /dev/null +++ b/Materials/CstAir.m @@ -0,0 +1,54 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstAir(mws) + + +material = invoke(mws,'Material'); +invoke(material,'Reset'); +invoke(material,'Name','Air'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','1.00059'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','0'); +invoke(material,'TanD','0.0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstKappa'); +invoke(material,'KappaM','0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstKappa'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); + + +invoke(material,'DispersiveFittingSchemeEps','General 1st'); +invoke(material,'DispersiveFittingSchemeMue','General 1st'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'Rho','1.204'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.026'); +invoke(material,'HeatCapacity','1.005'); +invoke(material,'SetActiveMaterial','all'); + +invoke(material,'Colour','0.682353','0.717647','1'); +invoke(material,'Wireframe','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); + +end \ No newline at end of file diff --git a/Materials/CstBone.m b/Materials/CstBone.m new file mode 100644 index 0000000..17f498c --- /dev/null +++ b/Materials/CstBone.m @@ -0,0 +1,78 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstBone(mws) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Bone'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','1'); +invoke(material,'Mue','1'); +invoke(material,'Sigma','0.0'); +invoke(material,'TanD','0.0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderEps','1'); +invoke(material,'ReferenceCoordSystem','Global'); +invoke(material,'CoordSystemType','Cartesian'); +invoke(material,'SigmaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderMue','1'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'MaximalOrderNthModelFitEps','3'); +invoke(material,'ErrorLimitNthModelFitEps','0.01'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'AddDispersionFittingValueEps','0.1', '15.2825690817463', '11.5605196735103', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.422222222222222', '13.0968478993582', '3.97291789963244', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.744444444444444', '12.611927560421', '3.02791834284726', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.06666666666667', '12.3066675707889', '2.76772128756326', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.38888888888889', '12.0593003418143', '2.71071331604512', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.71111111111111', '11.8385069451693', '2.7344343025119', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.03333333333333', '11.6327384184551', '2.79398485794209', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.35555555555556', '11.4368765403937', '2.86945816308061', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.67777777777778', '11.2483898509305', '2.95097838294358', '1.0'); +invoke(material,'UseGeneralDispersionEps','True'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'NLAnisotropy','False'); +invoke(material,'NLAStackingFactor','1'); +invoke(material,'NLADirectionX','1'); +invoke(material,'NLADirectionY','0'); +invoke(material,'NLADirectionZ','0'); +invoke(material,'Rho','1850'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.41'); +invoke(material,'HeatCapacity','1.3'); +invoke(material,'SetActiveMaterial','all'); +invoke(material,'MechanicsType','Isotropic'); +invoke(material,'YoungsModulus','10'); +invoke(material,'MetabolicRate','610'); +invoke(material,'BloodFlow','3400'); +invoke(material,'VoxelConvection','0'); +invoke(material,'Colour','0.862745','0.862745','0.862745'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','False'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end + \ No newline at end of file diff --git a/Materials/CstCopperAnnealedLossy.m b/Materials/CstCopperAnnealedLossy.m new file mode 100644 index 0000000..198fae1 --- /dev/null +++ b/Materials/CstCopperAnnealedLossy.m @@ -0,0 +1,65 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function CstCopperAnnealedLossy(mws) +%'@ define material: Copper (annealed) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Copper (annealed)'); +invoke(material,'FrqType','static'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','Hz','mm'); +invoke(material,'Epsilon','1'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','5.8e+007'); +invoke(material,'TanD','0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstTanD'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Lossy metal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','5.8e+007'); +invoke(material,'Rho','8930.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','401.0'); +invoke(material,'HeatCapacity','0.39'); +invoke(material,'MetabolicRate','0'); +invoke(material,'BloodFlow','0'); +invoke(material,'VoxelConvection','0'); +invoke(material,'MechanicsType','Isotropic'); +invoke(material,'YoungsModulus','120'); +invoke(material,'PoissonsRatio','0.33'); +invoke(material,'ThermalExpansionRate','17'); +invoke(material,'Colour','1','1','0'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','True'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end diff --git a/Materials/CstCopperPureLossy.m b/Materials/CstCopperPureLossy.m new file mode 100644 index 0000000..f8e1cf7 --- /dev/null +++ b/Materials/CstCopperPureLossy.m @@ -0,0 +1,126 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function CstCopperPureLossy(mws) +%'@ define material: Copper (pure) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Copper (pure)'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Lossy metal'); +invoke(material,'MaterialUnit', 'Frequency', 'GHz'); +invoke(material,'MaterialUnit','Geometry','mm'); +invoke(material,'MaterialUnit','Time','s'); +invoke(material,'MaterialUnit','Temperature','Kelvin'); +invoke(material,'Mue','1.0'); +invoke(material,'Sigma','5.96e+007'); +invoke(material,'Rho','8930.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','401.0'); +invoke(material,'HeatCapacity','0.39'); +invoke(material,'MetabolicRate','0'); +invoke(material,'BloodFlow','0'); +invoke(material,'VoxelConvection','0'); +invoke(material,'MechanicsType','Isotropic'); +invoke(material,'YoungsModulus','120'); +invoke(material,'PoissonsRatio','0.33'); +invoke(material,'ThermalExpansionRate','17'); +invoke(material,'ReferenceCoordSystem','Global'); +invoke(material,'CoordSystemType','Cartesian'); +invoke(material,'NLAnisotropy','False'); +invoke(material,'NLAStackingFactor','1'); +invoke(material,'NLADirectionX','1'); +invoke(material,'NLADirectionY','0'); +invoke(material,'NLADirectionZ','0'); +invoke(material,'ParticleProperty','SecondaryEmission'); +invoke(material,'SeModel','Furman'); +invoke(material,'SeVaughan','175','2.25','0','1.0','7.5'); +invoke(material,'SePlot1D','True','0','100','0','1000'); +invoke(material,'SeMaxSecondaries','10'); +invoke(material,'SeTsParam_T1','0.66'); +invoke(material,'SeTsParam_T2','0.80'); +invoke(material,'SeTsParam_T3','0.70'); +invoke(material,'SeTsParam_T4','1.00'); +invoke(material,'SeTsParam_SEY','2.25'); +invoke(material,'SeTsParam_Energy','175'); +invoke(material,'SeTsParam_S','1.33'); +invoke(material,'SeTsParam_PN','0','1.6'); +invoke(material,'SeTsParam_PN','1','2.0'); +invoke(material,'SeTsParam_PN','2','1.8'); +invoke(material,'SeTsParam_PN','3','4.7'); +invoke(material,'SeTsParam_PN','4','1.8'); +invoke(material,'SeTsParam_PN','5','2.4'); +invoke(material,'SeTsParam_PN','6','1.8'); +invoke(material,'SeTsParam_PN','7','1.8'); +invoke(material,'SeTsParam_PN','8','2.3'); +invoke(material,'SeTsParam_PN','9','1.8'); +invoke(material,'SeTsParam_EpsN','0','3.90'); +invoke(material,'SeTsParam_EpsN','1','6.20'); +invoke(material,'SeTsParam_EpsN','2','13.00'); +invoke(material,'SeTsParam_EpsN','3','8.80'); +invoke(material,'SeTsParam_EpsN','4','6.25'); +invoke(material,'SeTsParam_EpsN','5','2.25'); +invoke(material,'SeTsParam_EpsN','6','9.20'); +invoke(material,'SeTsParam_EpsN','7','5.30'); +invoke(material,'SeTsParam_EpsN','8','17.80'); +invoke(material,'SeTsParam_EpsN','9','10.00'); +invoke(material,'SeRdParam_R','1.0'); +invoke(material,'SeRdParam_R1','0.26'); +invoke(material,'SeRdParam_R2','2.0'); +invoke(material,'SeRdParam_Q','0.4'); +invoke(material,'SeRdParam_P1Inf','0.01'); +invoke(material,'SeRdParam_Energy','40.0'); +invoke(material,'SeBsParam_Sigma','1.9'); +invoke(material,'SeBsParam_E1','0.26'); +invoke(material,'SeBsParam_E2','2.0'); +invoke(material,'SeBsParam_P1Hat','0.02'); +invoke(material,'SeBsParam_P1Inf','0.01'); +invoke(material,'SeBsParam_Energy','0.0'); +invoke(material,'SeBsParam_P','0.9'); +invoke(material,'SeBsParam_W','100.0'); + + + +invoke(material,'FrqType','static'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','Hz','mm'); +invoke(material,'Epsilon','1'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','5.96e+007'); + +invoke(material,'TanD','0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstTanD'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); + +invoke(material,'Colour','1','1','0'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','True'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end diff --git a/Materials/CstFR4lossy.m b/Materials/CstFR4lossy.m new file mode 100644 index 0000000..cca59c4 --- /dev/null +++ b/Materials/CstFR4lossy.m @@ -0,0 +1,51 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function CstFR4lossy(mws) + +%'@ define material: FR-4 (lossy) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','FR-4 (lossy)'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','4.3'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','0.0'); +invoke(material,'TanD','0.025'); +invoke(material,'TanDFreq','10.0'); +invoke(material,'TanDGiven','True'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstKappa'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','General 1st'); +invoke(material,'DispersiveFittingSchemeMue','General 1st'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'Rho','0.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.3'); +invoke(material,'SetActiveMaterial','all'); +invoke(material,'Colour','0.94','0.82','0.76'); +invoke(material,'Wireframe','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end \ No newline at end of file diff --git a/Materials/CstMuscle.m b/Materials/CstMuscle.m new file mode 100644 index 0000000..b409a2a --- /dev/null +++ b/Materials/CstMuscle.m @@ -0,0 +1,86 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function CstMuscle(mws) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Muscle'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','1'); +invoke(material,'Mue','1'); +invoke(material,'Sigma','0.0'); +invoke(material,'TanD','0.0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderEps','1'); +invoke(material,'ReferenceCoordSystem','Global'); +invoke(material,'CoordSystemType','Cartesian'); +invoke(material,'SigmaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderMue','1'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'MaximalOrderNthModelFitEps','3'); +invoke(material,'ErrorLimitNthModelFitEps','0.01'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'AddDispersionFittingValueEps','0.1', '65.9724916504545', '127.192797239797', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.2', '60.2280314197783', '66.7852481428503', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.3', '58.2010632452303', '46.1678385280381', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.4', '57.1286659331816', '35.7847612362403', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.422222222222222', '56.9527716128403', '34.1456274103791', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.5', '56.4454886710024', '29.5676459467637', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.6', '55.9594825719793', '25.4598232248452', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.7', '55.5870383230944', '22.5688659080254', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.744444444444444', '55.4460666146869', '21.5480357567376', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.8', '55.2857933341328', '20.4441081345782', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.9', '55.0319456602686', '18.8331012626125', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.06666666666667', '54.6774425815976', '16.9010535749291', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.38888888888889', '54.1285131484409', '14.7095990740045', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.71111111111111', '53.6680496124579', '13.5891943396758', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.03333333333333', '53.2476410075004', '13.0261988069251', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.35555555555556', '52.8455894055116', '12.7858457903486', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.67777777777778', '52.4509933654632', '12.74554913806', '1.0'); +invoke(material,'AddDispersionFittingValueEps','3', '52.057997686553', '12.8350615969651', '1.0'); +invoke(material,'UseGeneralDispersionEps','True'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'NLAnisotropy','False'); +invoke(material,'NLAStackingFactor','1'); +invoke(material,'NLADirectionX','1'); +invoke(material,'NLADirectionY','0'); +invoke(material,'NLADirectionZ','0'); +invoke(material,'Rho','1041'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.53'); +invoke(material,'HeatCapacity','3.546'); +invoke(material,'MetabolicRate','480'); +invoke(material,'BloodFlow','2700'); +invoke(material,'VoxelConvection','0'); +invoke(material,'MechanicsType','Unused'); +invoke(material,'Colour','0.784314','0.470588','0.470588'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','False'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end + \ No newline at end of file diff --git a/Materials/CstRogersTMM10ilossy.m b/Materials/CstRogersTMM10ilossy.m new file mode 100644 index 0000000..12fcc3b --- /dev/null +++ b/Materials/CstRogersTMM10ilossy.m @@ -0,0 +1,51 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstRogersTMM10ilossy(mws) +% Rogers TMM 10i (lossy) + + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Rogers TMM 10i (lossy)'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','9.8'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','0.0'); +invoke(material,'TanD','0.002'); +invoke(material,'TanDFreq','10.0'); +invoke(material,'TanDGiven','True'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstKappa'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','General 1st'); +invoke(material,'DispersiveFittingSchemeMue','General 1st'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'Rho','0.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.76'); +invoke(material,'ThermalType','Normal'); +invoke(material,'SetActiveMaterial','all'); +invoke(material,'Colour','0.94','0.82','0.76'); +invoke(material,'Wireframe','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end \ No newline at end of file diff --git a/Materials/CstTeflonPTFElossy.m b/Materials/CstTeflonPTFElossy.m new file mode 100644 index 0000000..f780a63 --- /dev/null +++ b/Materials/CstTeflonPTFElossy.m @@ -0,0 +1,58 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function CstTeflonPTFElossy(mws) + +%'@ define material: Teflon (PTFE) (lossy) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Teflon (PTFE) (lossy)'); +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','2.1'); +invoke(material,'Mue','1.0'); +invoke(material,'Kappa','0.0'); +invoke(material,'TanD','0.0002'); +invoke(material,'TanDFreq','10.0'); +invoke(material,'TanDGiven','True'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstKappa'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','General 1st'); +invoke(material,'DispersiveFittingSchemeMue','General 1st'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'Rho','2200.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.2'); +invoke(material,'HeatCapacity','1.0'); +invoke(material,'SetActiveMaterial','all'); +invoke(material,'MechanicsType','Isotropic'); +invoke(material,'YoungsModulus','0.5'); +invoke(material,'PoissonsRatio','0.4'); +invoke(material,'ThermalExpansionRate','140'); +invoke(material,'Colour','0.94','0.82','0.76'); +invoke(material,'Wireframe','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end + + diff --git a/Materials/Cstblood.m b/Materials/Cstblood.m new file mode 100644 index 0000000..b21c866 --- /dev/null +++ b/Materials/Cstblood.m @@ -0,0 +1,85 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function Cstblood(mws) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name','Blood'); %Blood +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon','1'); +invoke(material,'Mue','1'); +invoke(material,'Sigma','0.0'); +invoke(material,'TanD','0.0'); +invoke(material,'TanDFreq','0.0'); +invoke(material,'TanDGiven','False'); +invoke(material,'TanDModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderEps','1'); +invoke(material,'ReferenceCoordSystem','Global'); +invoke(material,'CoordSystemType','Cartesian'); +invoke(material,'SigmaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstSigma'); +invoke(material,'ConstTanDModelOrderMue','1'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','Nth Order'); +invoke(material,'MaximalOrderNthModelFitEps','3'); +invoke(material,'ErrorLimitNthModelFitEps','0.01'); +invoke(material,'DispersiveFittingSchemeMue','Nth Order'); +invoke(material,'AddDispersionFittingValueEps','0.1', '76.8182454443825', '221.641134494173', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.2', '68.4738432550289', '115.059990632458', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.3', '65.6502510183341', '78.8589515742776', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.4', '64.1828321718796', '60.6489945539656', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.422222222222222', '63.9438618885212', '57.7730434712015', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.5', '63.257247554219', '49.7333267655039', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.6', '62.6027643145963', '42.5001241802731', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.7', '62.1030699559808', '37.3865932409505', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.744444444444444', '61.9142639813766', '35.5731389635495', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.8', '61.6997719763589', '33.6053481035262', '1.0'); +invoke(material,'AddDispersionFittingValueEps','0.9', '61.3602871921475', '30.7161644656542', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.06666666666667', '60.8862780821185', '27.206610582395', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.38888888888889', '60.1510807057843', '23.0953297030954', '1.0'); +invoke(material,'AddDispersionFittingValueEps','1.71111111111111', '59.5320763343363', '20.8376504484609', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.03333333333333', '58.9648498262843', '19.545237054196', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.35555555555556', '58.4208755792015', '18.8129113591261', '1.0'); +invoke(material,'AddDispersionFittingValueEps','2.67777777777778', '57.8860468115685', '18.4294319222186', '1.0'); +invoke(material,'AddDispersionFittingValueEps','3', '57.3529593274927', '18.4294319222186', '1.0'); +invoke(material,'UseGeneralDispersionEps','True'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'NLAnisotropy','False'); +invoke(material,'NLAStackingFactor','1'); +invoke(material,'NLADirectionX','1'); +invoke(material,'NLADirectionY','0'); +invoke(material,'NLADirectionZ','0'); +invoke(material,'Rho','1060'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity','0.51'); +invoke(material,'HeatCapacity','3.824'); +invoke(material,'MetabolicRate','0'); +invoke(material,'BloodFlow','1e+006'); +invoke(material,'VoxelConvection','0'); +invoke(material,'MechanicsType','Unused'); +invoke(material,'Colour','1','0','0'); +invoke(material,'Wireframe','False'); +invoke(material,'Reflection','False'); +invoke(material,'Allowoutline','False'); +invoke(material,'Transparentoutline','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end + \ No newline at end of file diff --git a/Materials/Cstcreatedielectricmaterial.m b/Materials/Cstcreatedielectricmaterial.m new file mode 100644 index 0000000..ab343c4 --- /dev/null +++ b/Materials/Cstcreatedielectricmaterial.m @@ -0,0 +1,50 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + + +function Cstcreatedielectricmaterial(mws, Name, Epsilon, Mue, TanD, ThermalConductivity) + +material = invoke(mws,'material'); +invoke(material,'Reset'); +invoke(material,'Name',Name); % Rogers TMM 10i (lossy) +invoke(material,'FrqType','all'); +invoke(material,'Type','Normal'); +invoke(material,'SetMaterialUnit','GHz','mm'); +invoke(material,'Epsilon',int2str(Epsilon)); +invoke(material,'Mue',int2str(Mue)); +invoke(material,'Kappa','0.0'); +invoke(material,'TanD',int2str(TanD)); +invoke(material,'TanDFreq','10.0'); +invoke(material,'TanDGiven','True'); +invoke(material,'TanDModel','ConstTanD'); +invoke(material,'KappaM','0.0'); +invoke(material,'TanDM','0.0'); +invoke(material,'TanDMFreq','0.0'); +invoke(material,'TanDMGiven','False'); +invoke(material,'TanDMModel','ConstKappa'); +invoke(material,'DispModelEps','None'); +invoke(material,'DispModelMue','None'); +invoke(material,'DispersiveFittingSchemeEps','General 1st'); +invoke(material,'DispersiveFittingSchemeMue','General 1st'); +invoke(material,'UseGeneralDispersionEps','False'); +invoke(material,'UseGeneralDispersionMue','False'); +invoke(material,'Rho','0.0'); +invoke(material,'ThermalType','Normal'); +invoke(material,'ThermalConductivity',int2str(ThermalConductivity)); +invoke(material,'ThermalType','Normal'); +invoke(material,'SetActiveMaterial','all'); +invoke(material,'Colour','0.94','0.82','0.76'); +invoke(material,'Wireframe','False'); +invoke(material,'Transparency','0'); +invoke(material,'Create'); +release(material); +end \ No newline at end of file diff --git a/Modeling/CstAdd.m b/Modeling/CstAdd.m new file mode 100644 index 0000000..71a44dc --- /dev/null +++ b/Modeling/CstAdd.m @@ -0,0 +1,18 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstAdd(mws,component1,component2) + +Solid = invoke(mws,'Solid'); +invoke(Solid,'Add',component1,component2); + +end \ No newline at end of file diff --git a/Modeling/CstAlignWCSwithFace.m b/Modeling/CstAlignWCSwithFace.m new file mode 100644 index 0000000..5ceaa8c --- /dev/null +++ b/Modeling/CstAlignWCSwithFace.m @@ -0,0 +1,17 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstAlignWCSwithFace(mws) + +WCS = invoke(mws,'WCS'); +invoke(WCS,'AlignWCSWithSelected','Face'); +end \ No newline at end of file diff --git a/Modeling/CstAlignWCSwithPoint.m b/Modeling/CstAlignWCSwithPoint.m new file mode 100644 index 0000000..40b04f9 --- /dev/null +++ b/Modeling/CstAlignWCSwithPoint.m @@ -0,0 +1,17 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstAlignWCSwithPoint(mws) + +WCS = invoke(mws,'WCS'); +invoke(WCS,'AlignWCSWithSelected','Point'); +end diff --git a/Modeling/CstPickEdge.m b/Modeling/CstPickEdge.m new file mode 100644 index 0000000..886963e --- /dev/null +++ b/Modeling/CstPickEdge.m @@ -0,0 +1,16 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstPickEdge(mws,ComponentName,position) +Pick = invoke(mws,'Pick'); +invoke(Pick,'PickEdgeFromId',strcat('component1:',ComponentName),num2str(position),num2str(position)); +end \ No newline at end of file diff --git a/Modeling/CstPickFace.m b/Modeling/CstPickFace.m new file mode 100644 index 0000000..e4e100c --- /dev/null +++ b/Modeling/CstPickFace.m @@ -0,0 +1,17 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstPickFace(mws,Name,id) + +Pick = invoke(mws,'Pick'); +invoke(Pick,'PickFaceFromId',strcat('component1:',Name),num2str(id)); +end \ No newline at end of file diff --git a/Modeling/CstPickMidPoint.m b/Modeling/CstPickMidPoint.m new file mode 100644 index 0000000..3d8f538 --- /dev/null +++ b/Modeling/CstPickMidPoint.m @@ -0,0 +1,17 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstPickMidPoint(mws,Name,id) + +Pick = invoke(mws,'Pick'); +invoke(Pick,'PickMidpointFromId',strcat('component1:',Name),num2str(id)); +end \ No newline at end of file diff --git a/Modeling/CstSphere.m b/Modeling/CstSphere.m new file mode 100644 index 0000000..1edae15 --- /dev/null +++ b/Modeling/CstSphere.m @@ -0,0 +1,31 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstSphere(mws, Name, component, material, Axis, CenterRadius, TopRadius, BottomRadius, Center) + + +%'@ define sphere +% Axis is a string +Sphere = invoke(mws,'Sphere'); +invoke(Sphere,'Reset'); +invoke(Sphere,'Name', Name); +invoke(Sphere,'Component', component); +invoke(Sphere,'Material', material); +invoke(Sphere,'Axis', Axis); +invoke(Sphere,'CenterRadius', num2str(CenterRadius)); +invoke(Sphere,'TopRadius', num2str(TopRadius)); +invoke(Sphere,'BottomRadius', num2str(BottomRadius)); +invoke(Sphere,'Center', num2str(Center(1)), num2str(Center(2)), num2str(Center(3))); +invoke(Sphere,'Segments', '0'); +invoke(Sphere,'Create'); + +end \ No newline at end of file diff --git a/Modeling/CstSubtract.m b/Modeling/CstSubtract.m new file mode 100644 index 0000000..939fcb0 --- /dev/null +++ b/Modeling/CstSubtract.m @@ -0,0 +1,18 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstSubtract(mws,component1,component2) + +Solid = invoke(mws,'Solid'); +invoke(Solid,'Subtract',component1,component2); + +end \ No newline at end of file diff --git a/Modeling/Cstbrick.m b/Modeling/Cstbrick.m new file mode 100644 index 0000000..9eaaf52 --- /dev/null +++ b/Modeling/Cstbrick.m @@ -0,0 +1,38 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function Cstbrick(mws, Name, component, material, Xrange, Yrange, Zrange) + +% Create a brick +% Name = Name of the brick (String) 'Solid1' +% component = component list (String) 'component1' +% material = 'PEC' or 'Vaccumm' otherwise you have to call the function of +% the material you want to use before this one +% Xrange, Yrange, Zrange = starting and finishing range e.g. [0 10] (integers) + +brick = invoke(mws,'Brick'); +invoke(brick,'Reset'); +invoke(brick,'Name',Name); +invoke(brick,'component',component); +invoke(brick,'Material',material); + + +invoke(brick,'Xrange',int2str(Xrange(1)),int2str(Xrange(2))); +invoke(brick,'Yrange',int2str(Yrange(1)),int2str(Yrange(2))); +invoke(brick,'Zrange',int2str(Zrange(1)),int2str(Zrange(2))); + + +invoke(brick,'Create'); + +release(brick); + +end \ No newline at end of file diff --git a/Modeling/Cstcylinder.m b/Modeling/Cstcylinder.m new file mode 100644 index 0000000..1b0931f --- /dev/null +++ b/Modeling/Cstcylinder.m @@ -0,0 +1,56 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function Cstcylinder(mws, Name, component, material, Axis, OuterRadius, InnerRadius, Xcenter, Ycenter, Zrange) + +% Create a cylinder +% Name = Name of the cylinder (String) 'Solid1' +% component = component list (String) 'component1' +% material = 'PEC' or 'Vaccumm' otherwise you have to call the function of +% the material you want to use before this one +% Axis is a string e.g. 'Z' +% OuterRadius, InnerRadius, Xcenter, Ycenter are integers +% Zrange = starting and finishing range e.g. [0 10] (integers) + +cylinder = invoke(mws,'Cylinder'); +invoke(cylinder,'Reset'); +invoke(cylinder,'Name',Name); +invoke(cylinder,'component',component); +invoke(cylinder,'Material',material); +invoke(cylinder,'Axis',Axis); + +invoke(cylinder,'OuterRadius',int2str(OuterRadius)); +invoke(cylinder,'InnerRadius',int2str(InnerRadius)); + +if Axis =='Z' +invoke(cylinder,'Xcenter',int2str(Xcenter)); +invoke(cylinder,'Ycenter',int2str(Ycenter)); +invoke(cylinder,'Zrange',int2str(Zrange(1)),int2str(Zrange(2))); +elseif Axis =='X' +invoke(cylinder,'Ycenter',int2str(Ycenter)); +invoke(cylinder,'Zcenter',int2str(Xcenter)); +invoke(cylinder,'Xrange',int2str(Zrange(1)),int2str(Zrange(2))); +elseif Axis =='Y' +invoke(cylinder,'Xcenter',int2str(Xcenter)); +invoke(cylinder,'Zcenter',int2str(Ycenter)); +invoke(cylinder,'Yrange',int2str(Zrange(1)),int2str(Zrange(2))); +end + + + + +invoke(cylinder,'Create'); + + +release(cylinder); + +end \ No newline at end of file diff --git a/PostProcessing/CstExportFarfieldSource.m b/PostProcessing/CstExportFarfieldSource.m new file mode 100644 index 0000000..18e5046 --- /dev/null +++ b/PostProcessing/CstExportFarfieldSource.m @@ -0,0 +1,82 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstExportFarfieldSource(mws,exportpath, frequency) + +FarfieldPlot = invoke(mws,'FarfieldPlot'); +invoke(FarfieldPlot,'Plottype','3D'); + +invoke(FarfieldPlot,'Vary','angle2'); + +invoke(FarfieldPlot,'Theta','90'); +invoke(FarfieldPlot,'Phi','90'); +invoke(FarfieldPlot,'Step','5'); +invoke(FarfieldPlot,'Step2','5'); + +invoke(FarfieldPlot,'SetLockSteps','False'); + +invoke(FarfieldPlot,'SetPlotRangeOnly','False'); +invoke(FarfieldPlot,'SetThetaStart','0'); +invoke(FarfieldPlot,'SetThetaEnd','180'); +invoke(FarfieldPlot,'SetPhiStart','0'); +invoke(FarfieldPlot,'SetPhiEnd','360'); +invoke(FarfieldPlot,'SetTheta360','False'); +invoke(FarfieldPlot,'SymmetricRange','False'); +invoke(FarfieldPlot,'SetTimeDomainFF','False'); +invoke(FarfieldPlot,'SetFrequency',num2str(frequency)); +invoke(FarfieldPlot,'SetTime','0'); +invoke(FarfieldPlot,'SetColorByValue','True'); +invoke(FarfieldPlot,'DrawStepLines','False'); +invoke(FarfieldPlot,'DrawIsoLongitudeLatitudeLines','False'); +invoke(FarfieldPlot,'ShowStructure','False'); +invoke(FarfieldPlot,'SetStructureTransparent','False'); +invoke(FarfieldPlot,'SetFarfieldTransparent','False'); +invoke(FarfieldPlot,'SetSpecials','enablepolarextralines'); +invoke(FarfieldPlot,'SetPlotMode','Efield'); +invoke(FarfieldPlot,'Distance','1'); +invoke(FarfieldPlot,'UseFarfieldApproximation','True'); +invoke(FarfieldPlot,'SetScaleLinear','True'); +invoke(FarfieldPlot,'SetLogRange','40'); +invoke(FarfieldPlot,'SetLogNorm','0'); +invoke(FarfieldPlot,'DBUnit','0'); +invoke(FarfieldPlot,'EnableFixPlotMaximum','False'); +invoke(FarfieldPlot,'SetFixPlotMaximumValue','1'); +invoke(FarfieldPlot,'SetInverseAxialRatio','False'); +invoke(FarfieldPlot,'SetAxesType','user'); +invoke(FarfieldPlot,'SetAntennaType','unknown'); +invoke(FarfieldPlot,'Phistart','1.000000e+000','0.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'Thetastart','0.000000e+000','0.000000e+000','1.000000e+000'); +invoke(FarfieldPlot,'PolarizationVector','0.000000e+000','1.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'SetCoordinateSystemType','spherical'); +invoke(FarfieldPlot,'SetAutomaticCoordinateSystem','True'); +invoke(FarfieldPlot,'SetPolarizationType','Linear'); +invoke(FarfieldPlot,'SlantAngle', '0.000000e+000'); +invoke(FarfieldPlot,'Origin','bbox'); +invoke(FarfieldPlot,'Userorigin','0.000000e+000','0.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'SetUserDecouplingPlane','False'); +invoke(FarfieldPlot,'UseDecouplingPlane','False'); +invoke(FarfieldPlot,'DecouplingPlaneAxis','X'); +invoke(FarfieldPlot,'DecouplingPlanePosition','0.000000e+000'); +invoke(FarfieldPlot,'LossyGround','False'); +invoke(FarfieldPlot,'GroundEpsilon','1'); +invoke(FarfieldPlot,'GroundKappa','0'); +invoke(FarfieldPlot,'EnablePhaseCenterCalculation','False'); +invoke(FarfieldPlot,'SetPhaseCenterAngularLimit','3.000000e+001'); +invoke(FarfieldPlot,'SetPhaseCenterComponent','boresight'); +invoke(FarfieldPlot,'SetPhaseCenterPlane','both'); +invoke(FarfieldPlot,'ShowPhaseCenter','True'); +invoke(FarfieldPlot,'StoreSettings'); +SelectTreeItem = invoke(mws,'SelectTreeItem',char(strcat('Farfields\Farfield',num2str(frequency),strcat({' '}, '[1]')))); +invoke(FarfieldPlot,'ASCIIExportAsSource', exportpath); +end + + \ No newline at end of file diff --git a/PostProcessing/CstExportFarfieldSourceAngleStep.m b/PostProcessing/CstExportFarfieldSourceAngleStep.m new file mode 100644 index 0000000..52253e5 --- /dev/null +++ b/PostProcessing/CstExportFarfieldSourceAngleStep.m @@ -0,0 +1,81 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstExportFarfieldSourceAngleStep(mws,exportpath, frequency,port,StepTheta,StepPhi) + +FarfieldPlot = invoke(mws,'FarfieldPlot'); +invoke(FarfieldPlot,'Plottype','3D'); +invoke(FarfieldPlot,'Vary','angle1'); +invoke(FarfieldPlot,'Theta','90'); +invoke(FarfieldPlot,'Phi','90'); +invoke(FarfieldPlot,'Step',num2str(StepTheta)); +invoke(FarfieldPlot,'Step2',num2str(StepPhi)); +invoke(FarfieldPlot,'SetLockSteps','False'); +invoke(FarfieldPlot,'SetPlotRangeOnly','False'); +invoke(FarfieldPlot,'SetThetaStart','0'); +invoke(FarfieldPlot,'SetThetaEnd','180'); +invoke(FarfieldPlot,'SetPhiStart','0'); +invoke(FarfieldPlot,'SetPhiEnd','360'); +invoke(FarfieldPlot,'SetTheta360','False'); +invoke(FarfieldPlot,'SymmetricRange','False'); +invoke(FarfieldPlot,'SetTimeDomainFF','False'); +invoke(FarfieldPlot,'SetFrequency',num2str(frequency)); +invoke(FarfieldPlot,'SetTime','0'); +invoke(FarfieldPlot,'SetColorByValue','True'); +invoke(FarfieldPlot,'DrawStepLines','False'); +invoke(FarfieldPlot,'DrawIsoLongitudeLatitudeLines','False'); +invoke(FarfieldPlot,'ShowStructure','False'); +invoke(FarfieldPlot,'SetStructureTransparent','False'); +invoke(FarfieldPlot,'SetFarfieldTransparent','False'); +invoke(FarfieldPlot,'SetSpecials','enablepolarextralines'); +invoke(FarfieldPlot,'SetPlotMode','Efield'); +invoke(FarfieldPlot,'Distance','1'); +invoke(FarfieldPlot,'UseFarfieldApproximation','True'); +invoke(FarfieldPlot,'SetScaleLinear','True'); +invoke(FarfieldPlot,'SetLogRange','40'); +invoke(FarfieldPlot,'SetLogNorm','0'); +invoke(FarfieldPlot,'DBUnit','0'); +invoke(FarfieldPlot,'EnableFixPlotMaximum','False'); +invoke(FarfieldPlot,'SetFixPlotMaximumValue','1'); +invoke(FarfieldPlot,'SetInverseAxialRatio','False'); +invoke(FarfieldPlot,'SetAxesType','user'); +invoke(FarfieldPlot,'SetAntennaType','unknown'); +invoke(FarfieldPlot,'Phistart','1.000000e+000','0.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'Thetastart','0.000000e+000','0.000000e+000','1.000000e+000'); +invoke(FarfieldPlot,'PolarizationVector','0.000000e+000','1.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'SetCoordinateSystemType','spherical'); +invoke(FarfieldPlot,'SetAutomaticCoordinateSystem','True'); +invoke(FarfieldPlot,'SetPolarizationType','Linear'); +invoke(FarfieldPlot,'SlantAngle', '0.000000e+000'); + + +invoke(FarfieldPlot,'Origin','bbox'); + +invoke(FarfieldPlot,'Userorigin','0.000000e+000','0.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'SetUserDecouplingPlane','False'); +invoke(FarfieldPlot,'UseDecouplingPlane','False'); +invoke(FarfieldPlot,'DecouplingPlaneAxis','X'); +invoke(FarfieldPlot,'DecouplingPlanePosition','0.000000e+000'); +invoke(FarfieldPlot,'LossyGround','False'); +invoke(FarfieldPlot,'GroundEpsilon','1'); +invoke(FarfieldPlot,'GroundKappa','0'); +invoke(FarfieldPlot,'EnablePhaseCenterCalculation','False'); +invoke(FarfieldPlot,'SetPhaseCenterAngularLimit','3.000000e+001'); +invoke(FarfieldPlot,'SetPhaseCenterComponent','boresight'); +invoke(FarfieldPlot,'SetPhaseCenterPlane','both'); +invoke(FarfieldPlot,'ShowPhaseCenter','True'); +invoke(FarfieldPlot,'StoreSettings'); +SelectTreeItem = invoke(mws,'SelectTreeItem',char(strcat('Farfields\Farfield',num2str(frequency),strcat({' '}, strcat('[',num2str(port),']'))))); +invoke(FarfieldPlot,'ASCIIExportAsSource', exportpath); +end + + \ No newline at end of file diff --git a/PostProcessing/CstExportFarfieldSourceAngleStepOrigin.m b/PostProcessing/CstExportFarfieldSourceAngleStepOrigin.m new file mode 100644 index 0000000..6925438 --- /dev/null +++ b/PostProcessing/CstExportFarfieldSourceAngleStepOrigin.m @@ -0,0 +1,87 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstExportFarfieldSourceAngleStepOrigin(mws,exportpath, frequency,port,StepTheta,StepPhi,Origin,Position) + +FarfieldPlot = invoke(mws,'FarfieldPlot'); +invoke(FarfieldPlot,'Plottype','3D'); +invoke(FarfieldPlot,'Vary','angle1'); +invoke(FarfieldPlot,'Theta','90'); +invoke(FarfieldPlot,'Phi','90'); +invoke(FarfieldPlot,'Step',num2str(StepTheta)); +invoke(FarfieldPlot,'Step2',num2str(StepPhi)); +invoke(FarfieldPlot,'SetLockSteps','False'); +invoke(FarfieldPlot,'SetPlotRangeOnly','False'); +invoke(FarfieldPlot,'SetThetaStart','0'); +invoke(FarfieldPlot,'SetThetaEnd','180'); +invoke(FarfieldPlot,'SetPhiStart','0'); +invoke(FarfieldPlot,'SetPhiEnd','360'); +invoke(FarfieldPlot,'SetTheta360','False'); +invoke(FarfieldPlot,'SymmetricRange','False'); +invoke(FarfieldPlot,'SetTimeDomainFF','False'); +invoke(FarfieldPlot,'SetFrequency',num2str(frequency)); +invoke(FarfieldPlot,'SetTime','0'); +invoke(FarfieldPlot,'SetColorByValue','True'); +invoke(FarfieldPlot,'DrawStepLines','False'); +invoke(FarfieldPlot,'DrawIsoLongitudeLatitudeLines','False'); +invoke(FarfieldPlot,'ShowStructure','False'); +invoke(FarfieldPlot,'SetStructureTransparent','False'); +invoke(FarfieldPlot,'SetFarfieldTransparent','False'); +invoke(FarfieldPlot,'SetSpecials','enablepolarextralines'); +invoke(FarfieldPlot,'SetPlotMode','Efield'); +invoke(FarfieldPlot,'Distance','1'); +invoke(FarfieldPlot,'UseFarfieldApproximation','True'); +invoke(FarfieldPlot,'SetScaleLinear','True'); +invoke(FarfieldPlot,'SetLogRange','40'); +invoke(FarfieldPlot,'SetLogNorm','0'); +invoke(FarfieldPlot,'DBUnit','0'); +invoke(FarfieldPlot,'EnableFixPlotMaximum','False'); +invoke(FarfieldPlot,'SetFixPlotMaximumValue','1'); +invoke(FarfieldPlot,'SetInverseAxialRatio','False'); +invoke(FarfieldPlot,'SetAxesType','user'); +invoke(FarfieldPlot,'SetAntennaType','unknown'); +invoke(FarfieldPlot,'Phistart','1.000000e+000','0.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'Thetastart','0.000000e+000','0.000000e+000','1.000000e+000'); +invoke(FarfieldPlot,'PolarizationVector','0.000000e+000','1.000000e+000','0.000000e+000'); +invoke(FarfieldPlot,'SetCoordinateSystemType','spherical'); +invoke(FarfieldPlot,'SetAutomaticCoordinateSystem','True'); +invoke(FarfieldPlot,'SetPolarizationType','Linear'); +invoke(FarfieldPlot,'SlantAngle', '0.000000e+000'); + +if isequal(Origin,'bbox') +invoke(FarfieldPlot,'Origin','bbox'); +invoke(FarfieldPlot,'Userorigin','0.000000e+000','0.000000e+000','0.000000e+000'); +end +if isequal(Origin,'free') +invoke(FarfieldPlot,'Origin','free'); +invoke(FarfieldPlot,'Userorigin',num2str(Position(1)),num2str(Position(2)),num2str(Position(3))); +end + + +invoke(FarfieldPlot,'SetUserDecouplingPlane','False'); +invoke(FarfieldPlot,'UseDecouplingPlane','False'); +invoke(FarfieldPlot,'DecouplingPlaneAxis','X'); +invoke(FarfieldPlot,'DecouplingPlanePosition','0.000000e+000'); +invoke(FarfieldPlot,'LossyGround','False'); +invoke(FarfieldPlot,'GroundEpsilon','1'); +invoke(FarfieldPlot,'GroundKappa','0'); +invoke(FarfieldPlot,'EnablePhaseCenterCalculation','False'); +invoke(FarfieldPlot,'SetPhaseCenterAngularLimit','3.000000e+001'); +invoke(FarfieldPlot,'SetPhaseCenterComponent','boresight'); +invoke(FarfieldPlot,'SetPhaseCenterPlane','both'); +invoke(FarfieldPlot,'ShowPhaseCenter','True'); +invoke(FarfieldPlot,'StoreSettings'); +SelectTreeItem = invoke(mws,'SelectTreeItem',char(strcat('Farfields\Farfield',num2str(frequency),strcat({' '}, strcat('[',num2str(port),']'))))); +invoke(FarfieldPlot,'ASCIIExportAsSource', exportpath); +end + + \ No newline at end of file diff --git a/PostProcessing/CstExportSparametersTXT.m b/PostProcessing/CstExportSparametersTXT.m new file mode 100644 index 0000000..5b69c41 --- /dev/null +++ b/PostProcessing/CstExportSparametersTXT.m @@ -0,0 +1,23 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstExportSparametersTXT(mws, exportpath) + +SelectTreeItem = invoke(mws,'SelectTreeItem','1D Results\S-Parameters\S1,1'); +ASCIIExport = invoke(mws,'ASCIIExport'); +invoke(ASCIIExport,'Reset'); +invoke(ASCIIExport,'SetVersion','2010'); +invoke(ASCIIExport,'FileName',exportpath); +invoke(ASCIIExport,'Execute'); + +end + diff --git a/PostProcessing/CstExportTouchstone.m b/PostProcessing/CstExportTouchstone.m new file mode 100644 index 0000000..d4eb527 --- /dev/null +++ b/PostProcessing/CstExportTouchstone.m @@ -0,0 +1,28 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstExportTouchstone(mws,exportpath,format) + + +% format: use 'db', 'ri' or 'ma' +TOUCHSTONE = invoke(mws,'TOUCHSTONE'); +invoke(TOUCHSTONE,'Reset'); +invoke(TOUCHSTONE,'FileName',exportpath); +invoke(TOUCHSTONE,'Impedance','50'); +invoke(TOUCHSTONE,'Format',format); +invoke(TOUCHSTONE,'FrequencyRange','full'); +invoke(TOUCHSTONE,'Renormalize','True'); +invoke(TOUCHSTONE,'UseARResults','False'); +invoke(TOUCHSTONE,'SetNSamples','1001'); +invoke(TOUCHSTONE,'Write'); + +end \ No newline at end of file diff --git a/PostProcessing/farfieldTXTread.m b/PostProcessing/farfieldTXTread.m new file mode 100644 index 0000000..dfd3b0c --- /dev/null +++ b/PostProcessing/farfieldTXTread.m @@ -0,0 +1,26 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +function [combinedff] = farfieldTXTread(port,monitorindex) + +fid = fopen(strcat('farff',num2str(port),num2str(monitorindex),'.txt')); +scannedff = textscan(fid, '%f %f %f %f %f %f', 'Delimiter','Whitespace','HeaderLines',31); +fclose(fid); + +farfield = cell2mat(scannedff); + +farfield(:,4) = farfield(:,4)*1j; +farfield(:,6) = farfield(:,6)*1j; + +combinedff = [farfield(:,1) farfield(:,2) sum(farfield(:,3:4),2) sum(farfield(:,5:6),2)]; + + +end \ No newline at end of file diff --git a/Simulation/CstDefineEfieldMonitor.m b/Simulation/CstDefineEfieldMonitor.m new file mode 100644 index 0000000..fbee0f6 --- /dev/null +++ b/Simulation/CstDefineEfieldMonitor.m @@ -0,0 +1,31 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineEfieldMonitor(mws,Efieldname, frequency) + +%'@ define monitor: e-field (f=2.25) +% Efieldname is a string + +Monitor = invoke(mws,'Monitor'); +invoke(Monitor,'Reset'); +invoke(Monitor,'Name',Efieldname); +invoke(Monitor,'Dimension','Volume'); +invoke(Monitor,'Domain','Frequency'); +invoke(Monitor,'FieldType','Efield'); +invoke(Monitor,'Frequency',num2str(frequency)); +invoke(Monitor,'UseSubvolume','False'); +invoke(Monitor,'SetSubvolume','-53.310273111111', '53.310273111111', '-53.310273111111', '53.310273111111', '-33.310273111111', '71.310273111111'); +invoke(Monitor,'Create'); + + +end + diff --git a/Simulation/CstDefineFarfieldMonitor.m b/Simulation/CstDefineFarfieldMonitor.m new file mode 100644 index 0000000..ae370ef --- /dev/null +++ b/Simulation/CstDefineFarfieldMonitor.m @@ -0,0 +1,31 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineFarfieldMonitor(mws,Farfieldname, frequency) + +%'@ define farfield monitor: farfield (f=2.25) + +% Farfieldname is a string + +Monitor = invoke(mws,'Monitor'); +invoke(Monitor,'Reset'); +invoke(Monitor,'Name',Farfieldname); +invoke(Monitor,'Domain','Frequency'); +invoke(Monitor,'FieldType','Farfield'); +invoke(Monitor,'Frequency',num2str(frequency)); +invoke(Monitor,'UseSubvolume','False'); +invoke(Monitor,'ExportFarfieldSource','False'); +invoke(Monitor,'SetSubvolume','-53.310273111111', '53.310273111111', '-53.310273111111', '53.310273111111', '-33.310273111111', '71.310273111111'); +invoke(Monitor,'Create'); + + +end \ No newline at end of file diff --git a/Simulation/CstDefineFrequencyRange.m b/Simulation/CstDefineFrequencyRange.m new file mode 100644 index 0000000..1cdd0c0 --- /dev/null +++ b/Simulation/CstDefineFrequencyRange.m @@ -0,0 +1,31 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineFrequencyRange(mws,frange1,frange2) + + +%'@ define frequency range + +Solver = invoke(mws,'Solver'); + +invoke(Solver,'FrequencyRange',num2str(frange1),num2str(frange2)); +MeshSettings = invoke(mws,'MeshSettings'); +invoke(MeshSettings, 'SetMeshType','Hex'); +invoke(MeshSettings, 'Set','Version','1%'); +Mesh = invoke(mws,'Mesh'); +invoke(Mesh, 'MeshType','PBA'); + + +end + + + diff --git a/Simulation/CstDefineFrequencydomainSolver.m b/Simulation/CstDefineFrequencydomainSolver.m new file mode 100644 index 0000000..a4ea5ca --- /dev/null +++ b/Simulation/CstDefineFrequencydomainSolver.m @@ -0,0 +1,122 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineFrequencydomainSolver(mws) + + + +ChangeSolverType = invoke(mws,'ChangeSolverType','HF Frequency Domain'); + + + +%'@ define frequency domain solver parameters +Mesh = invoke(mws,'Mesh'); +invoke(Mesh,'SetCreator','High Frequency'); +FDSolver = invoke(mws,'FDSolver'); +invoke(FDSolver,'Reset'); +invoke(FDSolver,'SetMethod','Hexahedral','General purpose'); +invoke(FDSolver,'OrderTet','Second'); +invoke(FDSolver,'OrderSrf','First'); +invoke(FDSolver,'Stimulation','All','1'); +invoke(FDSolver,'ResetExcitationList'); +invoke(FDSolver,'AutoNormImpedance','False'); +invoke(FDSolver,'NormingImpedance','50'); +invoke(FDSolver,'ModesOnly','False'); +invoke(FDSolver,'ConsiderPortLossesTet','True'); +invoke(FDSolver,'SetShieldAllPorts','False'); +invoke(FDSolver,'AccuracyHex','1e-6'); +invoke(FDSolver,'AccuracyTet','1e-4'); +invoke(FDSolver,'AccuracySrf','1e-3'); + + + +invoke(FDSolver,'LimitIterations','False'); +invoke(FDSolver,'MaxIterations','0'); +invoke(FDSolver,'SetCalculateExcitationsInParallel','True','False',''); +invoke(FDSolver,'StoreAllResults','False'); +invoke(FDSolver,'StoreResultsInCache','False'); +invoke(FDSolver,'UseHelmholtzEquation','True'); +invoke(FDSolver,'LowFrequencyStabilization','True'); +invoke(FDSolver,'Type','Auto'); +invoke(FDSolver,'MeshAdaptionHex','False'); +invoke(FDSolver,'MeshAdaptionTet','True'); +invoke(FDSolver,'AcceleratedRestart','True'); +invoke(FDSolver,'FreqDistAdaptMode','Distributed'); +invoke(FDSolver,'NewIterativeSolver','True'); +invoke(FDSolver,'TDCompatibleMaterials','False'); +invoke(FDSolver,'ExtrudeOpenBC','False'); +invoke(FDSolver,'SetOpenBCTypeHex','Default'); +invoke(FDSolver,'SetOpenBCTypeTet','Default'); +invoke(FDSolver,'AddMonitorSamples','True'); +invoke(FDSolver,'CalcStatBField','False'); +invoke(FDSolver,'CalcPowerLoss','True'); +invoke(FDSolver,'CalcPowerLossPerComponent','False'); +invoke(FDSolver,'StoreSolutionCoefficients','True'); +invoke(FDSolver,'UseDoublePrecision','False'); +invoke(FDSolver,'UseDoublePrecision_ML','True'); +invoke(FDSolver,'MixedOrderSrf','False'); +invoke(FDSolver,'MixedOrderTet','False'); +invoke(FDSolver,'PreconditionerAccuracyIntEq','0.15'); +invoke(FDSolver,'MLFMMAccuracy','Default'); +invoke(FDSolver,'MinMLFMMBoxSize','0.20'); +invoke(FDSolver,'UseCFIEForCPECIntEq','true'); + + +invoke(FDSolver,'UseFastRCSSweepIntEq','false'); +invoke(FDSolver,'UseSensitivityAnalysis','False'); +invoke(FDSolver,'SweepErrorThreshold','True','0.01'); +invoke(FDSolver,'SweepErrorChecks','2'); +invoke(FDSolver,'SweepMinimumSamples','3'); +invoke(FDSolver,'SweepConsiderAll','True'); +invoke(FDSolver,'SweepConsiderReset'); +invoke(FDSolver,'SetNumberOfResultDataSamples','1001'); +invoke(FDSolver,'SweepWeightEvanescent','1.0'); +invoke(FDSolver,'AccuracyROM','1e-4'); +invoke(FDSolver,'AddSampleInterval','','','1','Automatic','True'); +%invoke(FDSolver,'AddSampleInterval','','','','Automatic','False'); +invoke(FDSolver,'MPIParallelization','False'); +invoke(FDSolver,'UseDistributedComputing','False'); +invoke(FDSolver,'NetworkComputingStrategy','RunRemote'); +invoke(FDSolver,'NetworkComputingJobCount','3'); +invoke(FDSolver,'LimitCPUs','True'); +invoke(FDSolver,'MaxCPUs','48'); + +IESolver = invoke(mws,'IESolver'); +invoke(IESolver,'Reset'); +invoke(IESolver,'UseFastFrequencySweep','True'); +invoke(IESolver,'UseIEGroundPlane','False'); +% invoke(IESolver,'SetRealGroundMaterialName',''); +invoke(IESolver,'PreconditionerType','Auto'); + +IESolver = invoke(mws,'IESolver'); +invoke(IESolver,'SetFMMFFCalcStopLevel','0'); +invoke(IESolver,'SetFMMFFCalcNumInterpPoints','6'); +invoke(IESolver,'UseFMMFarfieldCalc','True'); +invoke(IESolver,'SetCFIEAlpha','0.500000'); +invoke(IESolver,'LowFrequencyStabilization','False'); +invoke(IESolver,'LowFrequencyStabilizationML','True'); +invoke(IESolver,'Multilayer','False'); +invoke(IESolver,'SetiMoMACC_I','0.0001'); + +invoke(IESolver,'SetiMoMACC_M','0.0001'); +invoke(IESolver,'DeembedExternalPorts','True'); +invoke(IESolver,'SetOpenBC_XY','True'); +invoke(IESolver,'OldRCSSweepDefintion','False'); +invoke(IESolver,'SetAccuracySetting','Custom'); +invoke(IESolver,'CalculateSParaforFieldsources','True'); +Solver = invoke(mws,'Solver'); +invoke(Solver,'Start'); + + + + +end diff --git a/Simulation/CstDefineHfieldMonitor.m b/Simulation/CstDefineHfieldMonitor.m new file mode 100644 index 0000000..ccbfdc1 --- /dev/null +++ b/Simulation/CstDefineHfieldMonitor.m @@ -0,0 +1,30 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineHfieldMonitor(mws,Hfieldname, frequency) + +%'@ define monitor: e-field (f=2.25) +% Efieldname is a string + +Monitor = invoke(mws,'Monitor'); +invoke(Monitor,'Reset'); +invoke(Monitor,'Name',Hfieldname); +invoke(Monitor,'Dimension','Volume'); +invoke(Monitor,'Domain','Frequency'); +invoke(Monitor,'FieldType','Hfield'); +invoke(Monitor,'Frequency',num2str(frequency)); +invoke(Monitor,'UseSubvolume','False'); +invoke(Monitor,'SetSubvolume','-209.896229', '229.896229', '-179.896229', '179.896229', '-149.896229', '187.896229'); +invoke(Monitor,'Create'); + + +end diff --git a/Simulation/CstDefineOpenBoundary.m b/Simulation/CstDefineOpenBoundary.m new file mode 100644 index 0000000..1de68b8 --- /dev/null +++ b/Simulation/CstDefineOpenBoundary.m @@ -0,0 +1,77 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineOpenBoundary(mws,minfrequency,Xmin,Xmax,Ymin,Ymax,Zmin,Zmax) + +%use this function AFTER assigning all the monitors!! +% minfrequency is the frequency of the lowest monitor +%Xmin,Xmax,Ymin,Ymax,Zmin,Zmax = 'expanded open', 'open', 'electric', +%'magnetic', 'periodic', 'conducting wall', 'unit cell' + +Boundary = invoke(mws,'Boundary'); +invoke(Boundary,'Xmin',Xmin); +invoke(Boundary,'Xmax',Xmax); +invoke(Boundary,'Ymin',Ymin); +invoke(Boundary,'Ymax',Ymax); +invoke(Boundary,'Zmin',Zmin); +invoke(Boundary,'Zmax',Zmax); +invoke(Boundary,'Xsymmetry','none'); +invoke(Boundary,'Ysymmetry','none'); +invoke(Boundary,'Zsymmetry','none'); +invoke(Boundary,'XminThermal','isothermal'); +invoke(Boundary,'XmaxThermal','isothermal'); +invoke(Boundary,'YminThermal','isothermal'); +invoke(Boundary,'YmaxThermal','isothermal'); +invoke(Boundary,'ZminThermal','isothermal'); +invoke(Boundary,'ZmaxThermal','isothermal'); +invoke(Boundary,'XsymmetryThermal','none'); +invoke(Boundary,'YsymmetryThermal','none'); +invoke(Boundary,'ZsymmetryThermal','none'); +invoke(Boundary,'ApplyInAllDirections','False'); +invoke(Boundary,'ApplyInAllDirectionsThermal','False'); +invoke(Boundary,'XminTemperature',''); +invoke(Boundary,'XminTemperatureType','None'); +invoke(Boundary,'XmaxTemperature',''); +invoke(Boundary,'XmaxTemperatureType','None'); +invoke(Boundary,'YminTemperature',''); +invoke(Boundary,'YminTemperatureType','None'); +invoke(Boundary,'YmaxTemperature',''); +invoke(Boundary,'YmaxTemperatureType','None'); +invoke(Boundary,'ZminTemperature',''); +invoke(Boundary,'ZminTemperatureType','None'); +invoke(Boundary,'ZmaxTemperature',''); +invoke(Boundary,'ZmaxTemperatureType','None'); +if isequal(Xmin,'unit cell') + invoke(Boundary,'XPeriodicShift','0.0'); + invoke(Boundary,'YPeriodicShift','0.0'); + invoke(Boundary,'ZPeriodicShift','0.0'); + invoke(Boundary,'PeriodicUseConstantAngles','False'); + invoke(Boundary,'SetPeriodicBoundaryAngles','0.0','0.0'); + invoke(Boundary,'SetPeriodicBoundaryAnglesDirection','outward'); + invoke(Boundary,'UnitCellFitToBoundingBox','True'); + invoke(Boundary,'UnitCellDs1','0.0'); + invoke(Boundary,'UnitCellDs2','0.0'); + invoke(Boundary,'UnitCellAngle','90.0'); +end +if isequal(Xmin,'expanded open') +invoke(Boundary,'ReflectionLevel','0.0001'); +invoke(Boundary,'MinimumDistanceType','Fraction'); +invoke(Boundary,'MinimumDistancePerWavelengthNewMeshEngine','4'); +invoke(Boundary,'MinimumDistanceReferenceFrequencyType','CenterNMonitors'); +invoke(Boundary,'FrequencyForMinimumDistance',num2str(minfrequency)); +invoke(Boundary,'SetAbsoluteDistance','0.0'); +Plot = invoke(mws,'Plot'); +invoke(Plot,'DrawBox','True'); +end + + +end \ No newline at end of file diff --git a/Simulation/CstDefineTimedomainSolver.m b/Simulation/CstDefineTimedomainSolver.m new file mode 100644 index 0000000..ccf8426 --- /dev/null +++ b/Simulation/CstDefineTimedomainSolver.m @@ -0,0 +1,40 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDefineTimedomainSolver(mws,SteadyStateLimit) + +%'@ define time domain solver parameters +% SteadyStateLimit is usualy -30 or -40 db +Mesh = invoke(mws,'Mesh'); +invoke(Mesh,'SetCreator','High Frequency'); + +Solver = invoke(mws,'Solver'); +invoke(Solver,'Method','Hexahedral'); +invoke(Solver,'CalculationType','TD-S'); +invoke(Solver,'StimulationPort','All'); +invoke(Solver,'StimulationMode','All'); +invoke(Solver,'SteadyStateLimit',int2str(SteadyStateLimit)); +invoke(Solver,'MeshAdaption','False'); +invoke(Solver,'AutoNormImpedance','False'); +invoke(Solver,'NormingImpedance','50'); +invoke(Solver,'CalculateModesOnly','False'); +invoke(Solver,'SParaSymmetry','False'); +invoke(Solver,'StoreTDResultsInCache','False'); +invoke(Solver,'FullDeembedding','False'); +invoke(Solver,'SuperimposePLWExcitation','False'); +invoke(Solver,'UseSensitivityAnalysis','False'); +invoke(Solver,'Start'); %initializes simulation + +end + + + diff --git a/Simulation/CstDiscreteFacePort.m b/Simulation/CstDiscreteFacePort.m new file mode 100644 index 0000000..6dbbcdf --- /dev/null +++ b/Simulation/CstDiscreteFacePort.m @@ -0,0 +1,37 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDiscreteFacePort(mws,PortNumber,SetP1,SetP2) + + +DiscreteFacePort = invoke(mws,'DiscreteFacePort'); + +invoke(DiscreteFacePort,'Reset'); +invoke(DiscreteFacePort,'PortNumber',int2str(PortNumber)); +invoke(DiscreteFacePort,'Type','SParameter'); +invoke(DiscreteFacePort,'Label',''); +invoke(DiscreteFacePort,'Impedance','50'); +invoke(DiscreteFacePort,'VoltagePortImpedance','0.0'); +invoke(DiscreteFacePort,'VoltageAmplitude','1.0'); +invoke(DiscreteFacePort,'SetP1','True',int2str(SetP1(1)),int2str(SetP1(2)),int2str(SetP1(3))); +invoke(DiscreteFacePort,'SetP2','True',int2str(SetP2(1)),int2str(SetP2(2)),int2str(SetP2(3))); +invoke(DiscreteFacePort,'LocalCoordinates','False'); +invoke(DiscreteFacePort,'InvertDirection','False'); +invoke(DiscreteFacePort,'CenterEdge','True'); +invoke(DiscreteFacePort,'Monitor','True'); +invoke(DiscreteFacePort,'UseProjection','False'); +invoke(DiscreteFacePort,'ReverseProjection','False'); +invoke(DiscreteFacePort,'Create'); + +release(DiscreteFacePort); + +end \ No newline at end of file diff --git a/Simulation/CstDiscretePort.m b/Simulation/CstDiscretePort.m new file mode 100644 index 0000000..ef3026c --- /dev/null +++ b/Simulation/CstDiscretePort.m @@ -0,0 +1,35 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstDiscretePort(mws,PortNumber,SetP1,SetP2) + +DiscretePort = invoke(mws,'DiscretePort'); +invoke(DiscretePort,'Reset'); +invoke(DiscretePort,'PortNumber',int2str(PortNumber)); +invoke(DiscretePort,'Type','SParameter'); +invoke(DiscretePort,'Label',''); +invoke(DiscretePort,'Impedance','50'); +invoke(DiscretePort,'VoltagePortImpedance','0.0'); +invoke(DiscretePort,'Voltage','1.0'); +invoke(DiscretePort,'Current','1.0'); +invoke(DiscretePort,'SetP1','False',int2str(SetP1(1)),int2str(SetP1(2)),int2str(SetP1(3))); +invoke(DiscretePort,'SetP2','False',int2str(SetP2(1)),int2str(SetP2(2)),int2str(SetP2(3))); +invoke(DiscretePort,'InvertDirection','False'); +invoke(DiscretePort,'LocalCoordinates','False'); +invoke(DiscretePort,'Monitor','True'); +invoke(DiscretePort,'Radius','0.0'); +invoke(DiscretePort,'Wire',''); +invoke(DiscretePort,'Position','end1'); +invoke(DiscretePort,'Create'); +release(DiscretePort); +end + diff --git a/Simulation/CstWaveguidePort.m b/Simulation/CstWaveguidePort.m new file mode 100644 index 0000000..ab8d76f --- /dev/null +++ b/Simulation/CstWaveguidePort.m @@ -0,0 +1,38 @@ +% Copyright (C) 2018 Symeon Symeonidis, Stefanos Tsantilas, Stelios Mitilineos +% simos421@gmail.com, steftsantilas@gmail.com, smitil@gmail.com +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. + +function CstWaveguidePort(mws,PortNumber, Xrange, Yrange, Zrange, XrangeAdd, YrangeAdd, ZrangeAdd,Coordinates,Orientation) + +%coordinates = 'Picks' or 'Full' +%orientation = 'positive' or 'xmax' +Port = invoke(mws,'Port'); +invoke(Port,'Reset'); +invoke(Port,'PortNumber',num2str(PortNumber)); +invoke(Port,'Label',''); +invoke(Port,'NumberOfModes','1'); +invoke(Port,'AdjustPolarization','False'); +invoke(Port,'PolarizationAngle','0.0'); +invoke(Port,'ReferencePlaneDistance','0'); +invoke(Port,'TextSize','50'); +invoke(Port,'Coordinates',Coordinates); +invoke(Port,'Orientation',Orientation); +invoke(Port,'PortOnBound','False'); +invoke(Port,'ClipPickedPortToBound','False'); +invoke(Port,'Xrange',int2str(Xrange(1)),int2str(Xrange(2))); +invoke(Port,'Yrange',int2str(Yrange(1)),int2str(Yrange(2))); +invoke(Port,'Zrange',int2str(Zrange(1)),int2str(Zrange(2))); +invoke(Port,'XrangeAdd',int2str(XrangeAdd(1)),int2str(XrangeAdd(2))); +invoke(Port,'YrangeAdd',int2str(YrangeAdd(1)),int2str(YrangeAdd(2))); +invoke(Port,'ZrangeAdd',int2str(ZrangeAdd(1)),int2str(ZrangeAdd(2))); +invoke(Port,'SingleEnded','False'); +invoke(Port,'Create'); +end \ No newline at end of file