├── CursorDataPoint-1Point.m ├── CursorDataPoint.m ├── GA ├── GAForMyR_A │ ├── band │ │ ├── GAForObjFuncByBand.m │ │ ├── obj_functions │ │ │ └── objFuncByBand.m │ │ ├── resources │ │ │ ├── GASetupForObjFuncByBand.m │ │ │ ├── exe_ModelForObjFuncByBand.m │ │ │ ├── test │ │ │ │ ├── testObjFuncByBand.m │ │ │ │ ├── testWriteStartMessagesForObjFuncByBand.m │ │ │ │ └── testWriteStopMessagesForObjFuncByBand.m │ │ │ ├── writeDataForObjFuncByBand.m │ │ │ ├── writeStartMessagesForObjFuncByBand.m │ │ │ └── writeStopMessagesForObjFuncByBand.m │ │ └── scores_functions │ │ │ └── getScoresByBand.m │ └── freq_and_s11 │ │ ├── GAForObjFuncByFreq.m │ │ ├── GAForObjFuncByFreqAndS11.m │ │ ├── GAForObjFuncByFreqAndS11_Socres_V4.m │ │ ├── obj_functions │ │ ├── objFuncByFreq.m │ │ ├── objFuncByFreqAndS11.m │ │ └── objFuncByFreqAndS11_Scores_V4.m │ │ ├── resources │ │ ├── GASetupForObjFuncByFreqAndS11.m │ │ ├── exe_ModelForObjFuncByFreqAndS11.m │ │ ├── test │ │ │ ├── testObjFuncByFreqAndS11.m │ │ │ ├── testWriteStartMessagesForObjFuncByFreqAndS11.m │ │ │ └── testWriteStopMessagesForObjFuncByFreqAndS11.m │ │ ├── writeDataForObjFuncByFreqAndS11.m │ │ ├── writeStartMessagesForObjFuncByFreqAndS11.m │ │ └── writeStopMessagesForObjFuncByFreqAndS11.m │ │ └── scores_functions │ │ ├── getScoresByFreq.m │ │ ├── getScoresByFreqAndS11.m │ │ ├── getScoresByFreqAndS11_V2.m │ │ ├── getScoresByFreqAndS11_V3.m │ │ └── getScoresByFreqAndS11_V4.m ├── resources │ ├── getFreqAndS11_GA_Scores_V4.m │ ├── getGenerationsMessageOfMyR_A.m │ └── setupParam_HFSS_GA.m └── test │ ├── myGATestForRA.m │ ├── other │ ├── ackley_uniform.m │ ├── diff_crossover.m │ ├── gaplotchange.m │ ├── lastaverage.m │ ├── my_fun.m │ ├── two_min.m │ └── 最佳值变化.fig │ ├── scutan │ ├── findpow.m │ ├── mypow.m │ └── testGetMin.m │ ├── testArrFor_GA.m │ ├── testGA.m │ └── testOptions.m ├── README.md ├── R_A_M_N ├── create_model_of_single_switchArray │ ├── Only_M_N_R_A_Model.m │ ├── resources │ │ ├── create_Only_M_N_R_A_Model.m │ │ └── exe_Create_Only_M_N_R_A_Model.m │ └── test │ │ ├── testArrForOnly_M_N_R_A_Model.m │ │ └── test_exe_Create_Only_M_N_R_A_Model.m ├── get_message_of_single_switchArray │ ├── getMessageOfSingleSwitchArrayFor_M_N_R_A.m │ ├── resources │ │ ├── exe_M_N_R_A_Model_SingleSwitchArr.m │ │ └── setupParamOfHFSS_GetMessage_SingleSwitchArr.m │ └── test │ │ ├── testArr_M_N_R_A_Model_SingleSwitchArr.m │ │ └── test_exe_M_N_R_A_Model_SingleSwitchArr.m ├── get_message_of_some_switchArray │ ├── GetMessage_Some_SwitchArr.m │ ├── resources │ │ ├── exe_M_N_R_A_Model_Some_SwitchArr.m │ │ ├── getFigure_OneSwitchArrayForSome_SwitchArr.m │ │ ├── getFigure_Some_SwitchArr.m │ │ ├── getMessage_OneSwitchArrForSome_SwitchArr.m │ │ └── setupParam_HFSS_Some_SwitchArr.m │ └── switch_array │ │ ├── SwitchArrayForOneFrequencyPoint_9_97.m │ │ └── testArrFor_Some_SwitchArr.m └── resources │ ├── model │ ├── create_M_N_R_A_Model.m │ └── test │ │ └── test_Create_M_N_R_A_Model.m │ └── parameters_for_test │ └── modelParametersFor_M_N_R_A.m ├── hfss_matlab_api ├── 3dmodeler │ ├── hfssAssignFacePE.m │ ├── hfssAssignMaterial.m │ ├── hfssBox.m │ ├── hfssChangeProperty.m │ ├── hfssCircle.m │ ├── hfssCoaxialCable.m │ ├── hfssCone.m │ ├── hfssConnect.m │ ├── hfssCopy.m │ ├── hfssCreateRegularPolygon.m │ ├── hfssCylinder.m │ ├── hfssDipole.m │ ├── hfssDuplicateAlongLine.m │ ├── hfssDuplicateAroundAxis.m │ ├── hfssDuplicateMirror.m │ ├── hfssEllipse.m │ ├── hfssGetFaceByPosition.m │ ├── hfssHollowCylinder.m │ ├── hfssIntersect.m │ ├── hfssMove.m │ ├── hfssPLObject.m │ ├── hfssPolygon.m │ ├── hfssPolyline.m │ ├── hfssRectangle.m │ ├── hfssRename.m │ ├── hfssRotate.m │ ├── hfssSetColor.m │ ├── hfssSetSolveInside.m │ ├── hfssSetTransparency.m │ ├── hfssSphere.m │ ├── hfssSplit.m │ ├── hfssSubtract.m │ ├── hfssSubtract1 .m │ ├── hfssSweepAlongPath.m │ ├── hfssSweepAlongVector.m │ ├── hfssSweepAroundAxis.m │ ├── hfssUncoveredCylinder.m │ ├── hfssUnite.m │ └── hfssWireConnection.m ├── analysis │ ├── hfssCreateReport.m │ ├── hfssExportNetworkData.m │ ├── hfssExportRadiationParameters.m │ ├── hfssExportReport.m │ ├── hfssExportToFile.m │ ├── hfssFarFieldSphere.m │ ├── hfssFastSweep.m │ ├── hfssInsertSolution.m │ ├── hfssInterpolatingSweep.m │ └── hfssSolveSetup.m ├── boundary │ ├── hfssAssignLumpedPort.m │ ├── hfssAssignPE.m │ ├── hfssAssignPE_face.m │ ├── hfssAssignRadiation.m │ ├── hfssAssignRadiation_face.m │ ├── hfssAssignWavePort.m │ ├── hfssAssignWavePort_face.m │ ├── hfssCircularPort.m │ └── hfssEditSources.m ├── contrib │ ├── hfssSetDesign.m │ └── hfssVariableChange.m └── general │ ├── hfssAddMaterial.m │ ├── hfssCloseActiveProject.m │ ├── hfssExecuteScript.m │ ├── hfssInsertDesign.m │ ├── hfssNewProject.m │ ├── hfssOpenProject.m │ └── hfssSaveProject.m ├── reconfigrable_antenna ├── create_model_of_single_switchArray │ ├── createModelOfSingleSwitchArray.m │ └── resources │ │ ├── createUnite_R_A_Model.m │ │ └── exeModelForCreateModelOfSinlgeSwitchArray.m ├── get_freq_of_all_switchArray │ ├── getFreqOfAllSwitchArray.m │ ├── get_write_freq_of_switchArray │ │ └── getAndWriteFreqOfSwitchArray.m │ ├── resources │ │ ├── executeModelForGetAndWriteFreqOfSwitchArray.m │ │ ├── setupParametersOfHFSSForGetAndWriteFreqOfSwitchArray.m │ │ ├── writeFreqAndS11ForTest.m │ │ ├── writeStartMessagesForGetAndWriteFreqOfSwitchArray.m │ │ └── writeStopMessagesForGetAndWriteFreqOfSwitchArray.m │ └── test │ │ ├── myTestSwitchArray.m │ │ └── testGetFreqOfAllSwitchArray.m ├── get_message_of_single_switchArray │ ├── getMessageOfSingleSwitchArray.m │ └── resources │ │ ├── executeModelForGetMessageOfSinlgeSwitchArray.m │ │ └── setupParametersOfHFSSForGetMessageOfSingleSwitchArray.m ├── one_frequency_point │ ├── GetMessageForOneFrequencyPoint.m │ ├── resources │ │ ├── executeModelForOneFrequencyPoint.m │ │ ├── getFigureForOneFrequencyPoint.m │ │ ├── getFigureOfOneSwitchArrayForOneFrequencyPoint.m │ │ ├── getMessageOfOneSwitchArray.m │ │ └── setupParametersOfHFSSForOneFrequencyPoint.m │ └── switch_array │ │ ├── SwitchArrayForOneFrequencyPoint_3_85.m │ │ ├── SwitchArrayForOneFrequencyPoint_9_97.m │ │ ├── SwitchArrayFor_C_Band.m │ │ ├── SwitchArrayFor_L_Band.m │ │ ├── SwitchArrayFor_S_Band.m │ │ └── SwitchArrayFor_X_Band.m └── resources │ ├── model │ ├── ModelDemo.m │ ├── createUniteReconfigurableAntennaModelForOpenProject.m │ └── createUniteReconfigurableAntennaModelForTest.m │ ├── parameters_for_test │ ├── modelParametersForTest.m │ └── setupParametersOfHFSSForTest.m │ └── switch_array │ └── switchArray.m ├── test ├── ArrayToString.m ├── TestGetFigure.m ├── dataProcessing.m ├── executeModelForGetMessageOfSinlgeSwitchArrayByOpenProject.m ├── getRuntime.m ├── other │ ├── My_GA.m │ ├── dipole_example2.m │ └── fun.m ├── testArray.m ├── testCallMfile.m ├── testCell.m ├── testCreateRAModel.m ├── testDirectory.m ├── testError.m ├── testExecute.m ├── testModel.m ├── testRand.m ├── testString.m ├── testWrite2Txt.m ├── testXlswrite.m └── test_open_project │ └── testDemo.m └── tools ├── fileDirectoryParameters_V2ForTest.m ├── getFigureByDataFile.m ├── getFigureForTest.m ├── getFreqAndS11ForTest.m ├── getHFSSName.m └── write100Star.m /CursorDataPoint-1Point.m: -------------------------------------------------------------------------------- 1 | function output_txt = myfunction(obj,event_obj) 2 | % Display the position of the data cursor 3 | % obj Currently not used (empty) 4 | % event_obj Handle to event object 5 | % output_txt Data cursor text string (string or cell array of strings). 6 | 7 | pos = get(event_obj,'Position'); 8 | output_txt = {['P4:(', num2str(pos(1),4), ', ', num2str(pos(2),4), ')']}; 9 | 10 | % If there is a Z-coordinate in the position, display it as well 11 | if length(pos) > 2 12 | output_txt{end+1} = ['Z: ',num2str(pos(3),4)]; 13 | end 14 | -------------------------------------------------------------------------------- /CursorDataPoint.m: -------------------------------------------------------------------------------- 1 | function output_txt = myfunction(obj,event_obj) 2 | % Display the position of the data cursor 3 | % obj Currently not used (empty) 4 | % event_obj Handle to event object 5 | % output_txt Data cursor text string (string or cell array of strings). 6 | 7 | pos = get(event_obj,'Position'); 8 | output_txt = {['Frequency: ',num2str(pos(1),4),'GHz']... 9 | ['S11: ',num2str(pos(2),4),'dB']}; 10 | 11 | % If there is a Z-coordinate in the position, display it as well 12 | if length(pos) > 2 13 | output_txt{end+1} = ['Z: ',num2str(pos(3),4)]; 14 | end 15 | -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/GAForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/GAForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/obj_functions/objFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/obj_functions/objFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/GASetupForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/GASetupForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/exe_ModelForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/exe_ModelForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/test/testObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/test/testObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/test/testWriteStartMessagesForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/test/testWriteStartMessagesForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/test/testWriteStopMessagesForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/test/testWriteStopMessagesForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/writeDataForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/writeDataForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/writeStartMessagesForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/writeStartMessagesForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/resources/writeStopMessagesForObjFuncByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/resources/writeStopMessagesForObjFuncByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/band/scores_functions/getScoresByBand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/band/scores_functions/getScoresByBand.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreq.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreqAndS11_Socres_V4.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/GAForObjFuncByFreqAndS11_Socres_V4.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreq.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreqAndS11_Scores_V4.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/obj_functions/objFuncByFreqAndS11_Scores_V4.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/GASetupForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/GASetupForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/exe_ModelForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/exe_ModelForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/test/testObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/test/testObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/test/testWriteStartMessagesForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/test/testWriteStartMessagesForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/test/testWriteStopMessagesForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/test/testWriteStopMessagesForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/writeDataForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/writeDataForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/writeStartMessagesForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/writeStartMessagesForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/resources/writeStopMessagesForObjFuncByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/resources/writeStopMessagesForObjFuncByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreq.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V2.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V2.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V3.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V3.m -------------------------------------------------------------------------------- /GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V4.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/GAForMyR_A/freq_and_s11/scores_functions/getScoresByFreqAndS11_V4.m -------------------------------------------------------------------------------- /GA/resources/getFreqAndS11_GA_Scores_V4.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/resources/getFreqAndS11_GA_Scores_V4.m -------------------------------------------------------------------------------- /GA/resources/getGenerationsMessageOfMyR_A.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/resources/getGenerationsMessageOfMyR_A.m -------------------------------------------------------------------------------- /GA/resources/setupParam_HFSS_GA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/resources/setupParam_HFSS_GA.m -------------------------------------------------------------------------------- /GA/test/myGATestForRA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/myGATestForRA.m -------------------------------------------------------------------------------- /GA/test/other/ackley_uniform.m: -------------------------------------------------------------------------------- 1 | function [x,fval,exitflag,output,population,score] = ackley_uniform(nvars) 2 | %% This is an auto generated MATLAB file from Optimization Tool. 3 | 4 | %% Start with the default options 5 | options = gaoptimset; 6 | %% Modify options setting 7 | options = gaoptimset(options,'Display', 'off'); 8 | options = gaoptimset(options,'PlotFcns', { @gaplotbestf }); 9 | [x,fval,exitflag,output,population,score] = ... 10 | ga(@ackleyfcn,nvars,[],[],[],[],[],[],[],[],options); 11 | -------------------------------------------------------------------------------- /GA/test/other/diff_crossover.m: -------------------------------------------------------------------------------- 1 | options = gaoptimset('Generations',300,'Display','none'); 2 | rng('default') 3 | record = []; 4 | for n = 0:.05:1 5 | options = gaoptimset(options,'CrossoverFraction',n); 6 | [x,fval] = ga(@rastriginsfcn,2,[],[],[],[],[],[],[],options); 7 | record = [record;fval]; 8 | end 9 | plot(0:.05:1,record); 10 | xlabel('Crossover Fraction'); 11 | ylabel('fval') -------------------------------------------------------------------------------- /GA/test/other/gaplotchange.m: -------------------------------------------------------------------------------- 1 | function state = gaplotchange(options,state,flag) 2 | persistent last_best 3 | if (strcmp(flag,'init')) 4 | set(gca,'xlim',[1,options.Generations],'Yscale','log'); 5 | hold on; 6 | xlabel Generation 7 | title('Change in Best Fitness Value') 8 | end 9 | best = min(state.Score); 10 | if state.Generation == 0 11 | last_best = best; 12 | else 13 | change = last_best - best; 14 | last_best = best; 15 | plot(state.Generation, change,'.r'); 16 | title('Change in Best Fitness Value') 17 | end -------------------------------------------------------------------------------- /GA/test/other/lastaverage.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/other/lastaverage.m -------------------------------------------------------------------------------- /GA/test/other/my_fun.m: -------------------------------------------------------------------------------- 1 | function z = my_fun(x) 2 | z = x(1)^2 - 2*x(1)*x(2) + 6*x(1) + x(2)^2 - 6*x(2); -------------------------------------------------------------------------------- /GA/test/other/two_min.m: -------------------------------------------------------------------------------- 1 | function y = two_min(x) 2 | if x<20 3 | y = -exp(-(x/20).^2); 4 | else 5 | y = -exp(-1)+(x-20)*(x-22); 6 | end -------------------------------------------------------------------------------- /GA/test/other/最佳值变化.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/other/最佳值变化.fig -------------------------------------------------------------------------------- /GA/test/scutan/findpow.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/scutan/findpow.m -------------------------------------------------------------------------------- /GA/test/scutan/mypow.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/scutan/mypow.m -------------------------------------------------------------------------------- /GA/test/scutan/testGetMin.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/scutan/testGetMin.m -------------------------------------------------------------------------------- /GA/test/testArrFor_GA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/testArrFor_GA.m -------------------------------------------------------------------------------- /GA/test/testGA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/testGA.m -------------------------------------------------------------------------------- /GA/test/testOptions.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/GA/test/testOptions.m -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # matlab_GA 2 | 遗传算法在M×N阵列可重构天线中的应用(Application of Genetic Algorithm in M × N Reconfigurable Antenna Array) 3 | 4 | 该脚本利用MATLAB-HFSS-API,在MATLAB中编写M×N阵列可重构天线的建模仿真脚本。为了快速地得到具有指定频率的开关组合状态,将遗传算法应用于该M×N阵列可重构天线。(The modeling simulation and script of M × N reconfigurable antenna array is written in MATLAB by using MATLAB-HFSS-API. In order to quickly get a switch array with target frequency, genetic algorithm is applied to M × N reconfigurable antenna array.) -------------------------------------------------------------------------------- /R_A_M_N/create_model_of_single_switchArray/Only_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/create_model_of_single_switchArray/Only_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/create_model_of_single_switchArray/resources/create_Only_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/create_model_of_single_switchArray/resources/create_Only_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/create_model_of_single_switchArray/resources/exe_Create_Only_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/create_model_of_single_switchArray/resources/exe_Create_Only_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/create_model_of_single_switchArray/test/testArrForOnly_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/create_model_of_single_switchArray/test/testArrForOnly_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/create_model_of_single_switchArray/test/test_exe_Create_Only_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/create_model_of_single_switchArray/test/test_exe_Create_Only_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_single_switchArray/getMessageOfSingleSwitchArrayFor_M_N_R_A.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_single_switchArray/getMessageOfSingleSwitchArrayFor_M_N_R_A.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_single_switchArray/resources/exe_M_N_R_A_Model_SingleSwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_single_switchArray/resources/exe_M_N_R_A_Model_SingleSwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_single_switchArray/resources/setupParamOfHFSS_GetMessage_SingleSwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_single_switchArray/resources/setupParamOfHFSS_GetMessage_SingleSwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_single_switchArray/test/testArr_M_N_R_A_Model_SingleSwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_single_switchArray/test/testArr_M_N_R_A_Model_SingleSwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_single_switchArray/test/test_exe_M_N_R_A_Model_SingleSwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_single_switchArray/test/test_exe_M_N_R_A_Model_SingleSwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/GetMessage_Some_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/GetMessage_Some_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/resources/exe_M_N_R_A_Model_Some_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/resources/exe_M_N_R_A_Model_Some_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/resources/getFigure_OneSwitchArrayForSome_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/resources/getFigure_OneSwitchArrayForSome_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/resources/getFigure_Some_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/resources/getFigure_Some_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/resources/getMessage_OneSwitchArrForSome_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/resources/getMessage_OneSwitchArrForSome_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/resources/setupParam_HFSS_Some_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/resources/setupParam_HFSS_Some_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/switch_array/SwitchArrayForOneFrequencyPoint_9_97.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/switch_array/SwitchArrayForOneFrequencyPoint_9_97.m -------------------------------------------------------------------------------- /R_A_M_N/get_message_of_some_switchArray/switch_array/testArrFor_Some_SwitchArr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/get_message_of_some_switchArray/switch_array/testArrFor_Some_SwitchArr.m -------------------------------------------------------------------------------- /R_A_M_N/resources/model/create_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/resources/model/create_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/resources/model/test/test_Create_M_N_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/resources/model/test/test_Create_M_N_R_A_Model.m -------------------------------------------------------------------------------- /R_A_M_N/resources/parameters_for_test/modelParametersFor_M_N_R_A.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/R_A_M_N/resources/parameters_for_test/modelParametersFor_M_N_R_A.m -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssAssignFacePE.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignPE(fid, Name, ObjectList, [infGND = false]) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VB Script necessary to assign a PEC boundary to 7 | % the given object(s). 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the PEC boundary. This will appear under "Boundaries" 13 | % in HFSS 14 | % ObjList - a cell array of objects to which the PEC boundary condition will 15 | % be applied. 16 | % infGND - (boolean) specify as true to make the PEC represent an infinite 17 | % ground plane (default is false). 18 | % 19 | % 20 | % Note : 21 | % ------ 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssAssignPE(fid, 'GNDplane', {'AntennaGND'}, true); 28 | % 29 | % ---------------------------------------------------------------------------- 30 | 31 | % ---------------------------------------------------------------------------- 32 | % This file is part of HFSS-MATLAB-API. 33 | % 34 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 35 | % under the terms of the GNU General Public License as published by the Free 36 | % Software Foundation; either version 2 of the License, or (at your option) 37 | % any later version. 38 | % 39 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 40 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 41 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42 | % for more details. 43 | % 44 | % You should have received a copy of the GNU General Public License along with 45 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 46 | % Place, Suite 330, Boston, MA 02111-1307 USA 47 | % 48 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 49 | % ---------------------------------------------------------------------------- 50 | 51 | function hfssAssignFacePE(fid, Name, Faces, infGND) 52 | 53 | % arguments processor. 54 | if (nargin < 3) 55 | error('Insufficient # of arguments !'); 56 | elseif (nargin < 4) 57 | infGND = []; 58 | end; 59 | 60 | % default arguments. 61 | if isempty(infGND) 62 | infGND = false; 63 | end; 64 | 65 | % # of objects. 66 | nObjects = length(Faces); 67 | 68 | % create the necessary script. 69 | fprintf(fid, '\n'); 70 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 71 | fprintf(fid, 'oModule.AssignPerfectE _\n'); 72 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 73 | 74 | % is infinite GND ? 75 | if (infGND) 76 | fprintf(fid, '"InfGroundPlane:=", true, _\n'); 77 | else 78 | fprintf(fid, '"InfGroundPlane:=", false, _\n'); 79 | end; 80 | 81 | fprintf(fid, '"Objects:=", _\n'); 82 | fprintf(fid, 'Array('); 83 | for iObj = 1:nObjects, 84 | fprintf(fid, '"%s"', Faces{iObj}); 85 | if (iObj ~= nObjects) 86 | fprintf(fid, ','); 87 | end; 88 | end; 89 | fprintf(fid, '))\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssAssignMaterial.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignMaterial(fid, Object, Material) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to assign a material selection to an 7 | % existing HFSS object. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Object - name of the object to which the material is to assigned. 13 | % Material - the material to be assigned to the Object. This is a string that 14 | % should either be predefined in HFSS or defined using 15 | % hfssAddMaterial(...) 16 | % 17 | % Note : 18 | % ------ 19 | % 20 | % Example : 21 | % --------- 22 | % fid = fopen('myantenna.vbs', 'wt'); 23 | % ... 24 | % hfssAssignMaterial(fid, 'FR4Mount', 'FR4epoxy'); 25 | % ---------------------------------------------------------------------------- 26 | 27 | % ---------------------------------------------------------------------------- 28 | % This file is part of HFSS-MATLAB-API. 29 | % 30 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 31 | % under the terms of the GNU General Public License as published by the Free 32 | % Software Foundation; either version 2 of the License, or (at your option) 33 | % any later version. 34 | % 35 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 36 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 37 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38 | % for more details. 39 | % 40 | % You should have received a copy of the GNU General Public License along with 41 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 42 | % Place, Suite 330, Boston, MA 02111-1307 USA 43 | % 44 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 45 | % ---------------------------------------------------------------------------- 46 | function hfssAssignMaterial(fid, Name, Material) 47 | 48 | fprintf(fid, '\n'); 49 | fprintf(fid, 'oEditor.AssignMaterial _\n'); 50 | fprintf(fid, '\tArray("NAME:Selections", _\n'); 51 | fprintf(fid, '\t\t"Selections:=", "%s"), _\n', Name); 52 | fprintf(fid, '\tArray("NAME:Attributes", _\n'); 53 | fprintf(fid, '\t\t"MaterialName:=", "%s", _\n', Material); 54 | 55 | % if the material is copper, we should set solve inside to be false and for 56 | % other materials (in general) is should be true. 57 | if (strcmp(Material, 'copper') | strcmp(Material, 'pec')) 58 | fprintf(fid, '\t\t"SolveInside:=", false)\n'); 59 | else 60 | fprintf(fid, '\t\t"SolveInside:=", true)\n'); 61 | end; 62 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssBox.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssBox(fid, Name, Start, Size, Units, [Center1], [Radius1], ... 3 | % [Axis1], [Center2], [Radius2], [Axis2], ...) 4 | % 5 | % Description : 6 | % ------------- 7 | % Create the VB Script necessary to create a Box (or Cuboid) in HFSS. This 8 | % function also provides for optional holes (specified by their Center, 9 | % Radii and Axes) in the box. This feature is useful to allow things like 10 | % vias, cables etc., to penetrate the box without intersection violations. 11 | % 12 | % Parameters : 13 | % ------------ 14 | % fid - file identifier of the HFSS script file. 15 | % Name - name of the box (appears in HFSS). 16 | % Start - starting location of the box (specify as [x, y, z]). 17 | % Size - size of the box (specify as [sx, sy, sz]). 18 | % Units - units of the box (specify using either 'in', 'mm', 'meter' or 19 | % anything else defined in HFSS). 20 | % Center - (Optional) center of the hole to be punched through the box. 21 | % It can lie anywhere within or on the surface of the box. 22 | % Radius - (Optional) radius of the hole to be punched through the box. 23 | % Axis - (Optional) axis of the hole to be punched through the box. 24 | % 25 | % Note : 26 | % ------ 27 | % If you happen to specify a hole that lies outside the box, it will have 28 | % no effect. The script will run without interruption. 29 | % 30 | % Example : 31 | % --------- 32 | % fid = fopen('myantenna.vbs', 'wt'); 33 | % ... 34 | % % a Box with 2 holes punched thro' it. 35 | % hfssBox(fid, 'FR4_Base', [-bpHeight/2, -baseLength/2, 0], [bpHeight, ... 36 | % baseLength, -baseThick], 'in', [cX1, cY1, cZ1], R1, 'Z',... 37 | % [cX2, cY2, cZ2], R2, 'X'); 38 | % 39 | % ---------------------------------------------------------------------------- 40 | 41 | % ---------------------------------------------------------------------------- 42 | % This file is part of HFSS-MATLAB-API. 43 | % 44 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 45 | % under the terms of the GNU General Public License as published by the Free 46 | % Software Foundation; either version 2 of the License, or (at your option) 47 | % any later version. 48 | % 49 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 50 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 51 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 52 | % for more details. 53 | % 54 | % You should have received a copy of the GNU General Public License along with 55 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 56 | % Place, Suite 330, Boston, MA 02111-1307 USA 57 | % 58 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 59 | % ---------------------------------------------------------------------------- 60 | function hfssBox(fid, Name, Start, Size, Units, varargin) 61 | 62 | % Preamble. 63 | fprintf(fid, '\n'); 64 | fprintf(fid, 'oEditor.CreateBox _\n'); 65 | 66 | % Box Parameters. 67 | fprintf(fid, 'Array("NAME:BoxParameters", _\n'); 68 | fprintf(fid, '"XPosition:=", "%f%s", _\n', Start(1), Units); 69 | fprintf(fid, '"YPosition:=", "%f%s", _\n', Start(2), Units); 70 | fprintf(fid, '"ZPosition:=", "%f%s", _\n', Start(3), Units); 71 | fprintf(fid, '"XSize:=", "%f%s", _\n', Size(1), Units); 72 | fprintf(fid, '"YSize:=", "%f%s", _\n', Size(2), Units); 73 | fprintf(fid, '"ZSize:=", "%f%s"), _\n', Size(3), Units); 74 | 75 | % Box Attributes. 76 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 77 | fprintf(fid, '"Name:=", "%s", _\n', Name); 78 | fprintf(fid, '"Flags:=", "", _\n'); 79 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 80 | fprintf(fid, '"Transparency:=", 0.75, _\n'); 81 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 82 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 83 | fprintf(fid, '"SolveInside:=", true)\n'); 84 | 85 | % Add Holes. 86 | nHoles = length(varargin)/3; 87 | 88 | % For each Hole Request create cylinder that satisfies the request and then 89 | % subtract it from the Box. 90 | for iH = 1:nHoles, 91 | Center = varargin{3*(iH-1) + 1}; 92 | Radius = varargin{3*(iH-1) + 2}; 93 | Axis = upper(varargin{3*(iH-1) + 3}); 94 | 95 | switch(Axis) 96 | case 'X', 97 | Center(1) = Start(1); 98 | Length = Size(1); 99 | case 'Y', 100 | Center(2) = Start(2); 101 | Length = Size(2); 102 | case 'Z', 103 | Center(3) = Start(3); 104 | Length = Size(3); 105 | end; 106 | 107 | hfssCylinder(fid, strcat(Name, '_subhole', num2str(iH)), Axis, ... 108 | Center, Radius, Length, Units); 109 | hfssSubtract(fid, Name, strcat(Name, '_subhole', num2str(iH))); 110 | end; 111 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssChangeProperty.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssChangeProperty(fid, num, name) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to change object's property. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % num - the number of objects. 12 | % name - the name of objects. 13 | % 14 | % Note : 15 | % ------ 16 | % 17 | % Example : 18 | % --------- 19 | % fid = fopen('myantenna.vbs', 'wt'); 20 | % ... 21 | % ---------------------------------------------------------------------------- 22 | 23 | % ---------------------------------------------------------------------------- 24 | % This file is part of HFSS-MATLAB-API. 25 | % 26 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 27 | % under the terms of the GNU General Public License as published by the Free 28 | % Software Foundation; either version 2 of the License, or (at your option) 29 | % any later version. 30 | % 31 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 32 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 33 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34 | % for more details. 35 | % 36 | % You should have received a copy of the GNU General Public License along with 37 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 38 | % Place, Suite 330, Boston, MA 02111-1307 USA 39 | % 40 | % Copyright 2008, Vijay Ramasami (yue_liang423@163.com) 41 | % ------------------------------------------------------------------------- 42 | % --- 43 | 44 | function hfssChangeProperty(fid, num, name) 45 | 46 | % preamble 47 | fprintf(fid, '\n'); 48 | fprintf(fid, 'oEditor.ChangeProperty _\n'); 49 | fprintf(fid, 'Array("NAME:AllTabs", _\n'); 50 | fprintf(fid, 'Array("NAME:Geometry3DAttributeTab", _\n'); 51 | fprintf(fid, 'Array("NAME:PropServers", _\n'); 52 | for i = 1:num-1 53 | fprintf(fid, '"%s", _\n',name{i}); 54 | end 55 | fprintf(fid, '"%s"), _\n',name{num}); 56 | fprintf(fid, 'Array("NAME:ChangedProps", _\n'); 57 | fprintf(fid, 'Array("NAME:Color", _\n'); 58 | % change color 59 | fprintf(fid, '"R:=", 255, "G:=", 128, "B:=", 128)))) _\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCircle.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCircle(fid, Name, Axis, Center, Radius, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to create a circle in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Name - name of the circle object (in HFSS). 12 | % Axis - choose between 'X', 'Y', or 'Z' to represent the circle axis. 13 | % Center - center of the circle (use the [x, y, z] format). 14 | % Radius - radius of the circle. 15 | % Units - units for all the above quantities (use either 'in', 'mm', 'meter' 16 | % or anything else defined in HFSS). 17 | % 18 | % Note : 19 | % ------ 20 | % 21 | % Example : 22 | % --------- 23 | % fid = fopen('myantenna.vbs', 'wt'); 24 | % ... 25 | % hfssCircle(fid, 'C_Patch', 'Z', [10, 11, 12], 13, 'mm'); 26 | % ---------------------------------------------------------------------------- 27 | 28 | % ---------------------------------------------------------------------------- 29 | % This file is part of HFSS-MATLAB-API. 30 | % 31 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 32 | % under the terms of the GNU General Public License as published by the Free 33 | % Software Foundation; either version 2 of the License, or (at your option) 34 | % any later version. 35 | % 36 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 37 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 38 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 39 | % for more details. 40 | % 41 | % You should have received a copy of the GNU General Public License along with 42 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 43 | % Place, Suite 330, Boston, MA 02111-1307 USA 44 | % 45 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 46 | % ---------------------------------------------------------------------------- 47 | function hfssCircle(fid, Name, Axis, Center, Radius, Units, coverLines) 48 | 49 | if (nargin < 7) 50 | coverLines = []; 51 | end; 52 | if isempty(coverLines) 53 | coverLines = true; 54 | end; 55 | 56 | % Preamble. 57 | fprintf(fid, 'oEditor.CreateCircle _\n'); 58 | fprintf(fid, 'Array("NAME:CircleParameters", _\n'); 59 | 60 | % Parameters. 61 | if (coverLines) 62 | fprintf(fid, '"IsCovered:=", true, _\n'); 63 | else 64 | fprintf(fid, '"IsCovered:=", false, _\n'); 65 | end; 66 | fprintf(fid, '"XCenter:=", "%f%s", _\n', Center(1), Units); 67 | fprintf(fid, '"YCenter:=", "%f%s", _\n', Center(2), Units); 68 | fprintf(fid, '"ZCenter:=", "%f%s", _\n', Center(3), Units); 69 | fprintf(fid, '"Radius:=", "%f%s", _\n', Radius, Units); 70 | fprintf(fid, '"WhichAxis:=", "%s"), _\n', upper(Axis)); 71 | 72 | % Attributes. 73 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 74 | fprintf(fid, '"Name:=", "%s", _\n', Name); 75 | fprintf(fid, '"Flags:=", "", _\n'); 76 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 77 | fprintf(fid, '"Transparency:=", 0, _\n'); 78 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 79 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 80 | fprintf(fid, '"SolveInside:=", true)\n'); 81 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCoaxialCable.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % hfssCoaxialCable(fid, Names, Axis, Center, Radii, Height, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VBScript necessary to draw a Coaxial Cable in 7 | % HFSS. The "Coaxial Cable" can have as many cylinders as you specify. This 8 | % function only creates the geometric structure and does not set any material 9 | % properties. 10 | % 11 | % Parameters : 12 | % ------------ 13 | % fid - file identifier of the HFSS VBScript File. 14 | % Name - a cell of strings that contains the names of each cylinder that is a 15 | % part of the co-axial cable (see example). 16 | % Axis - axis of the Coaxial Cable (choose between 'X', 'Y' or 'Z'). 17 | % Center - Coordinates of the Center of the Coaxial Cable ([x, y, z]). 18 | % Radii - an array of Radii of the Cylinders present in the Coaxial cable. 19 | % each radius corresponds to the respective name specfied in the 20 | % 'Name' parameter. 21 | % Height - length of the coaxial cable. 22 | % Units - can be either 'in' or 'mm' or 'meter' or anything defined in HFSS. 23 | % 24 | % Example: 25 | % --------- 26 | % ... 27 | % hfssCoaxialCable(fid, {'Cyl1_In', 'Cyl1_Er', 'Cyl1_Out'}, 'Z', [0, 0, 0], 28 | % 0.02, 0.03, 0.04], 10, 'in') 29 | % ... 30 | % -------------------------------------------------------------------------- % 31 | 32 | % ---------------------------------------------------------------------------- 33 | % This file is part of HFSS-MATLAB-API. 34 | % 35 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 36 | % under the terms of the GNU General Public License as published by the Free 37 | % Software Foundation; either version 2 of the License, or (at your option) 38 | % any later version. 39 | % 40 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 41 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 42 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43 | % for more details. 44 | % 45 | % You should have received a copy of the GNU General Public License along with 46 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 47 | % Place, Suite 330, Boston, MA 02111-1307 USA 48 | % 49 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 50 | % ---------------------------------------------------------------------------- 51 | function hfssCoaxialCable(fid, Names, Axis, Center, Radii, Height, Units) 52 | 53 | % Sort the Radii first in Ascending order. 54 | [Radii, iR] = sort(Radii); 55 | Names = cellstr(char(Names{iR})); 56 | 57 | % Get the # of Cylinders. 58 | nCylinders = length(Radii); 59 | 60 | % First create the N-1 hollow cylinders. 61 | for iR = nCylinders:-1:2, 62 | hfssHollowCylinder(fid, Names{iR}, Axis, Center, Radii(iR-1), ... 63 | Radii(iR), Height, Units); 64 | end; 65 | 66 | % Finally create the inner cylinder. 67 | hfssCylinder(fid, Names{1}, Axis, Center, Radii(1), Height, Units); 68 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCone.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCone(fid, Name, Axis, Center, BottomRadius, TopRadius, Height, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB script necessary to model a cone in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Name - name of the cone (in HFSS). 12 | % Center - center of the cone (specify as [x, y, z]). This is also the 13 | % starting point of the cone. 14 | % Axis - axis of the cone (specify as 'X', 'Y', or 'Z'). 15 | % BottomRadius - radius of the cone (scalar). 16 | % TopRadius - radius of the cone (scalar). 17 | % Height - height of the cone (from the point specified by Center). 18 | % Units - specify as 'in', 'mm', 'meter' or anything else defined in HFSS. 19 | % 20 | % Note : 21 | % ------ 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssCone(fid, 'Cone1', 'Z', [0, 0, 0], 0.1, 0.2, 10, 'in'); 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % This file is part of HFSS-MATLAB-API. 32 | % 33 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 34 | % under the terms of the GNU General Public License as published by the Free 35 | % Software Foundation; either version 2 of the License, or (at your option) 36 | % any later version. 37 | % 38 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 39 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 40 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41 | % for more details. 42 | % 43 | % You should have received a copy of the GNU General Public License along with 44 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 45 | % Place, Suite 330, Boston, MA 02111-1307 USA 46 | % 47 | % Copyright 2007, YueLiang (yue_liang423@163.com) 48 | % ---------------------------------------------------------------------------- 49 | function hfssCone(fid, Name, Axis, Center, BottomRadius, TopRadius, Height, Units) 50 | 51 | % Preamble. 52 | fprintf(fid, 'oEditor.CreateCone _\n'); 53 | fprintf(fid, 'Array("NAME:ConeParameters", _\n'); 54 | 55 | % Parameters. 56 | fprintf(fid, '"XCenter:=", "%f%s", _\n', Center(1), Units); 57 | fprintf(fid, '"YCenter:=", "%f%s", _\n', Center(2), Units); 58 | fprintf(fid, '"ZCenter:=", "%f%s", _\n', Center(3), Units); 59 | fprintf(fid, '"WhichAxis:=", "%s", _\n', upper(Axis)); 60 | fprintf(fid, '"Height:=", "%f%s", _\n', Height, Units); 61 | fprintf(fid, '"BottomRadius:=", "%f%s", _\n', BottomRadius, Units); 62 | fprintf(fid, '"TopRadius:=", "%f%s"), _\n', TopRadius, Units); 63 | 64 | % Attributes. 65 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 66 | fprintf(fid, '"Name:=", "%s", _\n', Name); 67 | fprintf(fid, '"Flags:=", "", _\n'); 68 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 69 | fprintf(fid, '"Transparency:=", 0, _\n'); 70 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 71 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 72 | fprintf(fid, '"SolveInside:=", true)\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssConnect.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssConnect(fid, Names) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates VB Script necessary to connect two HFSS objects using a surface. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Names - a cell array of strings that represent the surface-like objects that 12 | % need to be connected to form a solid structure. 13 | % 14 | % Note : 15 | % ------ 16 | % 17 | % Example : 18 | % --------- 19 | % fid = fopen('myantenna.vbs', 'wt'); 20 | % ... 21 | % hfssConnect(fid, {'topLayer', 'bottomLayer'}); 22 | % ---------------------------------------------------------------------------- 23 | 24 | % ---------------------------------------------------------------------------- 25 | % This file is part of HFSS-MATLAB-API. 26 | % 27 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 28 | % under the terms of the GNU General Public License as published by the Free 29 | % Software Foundation; either version 2 of the License, or (at your option) 30 | % any later version. 31 | % 32 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 33 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 34 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 35 | % for more details. 36 | % 37 | % You should have received a copy of the GNU General Public License along with 38 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 39 | % Place, Suite 330, Boston, MA 02111-1307 USA 40 | % 41 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 42 | % ---------------------------------------------------------------------------- 43 | function hfssConnect(fid, Names) 44 | 45 | fprintf(fid, '\n'); 46 | fprintf(fid, 'oEditor.Connect _\n'); 47 | fprintf(fid, 'Array("NAME:Selections", _\n'); 48 | fprintf(fid, '"Selections:=", _\n'); 49 | 50 | nObjects = length(Names); 51 | fprintf(fid, '"'); 52 | for iO = 1:nObjects-1, 53 | fprintf(fid, '%s,', Names{iO}); 54 | end; 55 | fprintf(fid, '%s")\n', Names{nObjects}); 56 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCopy.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCopy(fid, Name) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the VB Script necessary to construct a rectangle using the HFSS 7 | % 3D Modeler. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of which you want to copy 13 | % 14 | % Note : 15 | % ------ 16 | % Todo: a feature to add automatic holes in the rectangle object. 17 | % 18 | % Example : 19 | % --------- 20 | % fid = fopen('myantenna.vbs', 'wt'); 21 | % ... 22 | % % in this example, Y-axis size is 10in and Z-axis size is 20in. 23 | % hfssRectangle(fid, 'Rect1', 'X', [0,0,0], 10, 20, 'in'); 24 | % 25 | % ---------------------------------------------------------------------------- 26 | 27 | % ---------------------------------------------------------------------------- 28 | % This file is part of HFSS-MATLAB-API. 29 | % 30 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 31 | % under the terms of the GNU General Public License as published by the Free 32 | % Software Foundation; either version 2 of the License, or (at your option) 33 | % any later version. 34 | % 35 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 36 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 37 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38 | % for more details. 39 | % 40 | % You should have received a copy of the GNU General Public License along with 41 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 42 | % Place, Suite 330, Boston, MA 02111-1307 USA 43 | % 44 | % Copyright 2008, Yueliang (yue_liang423@163.com) 45 | % ------------------------------------------------------------------------- 46 | function hfssCopy(fid, Name) 47 | 48 | % Preamble. 49 | fprintf(fid, '\n'); 50 | fprintf(fid, 'oEditor.Copy _\n'); 51 | 52 | fprintf(fid, 'Array("NAME:Selections", "Selections:=", "%s") \n',Name); 53 | fprintf(fid, 'oEditor.Paste'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCreateRegularPolygon.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % function hfssCreateRegularPolygon(fid,name,point_center,point_start,... 3 | % numbersides,axis,units) 4 | % 5 | % Description: 6 | % ------------ 7 | % Create a closed polygon object in HFSS. This function also provides 8 | % an option to punch a bunch of (circular) holes into the polygon object (so 9 | % as to make way for cables, wires, etc.,). 10 | % 11 | % Parameters: 12 | % ----------- 13 | % Name - Name Attribute for the Polygon. 14 | % point_center 15 | % point_start 16 | % numbersides 17 | % axis 18 | % units - can be either: 19 | % 'mm' - millimeter. 20 | % 'in' - inches. 21 | % 'mil' - mils. 22 | % 'meter' - meter (note: don't use 'm'). 23 | % or anything that Ansoft HFSS supports. 24 | % 25 | % Example: 26 | % ---------------------------------------------------------------------------- 27 | % This file is part of HFSS-MATLAB-API. 28 | % 29 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 30 | % under the terms of the GNU General Public License as published by the Free 31 | % Software Foundation; either version 2 of the License, or (at your option) 32 | % any later version. 33 | % 34 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 35 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 36 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37 | % for more details. 38 | % 39 | % You should have received a copy of the GNU General Public License along with 40 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 41 | % Place, Suite 330, Boston, MA 02111-1307 USA 42 | % 43 | % Copyright 2008, Yue liang (yue_liang423@163.com) 44 | % ------------------------------------------------------------------------- 45 | % --- 46 | function hfssCreateRegularPolygon(fid,name,point_center,point_start,... 47 | numbersides,axis,units) 48 | % preamble 49 | fprintf(fid, '\n'); 50 | fprintf(fid, 'oEditor.CreateRegularPolygon _\n'); 51 | fprintf(fid, 'Array("NAME:RegularPolygonParameters", _\n'); 52 | fprintf(fid, '"CoordinateSystemID:=", -1, _\n'); 53 | fprintf(fid, '"IsCovered:=", true, _\n'); 54 | 55 | % points 56 | fprintf(fid, '"XCenter:=", "%f%s", _\n',point_center(1),units); 57 | fprintf(fid, '"YCenter:=", "%f%s", _\n',point_center(2),units); 58 | fprintf(fid, '"ZCenter:=", "%f%s", _\n',point_center(3),units); 59 | fprintf(fid, '"XStart:=", "%f%s", _\n',point_start(1),units); 60 | fprintf(fid, '"YStart:=", "%f%s", _\n',point_start(2),units); 61 | fprintf(fid, '"ZStart:=", "%f%s", _\n',point_start(3),units); 62 | 63 | % sides 64 | fprintf(fid, '"NumSides:=", "%d", _\n',numbersides); 65 | fprintf(fid, '"WhichAxis:=", "%s"), _\n',axis); 66 | 67 | % Attributes 68 | fprintf(fid, 'Array("NAME:Attributes", "Name:=", "%s", _\n',name); 69 | fprintf(fid, '"Flags:=", "", "Color:=", "(132 132 193)", _\n'); 70 | fprintf(fid, '"Transparency:=", 0, "PartCoordinateSystem:=", "Global", _\n'); 71 | fprintf(fid, '"MaterialName:=", "vacuum", "SolveInside:=", true) \n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssCylinder.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCylinder(fid, Name, Axis, Center, Radius, Height, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB script necessary to model a cylinder in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Name - name of the cylinder (in HFSS). 12 | % Center - center of the cylinder (specify as [x, y, z]). This is also the 13 | % starting point of the cylinder. 14 | % Axis - axis of the cylinder (specify as 'X', 'Y', or 'Z'). 15 | % Radius - radius of the cylinder (scalar). 16 | % Height - height of the cylidner (from the point specified by Center). 17 | % Units - specify as 'in', 'mm', 'meter' or anything else defined in HFSS. 18 | % 19 | % Note : 20 | % ------ 21 | % 22 | % Example : 23 | % --------- 24 | % fid = fopen('myantenna.vbs', 'wt'); 25 | % ... 26 | % hfssCylinder(fid, 'Cyl1', 'Z', [0, 0, 0], 0.1, 10, 'in'); 27 | % ---------------------------------------------------------------------------- 28 | 29 | % ---------------------------------------------------------------------------- 30 | % This file is part of HFSS-MATLAB-API. 31 | % 32 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 33 | % under the terms of the GNU General Public License as published by the Free 34 | % Software Foundation; either version 2 of the License, or (at your option) 35 | % any later version. 36 | % 37 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 38 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 39 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40 | % for more details. 41 | % 42 | % You should have received a copy of the GNU General Public License along with 43 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 44 | % Place, Suite 330, Boston, MA 02111-1307 USA 45 | % 46 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 47 | % ---------------------------------------------------------------------------- 48 | function hfssCylinder(fid, Name, Axis, Center, Radius, Height, Units) 49 | 50 | % Cylinder Parameters. 51 | fprintf(fid, '\n'); 52 | fprintf(fid, 'oEditor.CreateCylinder _\n'); 53 | fprintf(fid, 'Array("NAME:CylinderParameters", _\n'); 54 | fprintf(fid, '"XCenter:=", "%f%s", _\n', Center(1), Units); 55 | fprintf(fid, '"YCenter:=", "%f%s", _\n', Center(2), Units); 56 | fprintf(fid, '"ZCenter:=", "%f%s", _\n', Center(3), Units); 57 | fprintf(fid, '"Radius:=", "%f%s", _\n', Radius, Units); 58 | fprintf(fid, '"Height:=", "%f%s", _\n', Height, Units); 59 | fprintf(fid, '"WhichAxis:=", "%s"), _\n', upper(Axis)); 60 | 61 | % Cylinder Properties. 62 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 63 | fprintf(fid, '"Name:=", "%s", _\n', Name); 64 | fprintf(fid, '"Flags:=", "", _\n'); 65 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 66 | fprintf(fid, '"Transparency:=", 0, _\n'); 67 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 68 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 69 | fprintf(fid, '"SolveInside:=", true)\n'); 70 | fprintf(fid, '\n'); 71 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssDuplicateAlongLine.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssDuplicateAlongLine(fid, ObjectList, dVector, nClones, Units, ... 3 | % [dupBoundaries = true]) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary to clone (duplicate) a list of objects 8 | % along a line. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % ObjectList - a cell-array of strings that represent the objects to be 14 | % cloned. 15 | % dVector - (vector) the translation vector for the duplication process 16 | % (specified as [dx, dy, dz]). 17 | % nClones - # of clones to be created. 18 | % Units - specified as either 'mm', 'meter', 'in' or anything else 19 | % defined in HFSS. 20 | % [dupBoundaries] - (optional, boolean) set to false if you wish NOT to 21 | % duplicate boundaries along with the geometry. 22 | % 23 | % Note : 24 | % ------ 25 | % If you have used this 3D modeler feature before, then you will probably 26 | % realize that if the original object (to be cloned) has the name 'Name', 27 | % then the cloned objects will have names 'Name1', 'Name2', ... This applies 28 | % to the cloned boundaries and excitations also. 29 | % 30 | % Example : 31 | % --------- 32 | % fid = fopen('myantenna.vbs', 'wt'); 33 | % ... 34 | % 35 | % ---------------------------------------------------------------------------- 36 | 37 | % ---------------------------------------------------------------------------- 38 | % This file is part of HFSS-MATLAB-API. 39 | % 40 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 41 | % under the terms of the GNU General Public License as published by the Free 42 | % Software Foundation; either version 2 of the License, or (at your option) 43 | % any later version. 44 | % 45 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 46 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 47 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 48 | % for more details. 49 | % 50 | % You should have received a copy of the GNU General Public License along with 51 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 52 | % Place, Suite 330, Boston, MA 02111-1307 USA 53 | % 54 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 55 | % ---------------------------------------------------------------------------- 56 | % varargin - specify 'true' (default) to duplicate boundaries or 'false' 57 | % otherwise 58 | function hfssDuplicateAlongLine(fid, ObjectList, dVector, nClones, Units, ... 59 | dupBoundaries) 60 | 61 | 62 | % arguments processor. 63 | if (nargin < 5) 64 | error('Insufficient number of arguments !'); 65 | elseif (nargin < 6) 66 | dupBoundaries = []; 67 | end; 68 | 69 | % default arguments. 70 | if isempty(dupBoundaries) 71 | dupBoundaries = true; 72 | end; 73 | 74 | nObjects = length(ObjectList); 75 | 76 | % Preamble. 77 | fprintf(fid, '\n'); 78 | fprintf(fid, 'oEditor.DuplicateAlongLine _\n'); 79 | fprintf(fid, 'Array("NAME:Selections", _\n'); 80 | 81 | % Object Selections. 82 | fprintf(fid, '"Selections:=", "'); 83 | for iObj = 1:nObjects, 84 | fprintf(fid, '%s', ObjectList{iObj}); 85 | if (iObj ~= nObjects) 86 | fprintf(fid, ','); 87 | end; 88 | end; 89 | fprintf(fid, '"), _\n'); 90 | 91 | % Duplication Vectors. 92 | fprintf(fid, 'Array("NAME:DuplicateToAlongLineParameters", _\n'); 93 | fprintf(fid, '"XComponent:=", "%f%s", _\n', dVector(1), Units); 94 | fprintf(fid, '"YComponent:=", "%f%s", _\n', dVector(2), Units); 95 | fprintf(fid, '"ZComponent:=", "%f%s", _\n', dVector(3), Units); 96 | fprintf(fid, '"NumClones:=", %d), _\n', nClones); 97 | 98 | % Duplicate Boundaries with Geometry or not. 99 | fprintf(fid, 'Array("NAME:Options", _\n'); 100 | if (dupBoundaries) 101 | fprintf(fid, '"DuplicateBoundaries:=", true)\n'); 102 | else 103 | fprintf(fid, '"DuplicateBoundaries:=", false)\n'); 104 | end; 105 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssDuplicateAroundAxis.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssDuplicateAroundAxis(fid, ObjectList, Axis, DupAngle,... 3 | % [dupBoundaries = true]) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary to duplicate specified parts according to 8 | % a mirror plane. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % ObjectList - a cell-array of strings that represent the objects to be 14 | % cloned. 15 | % Axis - axis around which Object is to be duplicate. 16 | % DupAngle - angle (in *deg*) over which the object is to be duplicate. 17 | % [dupBoundaries] - (optional, boolean) set to false if you wish NOT to 18 | % duplicate boundaries along with the geometry. 19 | % 20 | % Note : 21 | % ------ 22 | % If you have used this 3D modeler feature before, then you will probably 23 | % realize that if the original object (to be cloned) has the name 'Name', 24 | % then the cloned objects will have names 'Name1', 'Name2', ... This applies 25 | % to the cloned boundaries and excitations also. 26 | % 27 | % Example : 28 | % --------- 29 | % fid = fopen('myantenna.vbs', 'wt'); 30 | % ... 31 | % 32 | % ---------------------------------------------------------------------------- 33 | 34 | % ---------------------------------------------------------------------------- 35 | % This file is part of HFSS-MATLAB-API. 36 | % 37 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 38 | % under the terms of the GNU General Public License as published by the Free 39 | % Software Foundation; either version 2 of the License, or (at your option) 40 | % any later version. 41 | % 42 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 43 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 44 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45 | % for more details. 46 | % 47 | % You should have received a copy of the GNU General Public License along with 48 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 49 | % Place, Suite 330, Boston, MA 02111-1307 USA 50 | % 51 | % Copyright 2008, Yueliang (yue_liang423@163.com) 52 | % ------------------------------------------------------------------------- 53 | % --- 54 | function hfssDuplicateAroundAxis(fid, ObjectList, Axis, DupAngle,... 55 | dupBoundaries) 56 | 57 | % arguments processor. 58 | if (nargin < 4) 59 | error('Insufficient number of arguments !'); 60 | elseif (nargin < 5) 61 | dupBoundaries = []; 62 | end; 63 | 64 | % default arguments. 65 | %if isempty(dupBoundaries) 66 | % dupBoundaries = false; 67 | %end; 68 | 69 | nObjects = length(ObjectList); 70 | 71 | % Preamble. 72 | fprintf(fid, '\n'); 73 | fprintf(fid, 'oEditor.DuplicateAroundAxis _\n'); 74 | fprintf(fid, 'Array("NAME:Selections", _\n'); 75 | 76 | % Object Selections. 77 | fprintf(fid, '"Selections:=", "'); 78 | for iObj = 1:nObjects, 79 | fprintf(fid, '%s', ObjectList{iObj}); 80 | if (iObj ~= nObjects) 81 | fprintf(fid, ','); 82 | end; 83 | end; 84 | fprintf(fid, '"), _\n'); 85 | 86 | % Duplication Around Axis. 87 | fprintf(fid, 'Array("NAME:DuplicateAroundAxisParameters", _\n'); 88 | fprintf(fid, '"WhichAxis:=", "%s", _\n', Axis); 89 | fprintf(fid, '"AngleStr:=", "%fdeg", _\n', DupAngle); 90 | fprintf(fid, '"NumClones:=", 2), _\n'); 91 | 92 | 93 | % Duplicate Boundaries with Geometry or not. 94 | fprintf(fid, 'Array("NAME:Options", _\n'); 95 | if 1 == isempty(dupBoundaries) 96 | fprintf(fid, '"DuplicateBoundaries:=", false)\n'); 97 | else 98 | fprintf(fid, '"DuplicateBoundaries:=", true)\n'); 99 | end -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssDuplicateMirror.m: -------------------------------------------------------------------------------- 1 | function hfssDuplicateMirror(fid, ObjectList, Base, Normal, Units, ... 2 | dupBoundaries) 3 | 4 | if (nargin < 6) 5 | dupBoundaries = []; 6 | end; 7 | if isempty(dupBoundaries) 8 | dupBoundaries = true; 9 | end; 10 | 11 | nObjects = length(ObjectList); 12 | 13 | fprintf(fid, 'oEditor.DuplicateMirror _\n'); 14 | fprintf(fid, '\tArray("NAME:Selections", "Selections:=", "'); 15 | 16 | % Object Selections. 17 | for iObj = 1:nObjects, 18 | fprintf(fid, '%s', ObjectList{iObj}); 19 | if (iObj ~= nObjects) 20 | fprintf(fid, ','); 21 | end; 22 | end; 23 | fprintf(fid, '"), _\n'); 24 | 25 | fprintf(fid, '\tArray("NAME:DuplicateToMirrorParameters", _\n'); 26 | fprintf(fid, '\t\t"DuplicateMirrorBaseX:=", "%f%s", _\n', Base(1), Units); 27 | fprintf(fid, '\t\t"DuplicateMirrorBaseY:=", "%f%s", _\n', Base(2), Units); 28 | fprintf(fid, '\t\t"DuplicateMirrorBaseZ:=", "%f%s", _\n', Base(3), Units); 29 | fprintf(fid, '\t\t"DuplicateMirrorNormalX:=", "%f%s", _\n', Normal(1), Units); 30 | fprintf(fid, '\t\t"DuplicateMirrorNormalY:=", "%f%s", _\n', Normal(2), Units); 31 | fprintf(fid, '\t\t"DuplicateMirrorNormalZ:=", "%f%s" _\n', Normal(3), Units); 32 | fprintf(fid, '\t\t), _\n'); 33 | if (dupBoundaries == true) 34 | fprintf(fid, '\tArray("NAME:Options", "DuplicateBoundaries:=", true) \n\n'); 35 | else 36 | fprintf(fid, '\tArray("NAME:Options", "DuplicateBoundaries:=", false) \n\n'); 37 | end; 38 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssEllipse.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssEllipse(fid, Name, Axis, Center, MajRadius, Ratio, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to create an ellipse primitive in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Name - name of the circle object (in HFSS). 12 | % Axis - choose between 'X', 'Y', or 'Z' to represent the circle axis. 13 | % Center - center of the circle (use the [x, y, z] format). 14 | % MajRadius - majradius of the ellipse. 15 | % Ration - ration of the ellipse. 16 | % Units - units for all the above quantities (use either 'in', 'mm', 'meter' 17 | % or anything else defined in HFSS). 18 | % 19 | % Note : 20 | % ------ 21 | % 22 | % Example : 23 | % --------- 24 | % fid = fopen('myantenna.vbs', 'wt'); 25 | % ... 26 | % hfssCircle(fid, 'C_Patch', 'Z', [10, 11, 12], 13, 0.8, 'mm'); 27 | % ---------------------------------------------------------------------------- 28 | 29 | % ---------------------------------------------------------------------------- 30 | % This file is part of HFSS-MATLAB-API. 31 | % 32 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 33 | % under the terms of the GNU General Public License as published by the Free 34 | % Software Foundation; either version 2 of the License, or (at your option) 35 | % any later version. 36 | % 37 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 38 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 39 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40 | % for more details. 41 | % 42 | % You should have received a copy of the GNU General Public License along with 43 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 44 | % Place, Suite 330, Boston, MA 02111-1307 USA 45 | % 46 | % Copyright 2008, Yueliang (yue_liang423@163.com) 47 | % ------------------------------------------------------------------------- 48 | % --- 49 | function hfssEllipse(fid, Name, Axis, Center, MajRadius, Ratio, Units) 50 | 51 | fprintf(fid, '\n'); 52 | % Preamble. 53 | fprintf(fid, 'oEditor.CreateEllipse _\n'); 54 | fprintf(fid, 'Array("NAME:EllipseParameters", _\n'); 55 | 56 | % Parameters. 57 | fprintf(fid, '"CoordinateSystemID:=", -1, _\n'); 58 | fprintf(fid, '"IsCovered:=", true, _\n'); 59 | fprintf(fid, '"XCenter:=", "%f%s", _\n', Center(1), Units); 60 | fprintf(fid, '"YCenter:=", "%f%s", _\n', Center(2), Units); 61 | fprintf(fid, '"ZCenter:=", "%f%s", _\n', Center(3), Units); 62 | fprintf(fid, '"MajRadius:=", "%f%s", _\n', MajRadius, Units); 63 | fprintf(fid, '"Ratio:=", "%f%s", _\n', Ratio, Units); 64 | fprintf(fid, '"WhichAxis:=", "%s"), _\n', upper(Axis)); 65 | 66 | % Attributes. 67 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 68 | fprintf(fid, '"Name:=", "%s", _\n', Name); 69 | fprintf(fid, '"Flags:=", "", _\n'); 70 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 71 | fprintf(fid, '"Transparency:=", 0, _\n'); 72 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 73 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 74 | fprintf(fid, '"SolveInside:=", true)\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssGetFaceByPosition.m: -------------------------------------------------------------------------------- 1 | function hfssGetFaceByPosition(fid,body,position,Units) 2 | % Gets the ID of a face by position 3 | 4 | 5 | % Parameters : 6 | % ------------ 7 | % fid - file identifier of the HFSS script file. 8 | % body - name of the body on which the point lies 9 | % position - the position in the coordinate of the point 10 | 11 | % 12 | % ---------------------------------------------------------------------------- 13 | 14 | % ---------------------------------------------------------------------------- 15 | % This file is part of HFSS-MATLAB-API. 16 | % 17 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 18 | % under the terms of the GNU General Public License as published by the Free 19 | % Software Foundation; either version 2 of the License, or (at your option) 20 | % any later version. 21 | % 22 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 23 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25 | % for more details. 26 | % 27 | % You should have received a copy of the GNU General Public License along with 28 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 29 | % Place, Suite 330, Boston, MA 02111-1307 USA 30 | % 31 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 32 | % ---------------------------------------------------------------------------- 33 | fprintf(fid, '\n'); 34 | fprintf(fid, 'Dim oFaceID\n'); 35 | fprintf(fid, 'Set oFaceID = oEditor.GetFaceByPosition_\n'); 36 | fprintf(fid, 'Array("NAME:Parameters",_\n'); 37 | fprintf(fid, '"BodyName:=","%s",_\n',body); 38 | fprintf(fid, '"Xposition:=", "%f%s",_\n',position(1),Units); 39 | fprintf(fid, '"Yposition:=", "%f%s",_\n',position(2),Units); 40 | fprintf(fid, '"Zposition:=", "%f%s")\n',position(3),Units); 41 | fprintf(fid, '"Zposition:=", "%f%s")\n',position(3),Units); 42 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssHollowCylinder.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssHollowCylinder(fid, Name, Axis, Center, inRadius, outRadius, 3 | % Height, Units) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates VB Script necessary to generate a hollow cylinder in HFSS. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the hollow cylinder (in HFSS). 13 | % Axis - choose between 'X', 'Y' or 'Z' for the cylinder axis. 14 | % Center - center of the cylinder (express as [x, y, z]). 15 | % inRadius - inner radius of the cylinder. 16 | % outRadius - outer radius of the cylinder. 17 | % Height - cylinder height. 18 | % Units - units for all the quantities (use either 'in', 'mm', 'meter' or 19 | % anything else that is defined in HFSS). 20 | % 21 | % Note : 22 | % ------ 23 | % This function creates an extra object that is a contatenation of the Name 24 | % with '_sub' that gets subtracted from the outer cylinder to get the hollow 25 | % structure. 26 | % 27 | % Example : 28 | % --------- 29 | % fid = fopen('myantenna.vbs', 'wt'); 30 | % ... 31 | % hfssHollowCylinder(fid, 'Dipole', 'X', [-G/2, 0, 0], 0.95*R, R, L, 'in'); 32 | % ---------------------------------------------------------------------------- 33 | 34 | % ---------------------------------------------------------------------------- 35 | % This file is part of HFSS-MATLAB-API. 36 | % 37 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 38 | % under the terms of the GNU General Public License as published by the Free 39 | % Software Foundation; either version 2 of the License, or (at your option) 40 | % any later version. 41 | % 42 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 43 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 44 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45 | % for more details. 46 | % 47 | % You should have received a copy of the GNU General Public License along with 48 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 49 | % Place, Suite 330, Boston, MA 02111-1307 USA 50 | % 51 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 52 | % ---------------------------------------------------------------------------- 53 | function hfssHollowCylinder(fid, Name, Axis, Center, inRadius, outRadius, ... 54 | Height, Units) 55 | 56 | hfssCylinder(fid, Name, Axis, Center, outRadius, Height, Units) 57 | hfssCylinder(fid, strcat(Name, '_sub'), Axis, Center, inRadius, Height, ... 58 | Units); 59 | hfssSubtract(fid, Name, strcat(Name, '_sub')); 60 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssIntersect.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssIntersect(fid, varargin) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary for intersect a given set of objects already 7 | % present in the HFSS 3D Modeler. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % varargin - names of the objects that need to be united. It can be specified 13 | % either as a single cell array of strings, or several individual 14 | % cell strings containing a single object name (see example ...) 15 | % 16 | % Note : 17 | % ------ 18 | % 19 | % Example : 20 | % --------- 21 | % fid = fopen('myantenna.vbs', 'wt'); 22 | % ... 23 | % % Method 1. 24 | % hfssUnite(fid, {'Object1', 'Object2', Object3'}); 25 | % % ... or Method 2. 26 | % hfssUnite(fid, {'Object1'}, {'Object2'}, {'Object3'}); 27 | % 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % This file is part of HFSS-MATLAB-API. 32 | % 33 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 34 | % under the terms of the GNU General Public License as published by the Free 35 | % Software Foundation; either version 2 of the License, or (at your option) 36 | % any later version. 37 | % 38 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 39 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 40 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41 | % for more details. 42 | % 43 | % You should have received a copy of the GNU General Public License along with 44 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 45 | % Place, Suite 330, Boston, MA 02111-1307 USA 46 | % 47 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 48 | % ------------------------------------------------------------------------- 49 | % --- 50 | 51 | function hfssIntersect(fid, varargin) 52 | 53 | % Preamble. 54 | fprintf(fid, '\n'); 55 | fprintf(fid, 'oEditor.Intersect _\n'); 56 | fprintf(fid, 'Array("NAME:Selections", _\n'); 57 | fprintf(fid, '"Selections:=", '); 58 | 59 | % If the first argument is a cell then it contains a cell of strings that must 60 | % be united, else each argument is a cell. 61 | if (iscell(varargin{1})) 62 | Objects = varargin{1}; 63 | else 64 | Objects = varargin; 65 | end; 66 | 67 | % Total # of Objects. 68 | nObjects = length(Objects); 69 | 70 | % Add the Objects. 71 | fprintf(fid, '"'); 72 | for iP = 1:nObjects-1, 73 | fprintf(fid, '%s,', Objects{iP}); 74 | end; 75 | fprintf(fid, '%s"), _\n', Objects{nObjects}); 76 | 77 | % Postamble. 78 | fprintf(fid, 'Array("NAME:IntersectParameters", "KeepOriginals:=", false)\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssMove.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssMove(fid, ObjList, tVector, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to move a given set of objects. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % ObjList - a cell array of objects that need to be moved. 12 | % tVector - a translation vector that defines the motion (specify as 13 | % [tx, ty, tz]). 14 | % Units - units for the transalation vector (use 'in', 'mm', 'meter' or 15 | % anything else defined in HFSS). 16 | % 17 | % Note : 18 | % ------ 19 | % 20 | % Example : 21 | % --------- 22 | % fid = fopen('myantenna.vbs', 'wt'); 23 | % ... create some objects here ... 24 | % hfssMove(fid, {'Dipole1', 'Dipole2'}, [0, d, 0], 'in'); 25 | % ---------------------------------------------------------------------------- 26 | 27 | % ---------------------------------------------------------------------------- 28 | % This file is part of HFSS-MATLAB-API. 29 | % 30 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 31 | % under the terms of the GNU General Public License as published by the Free 32 | % Software Foundation; either version 2 of the License, or (at your option) 33 | % any later version. 34 | % 35 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 36 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 37 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38 | % for more details. 39 | % 40 | % You should have received a copy of the GNU General Public License along with 41 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 42 | % Place, Suite 330, Boston, MA 02111-1307 USA 43 | % 44 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 45 | % ---------------------------------------------------------------------------- 46 | function hfssMove(fid, ObjectList, tVector, Units) 47 | 48 | nObjects = length(ObjectList); 49 | 50 | % Preamble. 51 | fprintf(fid, '\n'); 52 | fprintf(fid, 'oEditor.Move _\n'); 53 | fprintf(fid, 'Array("NAME:Selections", _\n'); 54 | 55 | % Object Selections. 56 | fprintf(fid, '"Selections:=", "'); 57 | for iObj = 1:nObjects, 58 | fprintf(fid, '%s', ObjectList{iObj}); 59 | if (iObj ~= nObjects) 60 | fprintf(fid, ','); 61 | end; 62 | end; 63 | fprintf(fid, '"), _\n'); 64 | 65 | % Transalation Vector. 66 | fprintf(fid, 'Array("NAME:TranslateParameters", _\n'); 67 | fprintf(fid, '"TranslateVectorX:=", "%f%s", _\n', tVector(1), Units); 68 | fprintf(fid, '"TranslateVectorY:=", "%f%s", _\n', tVector(2), Units); 69 | fprintf(fid, '"TranslateVectorZ:=", "%f%s")\n', tVector(3), Units); 70 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssPolygon.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % function hfssPolygon(fid, Name, Points, [Circle], [Radius], [Axis], ... 3 | % 4 | % Description: 5 | % ------------ 6 | % Create a closed polygon object in HFSS. This function also provides 7 | % an option to punch a bunch of (circular) holes into the polygon object (so 8 | % as to make way for cables, wires, etc.,). 9 | % 10 | % Parameters: 11 | % ----------- 12 | % Name - Name Attribute for the PolyLine. 13 | % Points - Points as 3-Tuples, ex: Points = [0, 0, 1; 0, 1, 0; 1, 0 1]; 14 | % Note: size(Points) must give [nPoints, 3] 15 | % Units - can be either: 16 | % 'mm' - millimeter. 17 | % 'in' - inches. 18 | % 'mil' - mils. 19 | % 'meter' - meter (note: don't use 'm'). 20 | % or anything that Ansoft HFSS supports. 21 | % [Circle], [Radius], [Axis] - optional holes to be punched into the polyline. 22 | % Please specify as Center ([x, y, z]), Radius (scalar), Axis 23 | % ('X', 'Y' or 'Z') , ... etc., The script will create circles 24 | % specified using the given parameters and subtract them from the 25 | % polyline object. 26 | % 27 | % Example: 28 | % -------- 29 | % % sCube is a 1x3 vector, Radius, is a Scalar, cxCenter[A, B] is a 1x3 vector 30 | % % and hBalun is a scalar. 31 | % hfssPolyline(fid, 'Short', sCube, 'in', ... 32 | % [cxCenterA(1:2), -hBalun], Radius 'Z', ... 33 | % [cxCenterB(1:2), -hBalun], Radius, 'Z'); 34 | % 35 | % -------------------------------------------------------------------------- % 36 | 37 | % ---------------------------------------------------------------------------- 38 | % This file is part of HFSS-MATLAB-API. 39 | % 40 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 41 | % under the terms of the GNU General Public License as published by the Free 42 | % Software Foundation; either version 2 of the License, or (at your option) 43 | % any later version. 44 | % 45 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 46 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 47 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 48 | % for more details. 49 | % 50 | % You should have received a copy of the GNU General Public License along with 51 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 52 | % Place, Suite 330, Boston, MA 02111-1307 USA 53 | % 54 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 55 | % ---------------------------------------------------------------------------- 56 | function hfssPolygon(fid, Name, Points, Units, varargin) 57 | 58 | nPoints = length(Points(:, 1)); 59 | 60 | % Preamble. 61 | fprintf(fid, '\n'); 62 | fprintf(fid, 'oEditor.CreatePolyline _\n'); 63 | fprintf(fid, 'Array("NAME:PolylineParameters", '); 64 | fprintf(fid, '"IsPolylineCovered:=", true, '); 65 | fprintf(fid, '"IsPolylineClosed:=", true, _\n'); 66 | 67 | % Enter the Points. 68 | fprintf(fid, 'Array("NAME:PolylinePoints", _\n'); 69 | for iP = 1:nPoints-1, 70 | fprintf(fid, 'Array("NAME:PLPoint", '); 71 | fprintf(fid, '"X:=", "%.4f%s", ', Points(iP, 1), Units); 72 | fprintf(fid, '"Y:=", "%.4f%s", ', Points(iP, 2), Units); 73 | fprintf(fid, '"Z:=", "%.4f%s"), _\n', Points(iP, 3), Units); 74 | end 75 | fprintf(fid, 'Array("NAME:PLPoint", '); 76 | fprintf(fid, '"X:=", "%.4f%s", ', Points(nPoints, 1), Units); 77 | fprintf(fid, '"Y:=", "%.4f%s", ', Points(nPoints, 2), Units); 78 | fprintf(fid, '"Z:=", "%.4f%s")), _\n', Points(nPoints, 3), Units); 79 | 80 | % Create Segments. 81 | fprintf(fid, 'Array("NAME:PolylineSegments", _\n'); 82 | for iP = 1:nPoints-2, 83 | fprintf(fid, 'Array("NAME:PLSegment", '); 84 | fprintf(fid, '"SegmentType:=", "Line", '); 85 | fprintf(fid, '"StartIndex:=", %d, ', iP-1); 86 | fprintf(fid, '"NoOfPoints:=", 2), _\n'); 87 | end; 88 | fprintf(fid, 'Array("NAME:PLSegment", '); 89 | fprintf(fid, '"SegmentType:=", "Line", '); 90 | fprintf(fid, '"StartIndex:=", %d, ', (iP-1)+1); 91 | fprintf(fid, '"NoOfPoints:=", 2))), _\n'); 92 | 93 | % Polyline Attributes. 94 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 95 | fprintf(fid, '"Name:=", "%s", _\n', Name); 96 | fprintf(fid, '"Flags:=", "", _\n'); 97 | fprintf(fid, '"Color:=", "(255 0 0)", _\n'); 98 | fprintf(fid, '"Transparency:=", 0, _\n'); 99 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 100 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 101 | fprintf(fid, '"SolveInside:=", true)\n'); 102 | 103 | % Put Holes in the required Spots. 104 | nHoles = length(varargin); 105 | if (mod(nHoles, 3) ~= 0) 106 | error('Error in # of arguments for specifying optional holes'); 107 | end; 108 | nHoles = nHoles/3; 109 | 110 | % For each hole request, create a circle and subtract it from the 111 | % original object. 112 | for iH = 1:nHoles, 113 | Center = varargin{3*(iH-1) + 1}; 114 | Radius = varargin{3*(iH-1) + 2}; 115 | hAxis = varargin{3*(iH-1) + 3}; 116 | 117 | hfssCircle(fid, strcat(Name, '_holesub', num2str(iH)), hAxis, ... 118 | Center, Radius, Units); 119 | hfssSubtract(fid, Name, strcat(Name, '_holesub', num2str(iH))); 120 | end; 121 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssPolyline.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % function hfssPolyline(fid, Name, Points) 3 | % Description: 4 | % ------------ 5 | % 6 | % Parameters: 7 | % ----------- 8 | % Name - Name Attribute for the PolyLine. 9 | % Points - Points as 3-Tuples, ex: Points = [0, 0, 1; 0, 1, 0; 1, 0 1]; 10 | % Note: size(Points) must give [nPoints, 3] 11 | % Units - can be either: 12 | % 'mm' - millimeter. 13 | % 'in' - inches. 14 | % 'mil' - mils. 15 | % 'meter' - meter (note: don't use 'm'). 16 | % or anything that Ansoft HFSS supports. 17 | % 18 | % Example: 19 | % -------- 20 | % -------------------------------------------------------------------------- % 21 | 22 | % ---------------------------------------------------------------------------- 23 | % This file is part of HFSS-MATLAB-API. 24 | % 25 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 26 | % under the terms of the GNU General Public License as published by the Free 27 | % Software Foundation; either version 2 of the License, or (at your option) 28 | % any later version. 29 | % 30 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 31 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 32 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33 | % for more details. 34 | % 35 | % You should have received a copy of the GNU General Public License along with 36 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 37 | % Place, Suite 330, Boston, MA 02111-1307 USA 38 | % 39 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 40 | % ---------------------------------------------------------------------------- 41 | function hfssPolygon(fid, Name, Points, Units, segmentType, Color, ... 42 | Transparency) 43 | 44 | if (nargin < 5) 45 | segmentType = []; 46 | Color = []; 47 | Transparency = []; 48 | elseif (nargin < 6) 49 | Color = []; 50 | Transparency = []; 51 | else 52 | Transparency = []; 53 | end; 54 | 55 | if isempty(segmentType) 56 | segmentType = 'Line'; 57 | end; 58 | if isempty(Color) 59 | Color = [0, 0, 0]; 60 | end; 61 | if isempty(Transparency) 62 | Transparency = 0.8; 63 | end; 64 | 65 | nPoints = length(Points(:, 1)); 66 | 67 | % Preamble. 68 | fprintf(fid, '\n'); 69 | fprintf(fid, 'oEditor.CreatePolyline _\n'); 70 | fprintf(fid, '\tArray("NAME:PolylineParameters", '); 71 | fprintf(fid, '"IsPolylineCovered:=", true, '); 72 | fprintf(fid, '"IsPolylineClosed:=", false, _\n'); 73 | 74 | % Enter the Points. 75 | fprintf(fid, '\t\tArray("NAME:PolylinePoints", _\n'); 76 | for iP = 1:nPoints-1, 77 | fprintf(fid, '\t\t\tArray("NAME:PLPoint", '); 78 | fprintf(fid, '"X:=", "%.4f%s", ', Points(iP, 1), Units); 79 | fprintf(fid, '"Y:=", "%.4f%s", ', Points(iP, 2), Units); 80 | fprintf(fid, '"Z:=", "%.4f%s"), _\n', Points(iP, 3), Units); 81 | end 82 | fprintf(fid, '\t\t\tArray("NAME:PLPoint", '); 83 | fprintf(fid, '"X:=", "%.4f%s", ', Points(nPoints, 1), Units); 84 | fprintf(fid, '"Y:=", "%.4f%s", ', Points(nPoints, 2), Units); 85 | fprintf(fid, '"Z:=", "%.4f%s")_\n', Points(nPoints, 3), Units); 86 | fprintf(fid, '\t\t\t), _ \n'); 87 | 88 | % Create Segments. 89 | fprintf(fid, '\t\tArray("NAME:PolylineSegments", _\n'); 90 | fprintf(fid, '\t\t\tArray("NAME:PLSegment", '); 91 | fprintf(fid, '"SegmentType:=", "%s", ', segmentType); 92 | fprintf(fid, '"StartIndex:=", 0, '); 93 | fprintf(fid, '"NoOfPoints:=", %d) _\n', nPoints); 94 | fprintf(fid, '\t\t\t) _\n'); 95 | fprintf(fid, '\t\t), _\n'); 96 | 97 | % Polyline Attributes. 98 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 99 | fprintf(fid, '"Name:=", "%s", _\n', Name); 100 | fprintf(fid, '"Flags:=", "", _\n'); 101 | fprintf(fid, '"Color:=", "(%d %d %d)", _\n', Color(1), Color(2), Color(3)); 102 | fprintf(fid, '"Transparency:=", %f, _\n', Transparency); 103 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 104 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 105 | fprintf(fid, '"SolveInside:=", true)\n'); 106 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssRectangle.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssRectangle(fid, Name, Axis, Start, Width, Height, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the VB Script necessary to construct a rectangle using the HFSS 7 | % 3D Modeler. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the rectangle object (appears in the HFSS objects tree). 13 | % Axis - axis that is normal to the rectangle object. 14 | % Start - starting location of the rectangle (one of its corners). Specify 15 | % as [sx, sy, sz]. 16 | % Width - (scalar) the width of the rectangle. If the axis is 'X' then this 17 | % represents the Y-axis size of the rectangle, and so on. 18 | % Height - (scalar) the height of the rectangle. If the axis is 'X', then 19 | % this represents the Z-axis size of the rectangle, and so on. 20 | % Units - specify as 'in', 'meter', 'mm', ... or anything else defined in 21 | % HFSS. 22 | % 23 | % Note : 24 | % ------ 25 | % Todo: a feature to add automatic holes in the rectangle object. 26 | % 27 | % Example : 28 | % --------- 29 | % fid = fopen('myantenna.vbs', 'wt'); 30 | % ... 31 | % % in this example, Y-axis size is 10in and Z-axis size is 20in. 32 | % hfssRectangle(fid, 'Rect1', 'X', [0,0,0], 10, 20, 'in'); 33 | % 34 | % ---------------------------------------------------------------------------- 35 | 36 | % ---------------------------------------------------------------------------- 37 | % This file is part of HFSS-MATLAB-API. 38 | % 39 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 40 | % under the terms of the GNU General Public License as published by the Free 41 | % Software Foundation; either version 2 of the License, or (at your option) 42 | % any later version. 43 | % 44 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 45 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 46 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 47 | % for more details. 48 | % 49 | % You should have received a copy of the GNU General Public License along with 50 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 51 | % Place, Suite 330, Boston, MA 02111-1307 USA 52 | % 53 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 54 | % ---------------------------------------------------------------------------- 55 | % Width and Height follow the right-hand rule. If the Axis is Z, then Width 56 | % represents X-direction size and Height represents the Y-direction size 57 | % and so on ... 58 | function hfssRectangle(fid, Name, Axis, Start, Width, Height, Units) 59 | 60 | Transparency = 0.5; 61 | 62 | % Preamble. 63 | fprintf(fid, '\n'); 64 | fprintf(fid, 'oEditor.CreateRectangle _\n'); 65 | 66 | % Rectangle Parameters. 67 | fprintf(fid, 'Array("NAME:RectangleParameters", _\n'); 68 | fprintf(fid, '"IsCovered:=", true, _\n'); 69 | fprintf(fid, '"XStart:=", "%f%s", _\n', Start(1), Units); 70 | fprintf(fid, '"YStart:=", "%f%s", _\n', Start(2), Units); 71 | fprintf(fid, '"ZStart:=", "%f%s", _\n', Start(3), Units); 72 | 73 | fprintf(fid, '"Width:=", "%f%s", _\n', Width, Units); 74 | fprintf(fid, '"Height:=", "%f%s", _\n', Height, Units); 75 | 76 | fprintf(fid, '"WhichAxis:=", "%s"), _\n', upper(Axis)); 77 | 78 | % Rectangle Attributes. 79 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 80 | fprintf(fid, '"Name:=", "%s", _\n', Name); 81 | fprintf(fid, '"Flags:=", "", _\n'); 82 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 83 | fprintf(fid, '"Transparency:=", %d, _\n', Transparency); 84 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 85 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 86 | fprintf(fid, '"SolveInside:=", true)\n'); 87 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssRename.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssRename(fid, oldName, newName) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to rename a HFSS Object. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % oldName - the object's previous name. 12 | % newName - the object's new name. 13 | % 14 | % Note : 15 | % ------ 16 | % 17 | % Example : 18 | % --------- 19 | % fid = fopen('myantenna.vbs', 'wt'); 20 | % ... 21 | % hfssRename(fid, 'dipole1', 'dipole_one'); 22 | % 23 | % ---------------------------------------------------------------------------- 24 | 25 | % ---------------------------------------------------------------------------- 26 | % This file is part of HFSS-MATLAB-API. 27 | % 28 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 29 | % under the terms of the GNU General Public License as published by the Free 30 | % Software Foundation; either version 2 of the License, or (at your option) 31 | % any later version. 32 | % 33 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 34 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 35 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36 | % for more details. 37 | % 38 | % You should have received a copy of the GNU General Public License along with 39 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 40 | % Place, Suite 330, Boston, MA 02111-1307 USA 41 | % 42 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 43 | % ---------------------------------------------------------------------------- 44 | function hfssRename(fid, oldName, newName) 45 | 46 | fprintf(fid, '\n'); 47 | fprintf(fid, 'oEditor.ChangeProperty _\n'); 48 | fprintf(fid, 'Array("NAME:AllTabs", _\n'); 49 | fprintf(fid, 'Array("NAME:Geometry3DAttributeTab", _\n'); 50 | fprintf(fid, 'Array("NAME:PropServers", "%s"), _\n', oldName); 51 | fprintf(fid, 'Array("NAME:ChangedProps", _\n'); 52 | fprintf(fid, 'Array("NAME:Name", _\n'); 53 | fprintf(fid, '"Value:=", "%s"))))\n', newName); 54 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssRotate.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssRotate(fid, ObjectList, Axis, RotAngle) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to duplicate specified parts according to 7 | % a mirror plane. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % ObjectList - a cell-array of strings that represent the objects to be 13 | % cloned. 14 | % Axis - axis around which Object is to be rotate. 15 | % RotAngle - angle (in *deg*) over which the object is to be rotate. 16 | % 17 | % Note : 18 | % ------ 19 | % If you have used this 3D modeler feature before, then you will probably 20 | % realize that if the original object (to be cloned) has the name 'Name', 21 | % then the cloned objects will have names 'Name1', 'Name2', ... This applies 22 | % to the cloned boundaries and excitations also. 23 | % 24 | % Example : 25 | % --------- 26 | % fid = fopen('myantenna.vbs', 'wt'); 27 | % ... 28 | % 29 | % ---------------------------------------------------------------------------- 30 | 31 | % ---------------------------------------------------------------------------- 32 | % This file is part of HFSS-MATLAB-API. 33 | % 34 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 35 | % under the terms of the GNU General Public License as published by the Free 36 | % Software Foundation; either version 2 of the License, or (at your option) 37 | % any later version. 38 | % 39 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 40 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 41 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42 | % for more details. 43 | % 44 | % You should have received a copy of the GNU General Public License along with 45 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 46 | % Place, Suite 330, Boston, MA 02111-1307 USA 47 | % 48 | % Copyright 2008, Yueliang (yue_liang423@163.com) 49 | % ------------------------------------------------------------------------- 50 | % --- 51 | 52 | function hfssRotate(fid, ObjectList, Axis, RotAngle) 53 | 54 | nObjects = length(ObjectList); 55 | 56 | % Preamble. 57 | fprintf(fid, '\n'); 58 | fprintf(fid, 'oEditor.Rotate _\n'); 59 | fprintf(fid, 'Array("NAME:Selections", _\n'); 60 | 61 | % Object Selections. 62 | fprintf(fid, '"Selections:=", "'); 63 | for iObj = 1:nObjects, 64 | fprintf(fid, '%s', ObjectList{iObj}); 65 | if (iObj ~= nObjects) 66 | fprintf(fid, ','); 67 | end; 68 | end; 69 | fprintf(fid, '"), _\n'); 70 | 71 | % Duplication Around Axis. 72 | fprintf(fid, 'Array("NAME:RotateParameters", _\n'); 73 | fprintf(fid, '"RotateAxis:=", "%s", _\n', Axis); 74 | fprintf(fid, '"RotateAngle:=", "%fdeg") \n', RotAngle); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSetColor.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSetColor(fid, Object, Color) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VBScript necessary to set an object's color in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Object - name of the object whose color requires to be changed. 12 | % Color - [3x1 vector] represents the [R, G, B] components of the color. 13 | % 14 | % Note : 15 | % ------ 16 | % 17 | % Example : 18 | % --------- 19 | % fid = fopen('myantenna.vbs', 'wt'); 20 | % ... 21 | % hfssSetColor(fid, 'Substrate', [0, 64, 0]); 22 | % 23 | % ---------------------------------------------------------------------------- 24 | 25 | % ---------------------------------------------------------------------------- 26 | % This file is part of HFSS-MATLAB-API. 27 | % 28 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 29 | % under the terms of the GNU General Public License as published by the Free 30 | % Software Foundation; either version 2 of the License, or (at your option) 31 | % any later version. 32 | % 33 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 34 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 35 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36 | % for more details. 37 | % 38 | % You should have received a copy of the GNU General Public License along with 39 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 40 | % Place, Suite 330, Boston, MA 02111-1307 USA 41 | % 42 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 43 | % ---------------------------------------------------------------------------- 44 | 45 | function hfssSetColor(fid, Object, Color) 46 | 47 | fprintf(fid, '\n'); 48 | fprintf(fid, 'oEditor.ChangeProperty _\n'); 49 | fprintf(fid, '\tArray("NAME:AllTabs", _\n'); 50 | fprintf(fid, '\t\tArray("NAME:Geometry3DAttributeTab", _\n'); 51 | fprintf(fid, '\t\t\tArray("NAME:PropServers", "%s"), _\n', Object); 52 | fprintf(fid, '\t\t\tArray("NAME:ChangedProps", _\n'); 53 | fprintf(fid, '\t\t\t\tArray("NAME:Color", "R:=", %d, "G:=", %d, "B:=", %d) _\n', ... 54 | Color(1), Color(2), Color(3)); 55 | fprintf(fid, '\t\t\t) _\n'); 56 | fprintf(fid, '\t\t) _\n'); 57 | fprintf(fid, '\t) \n'); 58 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSetSolveInside.m: -------------------------------------------------------------------------------- 1 | function hfssSetSolveInside(fid, Object, solveInsideFlag) 2 | 3 | fprintf(fid, 'oEditor.ChangeProperty _\n'); 4 | fprintf(fid, '\tArray("NAME:AllTabs", _\n'); 5 | fprintf(fid, '\t\tArray("NAME:Geometry3DAttributeTab", _\n'); 6 | fprintf(fid, '\t\t\tArray("NAME:PropServers", "%s"), _\n', Object); 7 | fprintf(fid, '\t\t\tArray("NAME:ChangedProps", _\n'); 8 | if (solveInsideFlag) 9 | fprintf(fid, '\t\t\t\tArray("NAME:Solve Inside", "Value:=", true) _\n'); 10 | else 11 | fprintf(fid, '\t\t\t\tArray("NAME:Solve Inside", "Value:=", false) _\n'); 12 | end; 13 | fprintf(fid, '\t\t\t\t) _\n'); 14 | fprintf(fid, '\t\t\t) _\n'); 15 | fprintf(fid, '\t\t) \n'); 16 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSetTransparency.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSetTransparency(fid, ObjectList, Value) 3 | % 4 | % Description 5 | % ----------- 6 | % Creates the VB Script necessary to set the transparency of the given set of 7 | % objects to a given value. 8 | % 9 | % Parameters 10 | % ---------- 11 | % fid - file identifier of the HFSS script file. 12 | % ObjectList - a cell-array of objects whose transparency needs to be set. 13 | % Value - the value of the objects transparency (can be between 0 and 1). 14 | % 15 | % Example 16 | % ------- 17 | % hfssSetTransparency(fid, {'AirBox'}, 0.95); 18 | % ---------------------------------------------------------------------------- 19 | 20 | % ---------------------------------------------------------------------------- 21 | % This file is part of HFSS-MATLAB-API. 22 | % 23 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 24 | % under the terms of the GNU General Public License as published by the Free 25 | % Software Foundation; either version 2 of the License, or (at your option) 26 | % any later version. 27 | % 28 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 29 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 30 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 31 | % for more details. 32 | % 33 | % You should have received a copy of the GNU General Public License along with 34 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 35 | % Place, Suite 330, Boston, MA 02111-1307 USA 36 | % 37 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 38 | % ---------------------------------------------------------------------------- 39 | 40 | function hfssSetTransparency(fid, ObjectList, Value) 41 | 42 | % arguments processing. 43 | if (nargin < 3) 44 | erro('non-enough arguments !'); 45 | end; 46 | 47 | if ((Value < 0) | (Value > 1)) 48 | error('transparency must be between 0 and 1!'); 49 | end; 50 | 51 | if (~iscell(ObjectList)) 52 | error('ObjectList must be a cell-array of objects !'); 53 | end; 54 | 55 | nObj = length(ObjectList); 56 | 57 | fprintf(fid, '\n'); 58 | fprintf(fid, 'oEditor.ChangeProperty _\n'); 59 | fprintf(fid, 'Array("NAME:AllTabs", _\n'); 60 | fprintf(fid, '\tArray("NAME:Geometry3DAttributeTab", _\n'); 61 | fprintf(fid, '\t\tArray("NAME:PropServers",'); 62 | for iO = 1:nObj-1, 63 | fprintf(fid, '"%s", ', ObjectList{i}); 64 | end; 65 | fprintf(fid, '"%s"), _\n', ObjectList{nObj}); 66 | fprintf(fid, '\t\tArray("NAME:ChangedProps", _\n'); 67 | fprintf(fid, '\t\t\tArray("NAME:Transparent", "Value:=", %f) _\n', Value); 68 | fprintf(fid, '\t\t\t) _\n'); 69 | fprintf(fid, '\t\t) _\n'); 70 | fprintf(fid, '\t)\n'); 71 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSphere.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSphere(fid, Name, Center, Radius, Units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to create a sphere in HFSS. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % Name - name of the sphere (appears in HFSS). 12 | % Center - center of the sphere (specify as [cx, cy, cz]) 13 | % Radius - radius of the sphere (scalar) 14 | % Units - specify as 'in', 'm', 'meter' or anything defined in HFSS. 15 | % 16 | % Note : 17 | % ------ 18 | % 19 | % Example : 20 | % --------- 21 | % fid = fopen('myantenna.vbs', 'wt'); 22 | % ... 23 | % hfssSphere(fid, 'Sphere1', [0,0,0], 1, 'meter'); 24 | % 25 | % ---------------------------------------------------------------------------- 26 | 27 | % ---------------------------------------------------------------------------- 28 | % This file is part of HFSS-MATLAB-API. 29 | % 30 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 31 | % under the terms of the GNU General Public License as published by the Free 32 | % Software Foundation; either version 2 of the License, or (at your option) 33 | % any later version. 34 | % 35 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 36 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 37 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38 | % for more details. 39 | % 40 | % You should have received a copy of the GNU General Public License along with 41 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 42 | % Place, Suite 330, Boston, MA 02111-1307 USA 43 | % 44 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 45 | % ---------------------------------------------------------------------------- 46 | function hfssSphere(fid, Name, Center, Radius, Units) 47 | 48 | % Preamble 49 | fprintf(fid, '\n'); 50 | fprintf(fid, 'oEditor.CreateSphere _\n'); 51 | fprintf(fid, 'Array("NAME:SphereParameters", _\n'); 52 | 53 | % Center and Radius. 54 | fprintf(fid, '"XCenter:=", "%f%s", _\n' , Center(1), Units); 55 | fprintf(fid, '"YCenter:=", "%f%s", _\n' , Center(2), Units); 56 | fprintf(fid, '"ZCenter:=", "%f%s", _\n' , Center(3), Units); 57 | fprintf(fid, '"Radius:=" , "%f%s"), _\n', Radius, Units); 58 | 59 | % Attributes. 60 | fprintf(fid, 'Array("NAME:Attributes", _\n'); 61 | fprintf(fid, '"Name:=", "%s", _\n', Name); 62 | fprintf(fid, '"Flags:=", "", _\n'); 63 | fprintf(fid, '"Color:=", "(132 132 193)", _\n'); 64 | fprintf(fid, '"Transparency:=", 0, _\n'); 65 | fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n'); 66 | fprintf(fid, '"MaterialName:=", "vacuum", _\n'); 67 | fprintf(fid, '"SolveInside:=", true)\n'); 68 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSplit.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % hfssSplit(fid, splitplane, side, varargin) 3 | % 4 | % Description: 5 | % ------------ 6 | % Creates the necessary VB script to split specified objects along a palne. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % varargin - names of the objects that need to be splited. It can be specified 12 | % either as a single cell array of strings, or several individual 13 | % cell strings containing a single object name (see example ...) 14 | % splitplane - the specified plane such as 'XY','YZ' and 'ZX'. 15 | % side - the part you want to remain. Possible values are 'Both', 16 | % 'PositiveOnly','NegativeOnly'. 17 | % 18 | % Example : 19 | % --------- 20 | % fid = fopen('myantenna.vbs', 'wt'); 21 | % ... 22 | % hfssSplit(fid, 'XY', 'PositiveOnly', {'one','two',...}); 23 | % 24 | % ---------------------------------------------------------------------------- 25 | 26 | % ---------------------------------------------------------------------------- 27 | % This file is part of HFSS-MATLAB-API. 28 | % 29 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 30 | % under the terms of the GNU General Public License as published by the Free 31 | % Software Foundation; either version 2 of the License, or (at your option) 32 | % any later version. 33 | % 34 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 35 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 36 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37 | % for more details. 38 | % 39 | % You should have received a copy of the GNU General Public License along with 40 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 41 | % Place, Suite 330, Boston, MA 02111-1307 USA 42 | % 43 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 44 | % ------------------------------------------------------------------------- 45 | 46 | function hfssSplit(fid, splitplane, side, varargin) 47 | 48 | % Preamble. 49 | fprintf(fid, '\n'); 50 | fprintf(fid, 'oEditor.Split _\n'); 51 | fprintf(fid, 'Array("NAME:Selections", _\n'); 52 | fprintf(fid, '"Selections:=", '); 53 | 54 | % If the first argument is a cell then it contains a cell of strings that must 55 | % be united, else each argument is a cell. 56 | if (iscell(varargin{1})) 57 | Objects = varargin{1}; 58 | else 59 | Objects = varargin; 60 | end; 61 | 62 | % Total # of Objects. 63 | nObjects = length(Objects); 64 | 65 | % Add the Objects. 66 | fprintf(fid, '"'); 67 | for iP = 1:nObjects-1, 68 | fprintf(fid, '%s,', Objects{iP}); 69 | end; 70 | fprintf(fid, '%s"), _\n', Objects{nObjects}); 71 | 72 | % Postamble. 73 | fprintf(fid, 'Array("NAME:SplitToParameters", "CoordinateSystemID:=", -1, _\n'); 74 | fprintf(fid, '"SplitPlane:=", "%s", _\n', splitplane); 75 | fprintf(fid, '"WhichSide:=", "%s", _\n', side); 76 | fprintf(fid, '"SplitCrossingObjectsOnly:=", false) \n'); 77 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSubtract.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % hfssSubtract(fid, blankParts, toolParts) 3 | % 4 | % Description: 5 | % ------------ 6 | % Creates the necessary VB script to subtract a set of tool parts from a set 7 | % of blank parts, a.k.a., will produce blank parts - tool parts. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % blankParts - a cell array of strings that contain the blank parts. 13 | % toolParts - a cell array of strings that contain the tool parts. 14 | % 15 | % Example : 16 | % --------- 17 | % fid = fopen('myantenna.vbs', 'wt'); 18 | % ... 19 | % hfssSubtract(fid, {'BigPlate'}, {'SmallPlate'}); 20 | % 21 | % ---------------------------------------------------------------------------- 22 | 23 | % ---------------------------------------------------------------------------- 24 | % This file is part of HFSS-MATLAB-API. 25 | % 26 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 27 | % under the terms of the GNU General Public License as published by the Free 28 | % Software Foundation; either version 2 of the License, or (at your option) 29 | % any later version. 30 | % 31 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 32 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 33 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34 | % for more details. 35 | % 36 | % You should have received a copy of the GNU General Public License along with 37 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 38 | % Place, Suite 330, Boston, MA 02111-1307 USA 39 | % 40 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 41 | % ---------------------------------------------------------------------------- 42 | % Will result in blankParts - toolParts. 43 | function hfssSubtract(fid, blankParts, toolParts) 44 | 45 | % Preamble. 46 | fprintf(fid, '\n'); 47 | fprintf(fid, 'oEditor.Subtract _\n'); 48 | fprintf(fid, 'Array("NAME:Selections", _\n'); 49 | 50 | % Add the Blank Parts. 51 | fprintf(fid, '"Blank Parts:=", _\n'); 52 | if (iscell(blankParts)) 53 | nBlank = length(blankParts); 54 | fprintf(fid, '"'); 55 | for iB = 1:nBlank-1, 56 | fprintf(fid, '%s,', blankParts{iB}); 57 | end; 58 | fprintf(fid, '%s", _\n', blankParts{nBlank}); 59 | else 60 | fprintf(fid, '"%s", _\n', blankParts); 61 | end; 62 | 63 | % Add the Tool Parts. 64 | fprintf(fid, '"Tool Parts:=", _\n'); 65 | if (iscell(toolParts)) 66 | nTool = length(toolParts); 67 | fprintf(fid, '"'); 68 | for iB = 1:nTool-1, 69 | fprintf(fid, '%s,', toolParts{iB}); 70 | end; 71 | fprintf(fid, '%s"), _\n', toolParts{nTool}); 72 | else 73 | fprintf(fid, '"%s"), _\n', toolParts); 74 | end; 75 | 76 | % Post-Amble. 77 | fprintf(fid, 'Array("NAME:SubtractParameters", _\n'); 78 | fprintf(fid, '"KeepOriginals:=", false) \n'); 79 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSubtract1 .m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % hfssSubtract(fid, blankParts, toolParts) 3 | % 4 | % Description: 5 | % ------------ 6 | % Creates the necessary VB script to subtract a set of tool parts from a set 7 | % of blank parts, a.k.a., will produce blank parts - tool parts. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % blankParts - a cell array of strings that contain the blank parts. 13 | % toolParts - a cell array of strings that contain the tool parts. 14 | % 15 | % Example : 16 | % --------- 17 | % fid = fopen('myantenna.vbs', 'wt'); 18 | % ... 19 | % hfssSubtract(fid, {'BigPlate'}, {'SmallPlate'}); 20 | % 21 | % ---------------------------------------------------------------------------- 22 | 23 | % ---------------------------------------------------------------------------- 24 | % This file is part of HFSS-MATLAB-API. 25 | % 26 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 27 | % under the terms of the GNU General Public License as published by the Free 28 | % Software Foundation; either version 2 of the License, or (at your option) 29 | % any later version. 30 | % 31 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 32 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 33 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34 | % for more details. 35 | % 36 | % You should have received a copy of the GNU General Public License along with 37 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 38 | % Place, Suite 330, Boston, MA 02111-1307 USA 39 | % 40 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 41 | % ---------------------------------------------------------------------------- 42 | % Will result in blankParts - toolParts. 43 | function hfssSubtract1(fid, blankParts, toolParts) 44 | 45 | % Preamble. 46 | fprintf(fid, '\n'); 47 | fprintf(fid, 'oEditor.Subtract _\n'); 48 | fprintf(fid, 'Array("NAME:Selections", _\n'); 49 | 50 | % Add the Blank Parts. 51 | fprintf(fid, '"Blank Parts:=", _\n'); 52 | if (iscell(blankParts)) 53 | nBlank = length(blankParts); 54 | fprintf(fid, '"'); 55 | for iB = 1:nBlank-1, 56 | fprintf(fid, '%s,', blankParts{iB}); 57 | end; 58 | fprintf(fid, '%s", _\n', blankParts{nBlank}); 59 | else 60 | fprintf(fid, '"%s", _\n', blankParts); 61 | end; 62 | 63 | % Add the Tool Parts. 64 | fprintf(fid, '"Tool Parts:=", _\n'); 65 | if (iscell(toolParts)) 66 | nTool = length(toolParts); 67 | fprintf(fid, '"'); 68 | for iB = 1:nTool-1, 69 | fprintf(fid, '%s,', toolParts{iB}); 70 | end; 71 | fprintf(fid, '%s"), _\n', toolParts{nTool}); 72 | else 73 | fprintf(fid, '"%s"), _\n', toolParts); 74 | end; 75 | 76 | % Post-Amble. 77 | fprintf(fid, 'Array("NAME:SubtractParameters", _\n'); 78 | fprintf(fid, '"KeepOriginals:=", true) \n'); 79 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSweepAlongPath.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSweepAlongPath(fid, Object) 3 | % 4 | % Description: 5 | % ------------ 6 | % Creates the VB Script necessary to sweep a 2D object around the given axis 7 | % to create a 3D object. 8 | % 9 | % Parameters: 10 | % ----------- 11 | % fid - file identifier of the HFSS script file. 12 | % Object - name of the Object to be sweeped. 13 | % 14 | % ---------------------------------------------------------------------------- 15 | % ---------------------------------------------------------------------------- 16 | % This file is part of HFSS-MATLAB-API. 17 | % 18 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 19 | % under the terms of the GNU General Public License as published by the Free 20 | % Software Foundation; either version 2 of the License, or (at your option) 21 | % any later version. 22 | % 23 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 24 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 25 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 26 | % for more details. 27 | % 28 | % You should have received a copy of the GNU General Public License along with 29 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 30 | % Place, Suite 330, Boston, MA 02111-1307 USA 31 | % 32 | % Copyright 2008, Yueliang (yue_liang423@163.com) 33 | % ------------------------------------------------------------------------- 34 | function hfssSweepAlongPath(fid, Object) 35 | 36 | fprintf(fid, '\n'); 37 | fprintf(fid, 'oEditor.SweepAlongPath _\n'); 38 | fprintf(fid, ' Array("NAME:Selections", "Selections:=", "%s,%s"), _\n', Object{1},Object{2}); 39 | fprintf(fid, ' Array("NAME:PathSweepParameters", _\n'); 40 | fprintf(fid, ' "CoordinateSystemID:=", -1, _\n'); 41 | fprintf(fid, ' "DraftAngle:=", "0deg", _\n'); 42 | fprintf(fid, ' "DraftType:=", "Round", _\n'); 43 | fprintf(fid, ' "CheckFaceFaceIntersection:=", false, _\n'); 44 | fprintf(fid, ' "TwistAngle:=", "0deg") \n'); 45 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSweepAlongVector.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSweepAlongVector(fid, Object2D, SweepVector, Units,... 3 | % [DraftAngle = 0 deg], [DraftType = 'Round']) 4 | % 5 | % Description: 6 | % ------------ 7 | % Creates the VB Script necessary to sweep the specified 1D or 2D parts 8 | % along a vector. 9 | % 10 | % Parameters: 11 | % ----------- 12 | % fid - file identifier of the HFSS script file. 13 | % Object2D - name of the 2D Object to be sweeped. 14 | % SweepVector - the vector of the object sweep along. 15 | % DraftAngle - angle (in *deg*) to which the object's profile, or shape is 16 | % expanded (or contracted) as it is swept. 17 | % DraftType - set it to either 'Round' (default), 'Extended' or 'Natural' 18 | % (consult the HFSS Help for more info). 19 | % 20 | % ---------------------------------------------------------------------------- 21 | % ---------------------------------------------------------------------------- 22 | % This file is part of HFSS-MATLAB-API. 23 | % 24 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 25 | % under the terms of the GNU General Public License as published by the Free 26 | % Software Foundation; either version 2 of the License, or (at your option) 27 | % any later version. 28 | % 29 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 30 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 31 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 32 | % for more details. 33 | % 34 | % You should have received a copy of the GNU General Public License along with 35 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 36 | % Place, Suite 330, Boston, MA 02111-1307 USA 37 | % 38 | % Copyright 2008, Yueliang (yue_liang423@163.com) 39 | % ---------------------------------------------------------------------------- 40 | function hfssSweepAlongVector(fid, Object2D, SweepVector, Units,... 41 | DraftAngle, DraftType) 42 | 43 | % arguments processor. 44 | if (nargin < 4) 45 | error('Not enough arguments !'); 46 | elseif (nargin < 5) 47 | DraftAngle = 0; 48 | DraftType = 'Round'; 49 | elseif (nargin < 6) 50 | DraftType = 'Round'; 51 | end; 52 | 53 | % default arguments. 54 | if isempty(DraftAngle) 55 | DraftAngle = 0; 56 | end; 57 | if isempty(DraftType) 58 | DraftType = 'Round'; 59 | end; 60 | 61 | fprintf(fid, '\n'); 62 | 63 | fprintf(fid, 'oEditor.SweepAlongVector _\n'); 64 | fprintf(fid, '\tArray("NAME:Selections", "Selections:=", "%s"), _\n', Object2D); 65 | fprintf(fid, '\tArray("NAME:VectorSweepParameters", _\n'); 66 | fprintf(fid, '\t\t"CoordinateSystemID:=", -1, _\n'); 67 | fprintf(fid, '\t\t"DraftAngle:=", "%fdeg", _\n', DraftAngle); 68 | fprintf(fid, '\t\t"DraftType:=", "%s", _\n', DraftType); 69 | fprintf(fid, '\t\t"CheckFaceFaceIntersection:=", false, _\n'); 70 | fprintf(fid, '\t\t"SweepVectorX:=", "%f%s", _\n', SweepVector(1), Units); 71 | fprintf(fid, '\t\t"SweepVectorY:=", "%f%s", _\n', SweepVector(2), Units); 72 | fprintf(fid, '\t\t"SweepVectorZ:=", "%f%s") \n', SweepVector(3), Units); -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssSweepAroundAxis.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSweepAroundAxis(fid, Object2D, Axis, SweepAngle, ... 3 | % [DraftAngle = 0 deg], [DraftType = 'Round']) 4 | % 5 | % Description: 6 | % ------------ 7 | % Creates the VB Script necessary to sweep a 2D object around the given axis 8 | % to create a 3D object. 9 | % 10 | % Parameters: 11 | % ----------- 12 | % fid - file identifier of the HFSS script file. 13 | % Object2D - name of the 2D Object to be sweeped. 14 | % Axis - axis around which Object2D is to be sweeped. 15 | % SweepAngle - angle (in *deg*) over which the object is to be sweeped. 16 | % DraftAngle - angle (in *deg*) to which the object's profile, or shape is 17 | % expanded (or contracted) as it is swept. 18 | % DraftType - set it to either 'Round' (default), 'Extended' or 'Natural' 19 | % (consult the HFSS Help for more info). 20 | % 21 | % ---------------------------------------------------------------------------- 22 | % ---------------------------------------------------------------------------- 23 | % This file is part of HFSS-MATLAB-API. 24 | % 25 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 26 | % under the terms of the GNU General Public License as published by the Free 27 | % Software Foundation; either version 2 of the License, or (at your option) 28 | % any later version. 29 | % 30 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 31 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 32 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33 | % for more details. 34 | % 35 | % You should have received a copy of the GNU General Public License along with 36 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 37 | % Place, Suite 330, Boston, MA 02111-1307 USA 38 | % 39 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 40 | % ---------------------------------------------------------------------------- 41 | function hfssSweepAroundAxis(fid, Object, Axis, SweepAngle, ... 42 | DraftAngle, DraftType) 43 | 44 | % arguments processor. 45 | if (nargin < 4) 46 | error('Not enough arguments !'); 47 | elseif (nargin < 5) 48 | DraftAngle = 0; 49 | DraftType = 'Round'; 50 | elseif (nargin < 6) 51 | DraftType = 'Round'; 52 | end; 53 | 54 | % default arguments. 55 | if isempty(DraftAngle) 56 | DraftAngle = 0; 57 | end; 58 | if isempty(DraftType) 59 | DraftType = 'Round'; 60 | end; 61 | 62 | fprintf(fid, '\n'); 63 | 64 | fprintf(fid, 'oEditor.SweepAroundAxis _\n'); 65 | fprintf(fid, '\tArray("NAME:Selections", "Selections:=", "%s"), _\n', Object); 66 | fprintf(fid, '\tArray("NAME:AxisSweepParameters", _\n'); 67 | fprintf(fid, '\t\t"DraftAngle:=", "%fdeg", _\n', DraftAngle); 68 | fprintf(fid, '\t\t"DraftType:=", "%s", _\n', DraftType); 69 | fprintf(fid, '\t\t"SweepAxis:=", "%s", _\n', Axis); 70 | fprintf(fid, '\t\t"SweepAngle:=", "%fdeg")\n', SweepAngle); 71 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssUncoveredCylinder.m: -------------------------------------------------------------------------------- 1 | function hfssUncoveredCylinder(fid, Name, Axis, Center, Radius, Height, Units) 2 | 3 | Center1 = Center; 4 | Center2 = Center; 5 | switch(Axis) 6 | case 'X', 7 | Center2(1) = Center2(1) + Height; 8 | case 'Y', 9 | Center2(2) = Center2(2) + Height; 10 | case 'Z', 11 | Center2(3) = Center2(3) + Height; 12 | end; 13 | 14 | % create circles 15 | cName1 = strcat(Name, '_Edge1'); 16 | cName2 = strcat(Name, '_Edge2'); 17 | hfssCircle(fid, cName1, Axis, Center1, Radius, Units, false); 18 | hfssCircle(fid, cName2, Axis, Center2, Radius, Units, false); 19 | 20 | % ... and connect them. 21 | hfssConnect(fid, {cName1, cName2}); 22 | hfssRename(fid, cName1, Name); 23 | -------------------------------------------------------------------------------- /hfss_matlab_api/3dmodeler/hfssUnite.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssUnite(fid, varargin) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary for unite a given set of objects already 7 | % present in the HFSS 3D Modeler. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % varargin - names of the objects that need to be united. It can be specified 13 | % either as a single cell array of strings, or several individual 14 | % cell strings containing a single object name (see example ...) 15 | % 16 | % Note : 17 | % ------ 18 | % 19 | % Example : 20 | % --------- 21 | % fid = fopen('myantenna.vbs', 'wt'); 22 | % ... 23 | % % Method 1. 24 | % hfssUnite(fid, {'Object1', 'Object2', Object3'}); 25 | % % ... or Method 2. 26 | % hfssUnite(fid, {'Object1'}, {'Object2'}, {'Object3'}); 27 | % 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % This file is part of HFSS-MATLAB-API. 32 | % 33 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 34 | % under the terms of the GNU General Public License as published by the Free 35 | % Software Foundation; either version 2 of the License, or (at your option) 36 | % any later version. 37 | % 38 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 39 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 40 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41 | % for more details. 42 | % 43 | % You should have received a copy of the GNU General Public License along with 44 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 45 | % Place, Suite 330, Boston, MA 02111-1307 USA 46 | % 47 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 48 | % ---------------------------------------------------------------------------- 49 | 50 | function hfssUnite(fid, varargin) 51 | 52 | % Preamble. 53 | fprintf(fid, '\n'); 54 | fprintf(fid, 'oEditor.Unite _\n'); 55 | fprintf(fid, 'Array("NAME:Selections", _\n'); 56 | fprintf(fid, '"Selections:=", '); 57 | 58 | % If the first argument is a cell then it contains a cell of strings that must 59 | % be united, else each argument is a cell. 60 | if (iscell(varargin{1})) 61 | Objects = varargin{1}; 62 | else 63 | Objects = varargin; 64 | end; 65 | 66 | % Total # of Objects. 67 | nObjects = length(Objects); 68 | 69 | % Add the Objects. 70 | fprintf(fid, '"'); 71 | for iP = 1:nObjects-1, 72 | fprintf(fid, '%s,', Objects{iP}); 73 | end; 74 | fprintf(fid, '%s"), _\n', Objects{nObjects}); 75 | 76 | % Postamble. 77 | fprintf(fid, 'Array("NAME:UniteParameters", "KeepOriginals:=", false)\n'); 78 | 79 | -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssCreateReport.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/hfss_matlab_api/analysis/hfssCreateReport.m -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssExportNetworkData.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssExportNetworkData(fid, fileName, setupName, sweepName, ... 3 | % [expFileType], [renormZ]) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary for HFSS to export the current matrix data 8 | % (S, Z, f) into a data file. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % fileName - output data file name. 14 | % setupName - the name of the Solution Setup whose solution data needs to 15 | % be exported. 16 | % sweepName - the name of the Frequency Sweep whose solution data needs to 17 | % be exported. 18 | % [expFileType] - (optional), the output file format (the default is an 19 | % m-file). Specify as: 20 | % 'h' - HFSS 8.x format (.szg) 21 | % 't' - Tab delimited spreadsheet format (.tab) 22 | % 's' - Touchstone SnP format (.sNp) 23 | % 'c' - CitiFile (.cit) 24 | % 'm' - MATLAB File (.m ) - default. 25 | % 'z' - Terminal Z0 spreadsheet. 26 | % [renormZ] - (optional), the re-normalizing impedance (if different from 27 | % 50 Ohms). The default is (ofcourse) 50. 28 | % 29 | % Note : 30 | % ------ 31 | % 32 | % Example : 33 | % --------- 34 | % fid = fopen('myantenna.vbs', 'wt'); 35 | % ... 36 | % hfssExportNetworkData(fid, 'C:\temp\tempData.m', 'Setup150MHz', ... 37 | % 'Sweep100to200MHz', 'm', 75); 38 | % 39 | % ---------------------------------------------------------------------------- 40 | 41 | % ---------------------------------------------------------------------------- 42 | % This file is part of HFSS-MATLAB-API. 43 | % 44 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 45 | % under the terms of the GNU General Public License as published by the Free 46 | % Software Foundation; either version 2 of the License, or (at your option) 47 | % any later version. 48 | % 49 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 50 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 51 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 52 | % for more details. 53 | % 54 | % You should have received a copy of the GNU General Public License along with 55 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 56 | % Place, Suite 330, Boston, MA 02111-1307 USA 57 | % 58 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 59 | % ---------------------------------------------------------------------------- 60 | 61 | function hfssExportNetworkData(fid, fileName, setupName, sweepName, ... 62 | varargin) 63 | 64 | % Export File Type - default is MATLAB. 65 | if (length(varargin) > 0) 66 | expFileType = varargin{1}; 67 | else 68 | expFileType = 'm'; 69 | end; 70 | 71 | % Renormalizing Impedance. 72 | if (length(varargin) > 1) 73 | renormZ = varargin{2}; 74 | else 75 | renormZ = 50.0; 76 | end; 77 | 78 | % Export File Type Switch. 79 | switch (expFileType) 80 | case 'h', expType = 1; 81 | case 't', expType = 2; 82 | case 's', expType = 3; 83 | case 'c', expType = 4; 84 | case 'm', expType = 7; 85 | case 'z', expType = 8; 86 | otherwise, error('Export File Type Unknown !'); 87 | end; 88 | % The usual fprintf()'s 89 | fprintf(fid, '\n'); 90 | fprintf(fid, 'Set oModule = oDesign.GetModule("Solutions")\n'); 91 | fprintf(fid, 'oModule.ExportNetworkData _\n'); 92 | fprintf(fid, ' "", _\n'); 93 | fprintf(fid, ' Array("%s:%s"), _\n', setupName, sweepName); 94 | fprintf(fid, ' %d, _\n', expType); 95 | fprintf(fid, ' "%s", _\n', fileName); 96 | fprintf(fid, ' Array("All"), _\n'); 97 | fprintf(fid, ' false, _\n'); 98 | fprintf(fid, ' %.2f \n', renormZ); 99 | % fprintf(fid, ' "", _\n'); 100 | % fprintf(fid, ' %d _\n', -1); 101 | % fprintf(fid, ' %d _\n', 0); 102 | % fprintf(fid, ' %d\n', 15); -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssExportRadiationParameters.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssExportRadiationParameters(fid, fileName, setupName, solutionName, freq) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary for HFSS to export the max quantities of a 7 | % near-field setup and,in the case of far fields,the antenna parameters to 8 | % the specified file. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % fileName - outdata data file name. 14 | % setupName - the name of the Radiation Setup whose solution data needs to 15 | % be exported. 16 | % solutionName - the name of the Solution Setup whose solution data needs to 17 | % be exported. 18 | % freq - the frequency of the design. 19 | % 20 | % Note : 21 | % ------ 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssExportNetworkData(fid, 'C:\temp\tempData.m', 'InfiniteSphere1', ... 28 | % 'horn500MHz', 0.1); 29 | % 30 | % ---------------------------------------------------------------------------- 31 | 32 | % ---------------------------------------------------------------------------- 33 | % This file is part of HFSS-MATLAB-API. 34 | % 35 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 36 | % under the terms of the GNU General Public License as published by the Free 37 | % Software Foundation; either version 2 of the License, or (at your option) 38 | % any later version. 39 | % 40 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 41 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 42 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43 | % for more details. 44 | % 45 | % You should have received a copy of the GNU General Public License along with 46 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 47 | % Place, Suite 330, Boston, MA 02111-1307 USA 48 | % 49 | % Copyright 2007, YueLiang (yue_liang423@163.com) 50 | % ---------------------------------------------------------------------------- 51 | 52 | function hfssExportRadiationParameters(fid, fileName, setupName, solutionName, freq) 53 | 54 | fprintf(fid, '\n'); 55 | fprintf(fid, 'Set oModule = oDesign.GetModule("RadField") \n'); 56 | fprintf(fid, 'oModule.ExportRadiationParametersToFile _\n'); 57 | fprintf(fid, 'Array("ExportFileName:=", _\n'); 58 | fprintf(fid, ' "%s", _\n', fileName); 59 | fprintf(fid, ' "SetupName:=", "%s", _\n', setupName); 60 | fprintf(fid, ' "IntrinsicVariationKey:=", "Freq=''%fGHz''", _\n', freq); 61 | fprintf(fid, ' "DesignVariationKey:=", "", _\n'); 62 | fprintf(fid, ' "SolutionName:=", "%s") \n', solutionName); 63 | 64 | 65 | -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssExportReport.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssExportReport(fid, designName, reportName, fileName) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary for HFSS to From a data table or plot, 7 | % generates text format, comma delimited, tab delimited, or .dat type output 8 | % files. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % designName- the name of active design. 14 | % reportName- the name of report 15 | % fileName - outdata data file name. 16 | % 17 | % Note : 18 | % ------ 19 | % 20 | % Example : 21 | % --------- 22 | % fid = fopen('myantenna.vbs', 'wt'); 23 | % ... 24 | % hfssExportNetworkData(fid, 'HFSSModel1', 'plot1', 'c:\temp\report1.dat'); 25 | % 26 | % ---------------------------------------------------------------------------- 27 | 28 | % ---------------------------------------------------------------------------- 29 | % This file is part of HFSS-MATLAB-API. 30 | % 31 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 32 | % under the terms of the GNU General Public License as published by the Free 33 | % Software Foundation; either version 2 of the License, or (at your option) 34 | % any later version. 35 | % 36 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 37 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 38 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 39 | % for more details. 40 | % 41 | % You should have received a copy of the GNU General Public License along with 42 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 43 | % Place, Suite 330, Boston, MA 02111-1307 USA 44 | % 45 | % Copyright 2007, YueLiang (yue_liang423@163.com) 46 | % ---------------------------------------------------------------------------- 47 | 48 | function hfssExportReport(fid, designName, reportName, fileName) 49 | 50 | fprintf(fid, '\n'); 51 | fprintf(fid, 'Set oDesign = Project.SetActiveDesign("%s") \n', designName); 52 | fprintf(fid, 'oDesign.ExportReport "%s", "%s" \n', reportName, fileName); -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssExportToFile.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssExportToFile(fid, reportName, fileName) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary for HFSS to From a data table or plot, 7 | % generates text format, comma delimited, tab delimited, or .dat type output 8 | % files. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % reportName- the name of report 14 | % fileName - outdata data file name. 15 | % 16 | % Note : 17 | % ------ 18 | % 19 | % Example : 20 | % --------- 21 | % fid = fopen('myantenna.vbs', 'wt'); 22 | % ... 23 | % hfssExportNetworkData(fid, 'HFSSModel1', 'plot1', 'c:\temp\report1.dat'); 24 | % 25 | % ---------------------------------------------------------------------------- 26 | 27 | % ---------------------------------------------------------------------------- 28 | % This file is part of HFSS-MATLAB-API. 29 | % 30 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 31 | % under the terms of the GNU General Public License as published by the Free 32 | % Software Foundation; either version 2 of the License, or (at your option) 33 | % any later version. 34 | % 35 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 36 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 37 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38 | % for more details. 39 | % 40 | % You should have received a copy of the GNU General Public License along with 41 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 42 | % Place, Suite 330, Boston, MA 02111-1307 USA 43 | % 44 | % Copyright 2008, YueLiang (yue_liang423@163.com) 45 | % ------------------------------------------------------------------------- 46 | % --- 47 | 48 | function hfssExportToFile(fid, reportName, fileName) 49 | fprintf(fid, '\n'); 50 | fprintf(fid, 'oModule.ExportToFile _\n'); 51 | fprintf(fid, '"%s", _\n', reportName); 52 | fprintf(fid, '"%s" \n', fileName); -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssFarFieldSphere.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssFarFieldSphere(fid, Name, TStart, TStop, TStep, PStart, PStop, PStep) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB script to creats/inserts a far-field infinite sphere 7 | % radiation setup. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % SetupName - name of the setup to be solved. 13 | % TStart - the start degree of theta 14 | % TStop - the stop degree of theta 15 | % TStep - the step of degree 16 | % PStart - the start degree of phi 17 | % PStop - the stop degree of phi 18 | % PStep - the step of phi 19 | % Note : 20 | % ------ 21 | % 22 | % Example : 23 | % --------- 24 | % fid = fopen('myantenna.vbs', 'wt'); 25 | % ... 26 | % hfssFarFieldSphere(fid, 'FFSphere', -180, 180, 2, 0, 360, 2); 27 | % ---------------------------------------------------------------------------- 28 | 29 | % ---------------------------------------------------------------------------- 30 | % This file is part of HFSS-MATLAB-API. 31 | % 32 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 33 | % under the terms of the GNU General Public License as published by the Free 34 | % Software Foundation; either version 2 of the License, or (at your option) 35 | % any later version. 36 | % 37 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 38 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 39 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40 | % for more details. 41 | % 42 | % You should have received a copy of the GNU General Public License along with 43 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 44 | % Place, Suite 330, Boston, MA 02111-1307 USA 45 | % 46 | % Copyright 2007, YueLiang (yue_liang423@163.com) 47 | % ---------------------------------------------------------------------------- 48 | 49 | function hfssFarFieldSphere(fid, Name, TStart, TStop, TStep, PStart, PStop, PStep) 50 | 51 | fprintf(fid, '\n'); 52 | fprintf(fid, 'Set oModule = oDesign.GetModule("RadField") \n'); 53 | fprintf(fid, 'oModule.InsertFarFieldSphereSetup _\n'); 54 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 55 | fprintf(fid, '"UseCustomRadiationSurface:=", false, _\n'); 56 | fprintf(fid, '"ThetaStart:=", "%ddeg", _\n', TStart); 57 | fprintf(fid, '"ThetaStop:=", "%ddeg", _\n', TStop); 58 | fprintf(fid, '"ThetaStep:=", "%ddeg", _\n', TStep); 59 | fprintf(fid, '"PhiStart:=", "%ddeg", _\n', PStart); 60 | fprintf(fid, '"PhiStop:=", "%ddeg", _\n', PStop); 61 | fprintf(fid, '"PhiStep:=", "%ddeg", _\n', PStep); 62 | fprintf(fid, '"UseLocalCS:=", false) \n'); 63 | -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssFastSweep.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/hfss_matlab_api/analysis/hfssFastSweep.m -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssInsertSolution.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssInsertSolution(fid, Name, fGHz, [maxDeltaS = 0.02], 3 | % [maxPass = 25]) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VBScript necessary to insert a Solution Setup in HFSS. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the solution setup. 13 | % fGHz - solution frequency (in GHz). 14 | % maxError - maximum error that can be tolerated (should be between 0 and 1, 15 | % default is 0.02). 16 | % maxPasses - max # of passes to be run before the simulation is declared 17 | % as 'did not converge' (default is 25). 18 | % 19 | % Note : 20 | % ------ 21 | % 22 | % Example : 23 | % --------- 24 | % fid = fopen('myantenna.vbs', 'wt'); 25 | % ... 26 | % hfssInsertSolution(fid, 'Setup750MHz', 0.75, 0.01, 100); 27 | % ---------------------------------------------------------------------------- 28 | 29 | % ---------------------------------------------------------------------------- 30 | % This file is part of HFSS-MATLAB-API. 31 | % 32 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 33 | % under the terms of the GNU General Public License as published by the Free 34 | % Software Foundation; either version 2 of the License, or (at your option) 35 | % any later version. 36 | % 37 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 38 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 39 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40 | % for more details. 41 | % 42 | % You should have received a copy of the GNU General Public License along with 43 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 44 | % Place, Suite 330, Boston, MA 02111-1307 USA 45 | % 46 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 47 | % ---------------------------------------------------------------------------- 48 | function hfssInsertSolution(fid, Name, fGHz, maxDeltaS, maxPass) 49 | 50 | % arguments processor. 51 | if (nargin < 3) 52 | error('Insufficient number of arguments !'); 53 | elseif (nargin < 4) 54 | maxDeltaS = []; 55 | maxPass = []; 56 | elseif (nargin < 5) 57 | maxPass = []; 58 | end; 59 | 60 | % defaults processing. 61 | if isempty(maxDeltaS) 62 | maxDeltaS = 0.05; 63 | end; 64 | if isempty(maxPass) 65 | maxPass = 20; 66 | end; 67 | 68 | % create the necessary script. 69 | fprintf(fid, '\n'); 70 | fprintf(fid, 'Set oModule = oDesign.GetModule("AnalysisSetup")\n'); 71 | fprintf(fid, 'oModule.InsertSetup "HfssDriven", _\n'); 72 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 73 | fprintf(fid, '"Frequency:=", "%fGHz", _\n', fGHz); 74 | fprintf(fid, '"PortsOnly:=", false, _\n'); 75 | fprintf(fid, '"maxDeltaS:=", %f, _\n', maxDeltaS); 76 | fprintf(fid, '"UseMatrixConv:=", false, _\n'); 77 | fprintf(fid, '"MaximumPasses:=", %d, _\n', maxPass); 78 | fprintf(fid, '"MinimumPasses:=", 1, _\n'); 79 | fprintf(fid, '"MinimumConvergedPasses:=", 1, _\n'); 80 | fprintf(fid, '"PercentRefinement:=", 20, _\n'); 81 | fprintf(fid, '"ReducedSolutionBasis:=", false, _\n'); 82 | fprintf(fid, '"DoLambdaRefine:=", true, _\n'); 83 | fprintf(fid, '"DoMaterialLambda:=", true, _\n'); 84 | fprintf(fid, '"Target:=", 0.3333, _\n'); 85 | fprintf(fid, '"PortAccuracy:=", 2, _\n'); 86 | fprintf(fid, '"SetPortMinMaxTri:=", false)\n'); 87 | 88 | -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssInterpolatingSweep.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssInterpolatingSweep(fid, Name, SolutionName, fStartGHz, ... 3 | % fStopGHz, [nPoints = 1000], [nMaxSols = 101], 4 | % [iTol = 0.5]) 5 | % 6 | % Description : 7 | % ------------- 8 | % Create the VB Script necessary to add an interpolating sweep to an existing 9 | % solution. 10 | % 11 | % Parameters : 12 | % ------------ 13 | % fid - file identifier of the HFSS script file. 14 | % Name - name of the interpolating sweep. 15 | % SolutionName - name of the solution to which this interpolating sweep needs 16 | % to be added. 17 | % fStartGHz - starting frequency of sweep in GHz. 18 | % fStopGHz - stop frequency of sweep in GHz. 19 | % nPoints - # of output points (defaults to 1000). 20 | % nMaxSols - max # of interpolating points that need to be solved (more 21 | % points will guarentee convergence) - defaults to 101. 22 | % iTol - interpolation tolerance (defaults to 0.5). 23 | % 24 | % Note : 25 | % ------ 26 | % 27 | % Example : 28 | % --------- 29 | % fid = fopen('myantenna.vbs', 'wt'); 30 | % ... 31 | % hfssInterpolatingSweep(fid, 'Interp600to900MHz', 'Solve750MHz', 0.6, ... 32 | % 0.9, 1000, 101, 0.5); 33 | % 34 | % ---------------------------------------------------------------------------- 35 | 36 | % ---------------------------------------------------------------------------- 37 | % This file is part of HFSS-MATLAB-API. 38 | % 39 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 40 | % under the terms of the GNU General Public License as published by the Free 41 | % Software Foundation; either version 2 of the License, or (at your option) 42 | % any later version. 43 | % 44 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 45 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 46 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 47 | % for more details. 48 | % 49 | % You should have received a copy of the GNU General Public License along with 50 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 51 | % Place, Suite 330, Boston, MA 02111-1307 USA 52 | % 53 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 54 | % ---------------------------------------------------------------------------- 55 | 56 | function hfssInterpolatingSweep(fid, Name, SolutionName, fStartGHz, ... 57 | fStopGHz, nPoints, nMaxSols, iTol) 58 | 59 | % arguments processor. 60 | if (nargin < 5) 61 | error('Insufficient # of arguments'); 62 | elseif (nargin < 6) 63 | nPoints = []; 64 | nMaxSols = []; 65 | iTol = []; 66 | elseif (nargin < 7) 67 | nMaxSols = []; 68 | iTol = []; 69 | elseif (nargin < 8) 70 | iTol = []; 71 | end; 72 | 73 | % process default arguments. 74 | if isempty(nPoints) 75 | nPoints = 1000; 76 | end; 77 | if isempty(nMaxSols) 78 | nMaxSols = 101; 79 | end; 80 | if isempty(iTol) 81 | iTol = 0.5; 82 | end; 83 | 84 | % create script. 85 | fprintf(fid, '\n'); 86 | fprintf(fid, 'Set oModule = oDesign.GetModule("AnalysisSetup")\n'); 87 | 88 | fprintf(fid, 'oModule.InsertDrivenSweep _\n'); 89 | fprintf(fid, '"%s", _\n', SolutionName); 90 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 91 | fprintf(fid, '"Type:=", "Interpolating", _\n'); 92 | fprintf(fid, '"InterpTolerance:=", %f, _\n', iTol); 93 | fprintf(fid, '"InterpMaxSolns:=", %d, _\n', nMaxSols); 94 | fprintf(fid, '"SetupType:=", "LinearCount", _\n'); 95 | fprintf(fid, '"StartFreq:=", "%fGHz", _\n', fStartGHz); 96 | fprintf(fid, '"StopFreq:=", "%fGHz", _\n', fStopGHz); 97 | fprintf(fid, '"Count:=", %d, _\n', nPoints); 98 | fprintf(fid, '"SaveFields:=", false, _\n'); 99 | fprintf(fid, '"ExtrapToDC:=", false)\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/analysis/hfssSolveSetup.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSolveSetup(fid, SetupName) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB script to solve a given solution setup. 7 | % 8 | % Parameters : 9 | % ------------ 10 | % fid - file identifier of the HFSS script file. 11 | % SetupName - name of the setup to be solved. 12 | % 13 | % Note : 14 | % ------ 15 | % 16 | % Example : 17 | % --------- 18 | % fid = fopen('myantenna.vbs', 'wt'); 19 | % ... 20 | % hfssSolveSetup(fid, 'Setup750MHz'); 21 | % ---------------------------------------------------------------------------- 22 | 23 | % ---------------------------------------------------------------------------- 24 | % This file is part of HFSS-MATLAB-API. 25 | % 26 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 27 | % under the terms of the GNU General Public License as published by the Free 28 | % Software Foundation; either version 2 of the License, or (at your option) 29 | % any later version. 30 | % 31 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 32 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 33 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34 | % for more details. 35 | % 36 | % You should have received a copy of the GNU General Public License along with 37 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 38 | % Place, Suite 330, Boston, MA 02111-1307 USA 39 | % 40 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 41 | % ---------------------------------------------------------------------------- 42 | 43 | function hfssSolveSetup(fid, SetupName) 44 | 45 | fprintf(fid, '\n'); 46 | fprintf(fid, 'oDesign.Solve _\n'); 47 | fprintf(fid, ' Array("%s") \n', SetupName); 48 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignLumpedPort.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignLumpedPort(fid, Name, ObjName, iLStart, iLEnd, Units, 3 | % [Resistance = 50.0], [Reactance = 0.0]) 4 | % 5 | % Description : 6 | % ------------- 7 | % Create the necessary VB Script to assign a Lumped Port to a given Object. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the lumped port (appears under 'Boundaries' in HFSS). 13 | % ObjName - name of the (sheet-like) object to which the lumped port is to 14 | % be assigned. 15 | % iLStart - (vector) starting point of the integration line. Specify as 16 | % [x, y, z]. 17 | % iLEnd - (vector) ending point of the integration line. Specify as 18 | % [x, y, z]. 19 | % Units - specify as 'meter', 'in', 'cm' (defined in HFSS). 20 | % [Resistance] - (scalar, optional) the port resistance (defaults to 21 | % 50.0 Ohms) 22 | % [Reactance] - (scalar, optional) the port reactance (defaults to 23 | % 0.0 Ohms) 24 | % 25 | % Note : 26 | % ------ 27 | % Integration Lines are mandatory in lumped ports. 28 | % 29 | % Example : 30 | % --------- 31 | % fid = fopen('myantenna.vbs', 'wt'); 32 | % ... 33 | % hfssAssignLumpedPort(fid, 'LumpedPort', 'GapSource', [-gapL/2, 0, 0], ... 34 | % [gapL/2, 0, 0], 'meter', 75, 0); 35 | % 36 | % ---------------------------------------------------------------------------- 37 | 38 | % ---------------------------------------------------------------------------- 39 | % This file is part of HFSS-MATLAB-API. 40 | % 41 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 42 | % under the terms of the GNU General Public License as published by the Free 43 | % Software Foundation; either version 2 of the License, or (at your option) 44 | % any later version. 45 | % 46 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 47 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 48 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 49 | % for more details. 50 | % 51 | % You should have received a copy of the GNU General Public License along with 52 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 53 | % Place, Suite 330, Boston, MA 02111-1307 USA 54 | % 55 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 56 | % ---------------------------------------------------------------------------- 57 | 58 | function hfssAssignLumpedPort(fid, Name, ObjName, iLStart, iLEnd, Units, ... 59 | Resistance, Reactance) 60 | 61 | % arguments processor. 62 | if (nargin < 6) 63 | error('Not Enough Arguments !'); 64 | elseif (nargin < 7) 65 | Resistance = []; 66 | Reactance = []; 67 | elseif (nargin < 8) 68 | Reactance = []; 69 | end; 70 | 71 | % Setup default arguments. 72 | if isempty(Resistance) 73 | Resistance = 50.0; 74 | end; 75 | 76 | if isempty(Reactance) 77 | Reactance = 0.0; 78 | end; 79 | 80 | % The usual fprintf stuff. 81 | fprintf(fid, '\n'); 82 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 83 | 84 | fprintf(fid, 'oModule.AssignLumpedPort _\n'); 85 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 86 | fprintf(fid, ' Array("NAME:Modes", _\n'); 87 | fprintf(fid, ' Array("NAME:Mode1", _\n'); 88 | fprintf(fid, ' "ModeNum:=", 1, _\n'); 89 | fprintf(fid, ' "UseIntLine:=", true, _\n'); 90 | fprintf(fid, ' Array("NAME:IntLine", _\n'); 91 | fprintf(fid, ' "Start:=", Array("%f%s", "%f%s", "%f%s"), _\n', ... 92 | iLStart(1), Units, iLStart(2), Units, iLStart(3), Units); 93 | fprintf(fid, ' "End:=", Array("%f%s", "%f%s", "%f%s") _\n', ... 94 | iLEnd(1), Units, iLEnd(2), Units, iLEnd(3), Units); 95 | fprintf(fid, ' ), _\n'); 96 | fprintf(fid, ' "CharImp:=", "Zpi" _\n'); 97 | fprintf(fid, ' ) _\n'); 98 | fprintf(fid, ' ), _\n'); 99 | fprintf(fid, ' "Resistance:=", "%fOhm", _\n', Resistance); 100 | fprintf(fid, ' "Reactance:=", "%fOhm", _\n', Reactance); 101 | fprintf(fid, ' "Objects:=", Array("%s") _\n', ObjName); 102 | fprintf(fid, ' )\n'); 103 | 104 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignPE.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignPE(fid, Name, ObjectList, [infGND = false]) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VB Script necessary to assign a PEC boundary to 7 | % the given object(s). 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the PEC boundary. This will appear under "Boundaries" 13 | % in HFSS 14 | % ObjList - a cell array of objects to which the PEC boundary condition will 15 | % be applied. 16 | % infGND - (boolean) specify as true to make the PEC represent an infinite 17 | % ground plane (default is false). 18 | % 19 | % 20 | % Note : 21 | % ------ 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssAssignPE(fid, 'GNDplane', {'AntennaGND'}, true); 28 | % 29 | % ---------------------------------------------------------------------------- 30 | 31 | % ---------------------------------------------------------------------------- 32 | % This file is part of HFSS-MATLAB-API. 33 | % 34 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 35 | % under the terms of the GNU General Public License as published by the Free 36 | % Software Foundation; either version 2 of the License, or (at your option) 37 | % any later version. 38 | % 39 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 40 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 41 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42 | % for more details. 43 | % 44 | % You should have received a copy of the GNU General Public License along with 45 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 46 | % Place, Suite 330, Boston, MA 02111-1307 USA 47 | % 48 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 49 | % ---------------------------------------------------------------------------- 50 | 51 | function hfssAssignPE(fid, Name, ObjectList, infGND) 52 | 53 | % arguments processor. 54 | if (nargin < 3) 55 | error('Insufficient # of arguments !'); 56 | elseif (nargin < 4) 57 | infGND = []; 58 | end; 59 | 60 | % default arguments. 61 | if isempty(infGND) 62 | infGND = false; 63 | end; 64 | 65 | % # of objects. 66 | nObjects = length(ObjectList); 67 | 68 | % create the necessary script. 69 | fprintf(fid, '\n'); 70 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 71 | fprintf(fid, 'oModule.AssignPerfectE _\n'); 72 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 73 | 74 | % is infinite GND ? 75 | if (infGND) 76 | fprintf(fid, '"InfGroundPlane:=", true, _\n'); 77 | else 78 | fprintf(fid, '"InfGroundPlane:=", false, _\n'); 79 | end; 80 | 81 | fprintf(fid, '"Objects:=", _\n'); 82 | fprintf(fid, 'Array('); 83 | for iObj = 1:nObjects, 84 | fprintf(fid, '"%s"', ObjectList{iObj}); 85 | if (iObj ~= nObjects) 86 | fprintf(fid, ','); 87 | end; 88 | end; 89 | fprintf(fid, '))\n'); 90 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignPE_face.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignPE_face(fid, Name, FIDList, [infGND = false]) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VB Script necessary to assign a PEC boundary to 7 | % the given object(s). 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the PEC boundary. This will appear under "Boundaries" 13 | % in HFSS 14 | % FIDList - a array of faces to which the PEC boundary condition will 15 | % be applied. 16 | % infGND - (boolean) specify as true to make the PEC represent an infinite 17 | % ground plane (default is false). 18 | % 19 | % 20 | % Note : 21 | % ------ 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssAssignPE_face(fid, 'GNDplane', [7,8], true); 28 | % 29 | % ---------------------------------------------------------------------------- 30 | 31 | % ---------------------------------------------------------------------------- 32 | % This file is part of HFSS-MATLAB-API. 33 | % 34 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 35 | % under the terms of the GNU General Public License as published by the Free 36 | % Software Foundation; either version 2 of the License, or (at your option) 37 | % any later version. 38 | % 39 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 40 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 41 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42 | % for more details. 43 | % 44 | % You should have received a copy of the GNU General Public License along with 45 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 46 | % Place, Suite 330, Boston, MA 02111-1307 USA 47 | % 48 | % Copyright 2007, YueLiang (yue_liang423@163.com) 49 | % ---------------------------------------------------------------------------- 50 | 51 | function hfssAssignPE_face(fid, Name, FIDList, infGND) 52 | 53 | % arguments processor. 54 | if (nargin < 3) 55 | error('Insufficient # of arguments !'); 56 | elseif (nargin < 4) 57 | infGND = []; 58 | end; 59 | 60 | % default arguments. 61 | if isempty(infGND) 62 | infGND = false; 63 | end; 64 | 65 | % # of objects. 66 | nFaces = length(FIDList); 67 | 68 | % create the necessary script. 69 | fprintf(fid, '\n'); 70 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 71 | fprintf(fid, 'oModule.AssignPerfectE _\n'); 72 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 73 | 74 | fprintf(fid, '"Faces:=", _\n'); 75 | fprintf(fid, 'Array('); 76 | for iF = 1:nFaces, 77 | fprintf(fid, '%d', FIDList(iF)); 78 | if (iF ~= nFaces) 79 | fprintf(fid, ','); 80 | end; 81 | end; 82 | fprintf(fid, '), _\n'); 83 | 84 | % is infinite GND ? 85 | if (infGND) 86 | fprintf(fid, '"InfGroundPlane:=", true) \n'); 87 | else 88 | fprintf(fid, '"InfGroundPlane:=", false) \n'); 89 | end; -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignRadiation.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignRadiation(fid, Name, Object) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to assign the radiation boundary condition 7 | % to a (closed) Object. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the radiation boundary condition (under HFSS). 13 | % Object - object to which the radiation boundary conditions needs to be 14 | % applied. 15 | % 16 | % Note : 17 | % ------ 18 | % This function cannot be used to apply radiation boundary conditions to 19 | % individual faces of an object. 20 | % 21 | % Example : 22 | % --------- 23 | % fid = fopen('myantenna.vbs', 'wt'); 24 | % ... 25 | % hfssAssignRadiation(fid, 'ABC', 'AirBox'); 26 | % ---------------------------------------------------------------------------- 27 | 28 | % ---------------------------------------------------------------------------- 29 | % This file is part of HFSS-MATLAB-API. 30 | % 31 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 32 | % under the terms of the GNU General Public License as published by the Free 33 | % Software Foundation; either version 2 of the License, or (at your option) 34 | % any later version. 35 | % 36 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 37 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 38 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 39 | % for more details. 40 | % 41 | % You should have received a copy of the GNU General Public License along with 42 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 43 | % Place, Suite 330, Boston, MA 02111-1307 USA 44 | % 45 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 46 | % ---------------------------------------------------------------------------- 47 | 48 | 49 | function hfssAssignRadiation(fid, Name, BoxObject) 50 | 51 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 52 | fprintf(fid, 'oModule.AssignRadiation _\n'); 53 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 54 | fprintf(fid, '"Objects:=", Array("%s"))\n', BoxObject); 55 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignRadiation_face.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignRadiation_face(fid, Name, FIDList) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VB Script necessary to assign a PEC boundary to 7 | % the given object(s). 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the Radiation boundary. This will appear under "Boundaries" 13 | % in HFSS 14 | % FIDList - a array of faces to which the Radiation boundary condition will 15 | % be applied. 16 | % 17 | % 18 | % Note : 19 | % ------ 20 | % 21 | % Example : 22 | % --------- 23 | % fid = fopen('myantenna.vbs', 'wt'); 24 | % ... 25 | % hfssAssignPE_face(fid, 'GNDplane', [7,8], true); 26 | % 27 | % ---------------------------------------------------------------------------- 28 | 29 | % ---------------------------------------------------------------------------- 30 | % This file is part of HFSS-MATLAB-API. 31 | % 32 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 33 | % under the terms of the GNU General Public License as published by the Free 34 | % Software Foundation; either version 2 of the License, or (at your option) 35 | % any later version. 36 | % 37 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 38 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 39 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40 | % for more details. 41 | % 42 | % You should have received a copy of the GNU General Public License along with 43 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 44 | % Place, Suite 330, Boston, MA 02111-1307 USA 45 | % 46 | % Copyright 2007, YueLiang (yue_liang423@163.com) 47 | % ---------------------------------------------------------------------------- 48 | 49 | function hfssAssignRadiation_face(fid, Name, FIDList) 50 | 51 | % # of objects. 52 | nFaces = length(FIDList); 53 | 54 | % create the necessary script. 55 | fprintf(fid, '\n'); 56 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup")\n'); 57 | fprintf(fid, 'oModule.AssignRadiation _\n'); 58 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 59 | 60 | fprintf(fid, '"Faces:=", _\n'); 61 | fprintf(fid, 'Array('); 62 | for iF = 1:nFaces, 63 | fprintf(fid, '%d', FIDList(iF)); 64 | if (iF ~= nFaces) 65 | fprintf(fid, ','); 66 | end; 67 | end; 68 | fprintf(fid, '), _\n'); 69 | 70 | fprintf(fid, '"IsIncidentField:=", false, _\n'); 71 | fprintf(fid, '"IsEnforcedField:=", false, _\n'); 72 | fprintf(fid, '"IsFssReference:=", false, _\n'); 73 | fprintf(fid, '"IsForPML:=", false, _\n'); 74 | fprintf(fid, '"UseAdaptiveIE:=", false) \n'); -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignWavePort.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignWavePort(fid, PortName, SheetObject, nModes, isLine, ... 3 | % intStart, intEnd, Units) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary to assign a waveport to a (sheet-like) 8 | % object. 9 | % 10 | % Parameters : 11 | % ------------ 12 | % fid - file identifier of the HFSS script file. 13 | % PortName - name of the wave port (will appear under 'Boundaries'). 14 | % SheetObject - name of the (sheet-like) object to which the wave port is 15 | % to be assigned. 16 | % nModes - # of modes. 17 | % isLine - a boolean array of length (nModes) that specifies whether the 18 | % corresponding mode has an integration line or not. 19 | % intStart - (nModes x 3 matrix) an array of vectors that represent the 20 | % starting points for the integration lines for the 21 | % respective modes (see note). 22 | % intEnd - (nModes x 3 matrix) an array of vectors that represent the 23 | % ending points for the integration lines for the 24 | % respective modes (note note). 25 | % Units - specify as either 'in', 'meter', 'mm' or anything else 26 | % defined in HFSS. 27 | % 28 | % Note : 29 | % ------ 30 | % 1. if an integration line is not required for a particular mode, then the 31 | % corresponding entries in intStart and intEnd are ignored. 32 | % 2. mostly, we will be using a single-mode and a single integration line. 33 | % 34 | % Example : 35 | % --------- 36 | % fid = fopen('myantenna.vbs', 'wt'); 37 | % ... 38 | % % single mode, no integration line specified. 39 | % hfssAssignWavePort(fid, Name, ObjectName, 1, false, [0,0,0], ... 40 | % [0,0,0], Units); 41 | % 42 | % ---------------------------------------------------------------------------- 43 | 44 | % ---------------------------------------------------------------------------- 45 | % This file is part of HFSS-MATLAB-API. 46 | % 47 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 48 | % under the terms of the GNU General Public License as published by the Free 49 | % Software Foundation; either version 2 of the License, or (at your option) 50 | % any later version. 51 | % 52 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 53 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 54 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 55 | % for more details. 56 | % 57 | % You should have received a copy of the GNU General Public License along with 58 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 59 | % Place, Suite 330, Boston, MA 02111-1307 USA 60 | % 61 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 62 | % ---------------------------------------------------------------------------- 63 | 64 | function hfssAssignWavePort(fid, PortName, SheetObject, nModes, isLine, ... 65 | intStart, intEnd, Units) 66 | 67 | % Preamble. 68 | fprintf(fid, '\n'); 69 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup") \n'); 70 | fprintf(fid, '\n'); 71 | fprintf(fid, 'oModule.AssignWavePort _\n'); 72 | fprintf(fid, 'Array( _\n'); 73 | fprintf(fid, '"NAME:%s", _\n', PortName); 74 | fprintf(fid, '"NumModes:=", %d, _\n', nModes); 75 | fprintf(fid, '"PolarizeEField:=", false, _\n'); 76 | fprintf(fid, '"DoDeembed:=", false, _\n'); 77 | fprintf(fid, '"DoRenorm:=", true, _\n'); 78 | fprintf(fid, '"RenormValue:=", "50ohm", _\n'); 79 | 80 | % Add the Mode-Lines One By One. 81 | for iM = 1:nModes, 82 | fprintf(fid, 'Array("NAME:Modes", _\n'); 83 | if (isLine(iM)) 84 | fprintf(fid, 'Array("NAME:Mode1", _\n'); 85 | fprintf(fid, '"ModeNum:=", %d, _\n', iM); 86 | fprintf(fid, '"UseIntLine:=", true, _\n'); 87 | fprintf(fid, 'Array("NAME:IntLine", _\n'); 88 | fprintf(fid, '"Start:=", _\n'); 89 | fprintf(fid, 'Array("%f%s", "%f%s", "%f%s"), _\n', ... 90 | intStart(1), Units, intStart(2), Units, ... 91 | intStart(3), Units); 92 | fprintf(fid, '"End:=", _\n'); 93 | fprintf(fid, 'Array("%f%s", "%f%s", "%f%s") _\n', ... 94 | intEnd(1), Units, intEnd(2), Units, ... 95 | intEnd(3), Units); 96 | fprintf(fid, '), _\n'); 97 | fprintf(fid, '"CharImp:=", "Zpi")'); 98 | else 99 | fprintf(fid, 'Array("NAME:Mode1", _\n'); 100 | fprintf(fid, '"ModeNum:=", %d, _\n', iM); 101 | fprintf(fid, '"UseIntLine:=", false) _\n'); 102 | end; 103 | if (iM ~= nModes) 104 | fprintf(fid, ', _\n'); 105 | end; 106 | end; 107 | fprintf(fid, '), _\n'); 108 | fprintf(fid, '"Objects:=", Array("%s")) \n', SheetObject); 109 | 110 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssAssignWavePort_face.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAssignWavePort_face(fid, PortName, FaceID, nModes, isLine, ... 3 | % intStart, intEnd, Units) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary to assign a waveport to a face. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % PortName - name of the wave port (will appear under 'Boundaries'). 13 | % FaceID - ID of the face to which the wave port is 14 | % to be assigned. 15 | % nModes - # of modes. 16 | % isLine - a boolean array of length (nModes) that specifies whether the 17 | % corresponding mode has an integration line or not. 18 | % intStart - (nModes x 3 matrix) an array of vectors that represent the 19 | % starting points for the integration lines for the 20 | % respective modes (see note). 21 | % intEnd - (nModes x 3 matrix) an array of vectors that represent the 22 | % ending points for the integration lines for the 23 | % respective modes (note note). 24 | % Units - specify as either 'in', 'meter', 'mm' or anything else 25 | % defined in HFSS. 26 | % 27 | % Note : 28 | % ------ 29 | % 1. if an integration line is not required for a particular mode, then the 30 | % corresponding entries in intStart and intEnd are ignored. 31 | % 2. mostly, we will be using a single-mode and a single integration line. 32 | % 33 | % Example : 34 | % --------- 35 | % fid = fopen('myantenna.vbs', 'wt'); 36 | % ... 37 | % % single mode, no integration line specified. 38 | % hfssAssignWavePort(fid, Name, 8, 1, false, [0,0,0], ... 39 | % [0,0,0], Units); 40 | % 41 | % ---------------------------------------------------------------------------- 42 | 43 | % ---------------------------------------------------------------------------- 44 | % This file is part of HFSS-MATLAB-API. 45 | % 46 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 47 | % under the terms of the GNU General Public License as published by the Free 48 | % Software Foundation; either version 2 of the License, or (at your option) 49 | % any later version. 50 | % 51 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 52 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 53 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 54 | % for more details. 55 | % 56 | % You should have received a copy of the GNU General Public License along with 57 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 58 | % Place, Suite 330, Boston, MA 02111-1307 USA 59 | % 60 | % Copyright 2007, YueLiang (yue_liang423@163.com) 61 | % ---------------------------------------------------------------------------- 62 | 63 | function hfssAssignWavePort_face(fid, PortName, FaceID, nModes, isLine, ... 64 | intStart, intEnd, Units) 65 | 66 | % Preamble. 67 | fprintf(fid, '\n'); 68 | fprintf(fid, 'Set oModule = oDesign.GetModule("BoundarySetup") \n'); 69 | fprintf(fid, '\n'); 70 | fprintf(fid, 'oModule.AssignWavePort _\n'); 71 | fprintf(fid, 'Array( _\n'); 72 | fprintf(fid, '"NAME:%s", _\n', PortName); 73 | fprintf(fid, '"Faces:=", Array(%d), _\n', FaceID); 74 | fprintf(fid, '"NumModes:=", %d, _\n', nModes); 75 | fprintf(fid, '"PolarizeEField:=", false, _\n'); 76 | fprintf(fid, '"DoDeembed:=", false, _\n'); 77 | fprintf(fid, '"DoRenorm:=", false, _\n'); 78 | 79 | % Add the Mode-Lines One By One. 80 | for iM = 1:nModes, 81 | fprintf(fid, 'Array("NAME:Modes", _\n'); 82 | if (isLine(iM)) 83 | fprintf(fid, 'Array("NAME:Mode1", _\n'); 84 | fprintf(fid, '"ModeNum:=", %d, _\n', iM); 85 | fprintf(fid, '"UseIntLine:=", true, _\n'); 86 | fprintf(fid, 'Array("NAME:IntLine", _\n'); 87 | fprintf(fid, '"Start:=", _\n'); 88 | fprintf(fid, 'Array("%f%s", "%f%s", "%f%s"), _\n', ... 89 | intStart(1), Units, intStart(2), Units, ... 90 | intStart(3), Units); 91 | fprintf(fid, '"End:=", _\n'); 92 | fprintf(fid, 'Array("%f%s", "%f%s", "%f%s") _\n', ... 93 | intEnd(1), Units, intEnd(2), Units, ... 94 | intEnd(3), Units); 95 | fprintf(fid, '), _\n'); 96 | fprintf(fid, '"CharImp:=", "Zpi")'); 97 | else 98 | fprintf(fid, 'Array("NAME:Mode1", _\n'); 99 | fprintf(fid, '"ModeNum:=", %d, _\n', iM); 100 | fprintf(fid, '"UseIntLine:=", false) _\n'); 101 | end; 102 | if (iM ~= nModes) 103 | fprintf(fid, ', _\n'); 104 | end; 105 | end; 106 | fprintf(fid, ')) \n'); -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssCircularPort.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCircularPort(fid, Name, ObjectName, Axis, Center, Radius, ... 3 | % Units) 4 | % 5 | % Description : 6 | % ------------- 7 | % Creates the VB Script necessary to create a circular wave port. This 8 | % function generates BOTH the circle object AND the wave port. This function 9 | % is useful to add ports at the end of co-axial cables. 10 | % 11 | % Parameters : 12 | % ------------ 13 | % fid - file identifier of the HFSS script file. 14 | % Name - name of the wave port. 15 | % ObjectName - name of the circle to which the wave port is assigned. 16 | % Axis - axis of the circle. Specify as 'X', 'Y' or 'Z'. 17 | % Center - the center of the circle. 18 | % Radius - raduis of the circle. 19 | % Units - specify as either 'mm', 'meter', 'in', ... or anything else 20 | % defined in HFSS. 21 | % 22 | % Note : 23 | % ------ 24 | % No integration lines are added and a single-mode solution is assumed. 25 | % 26 | % Example : 27 | % --------- 28 | % fid = fopen('myantenna.vbs', 'wt'); 29 | % ... 30 | % hfssCircularPort(fid, 'Port1', 'CoaxSource', 'Z', [10, 0, 0], 0.1, 'in'); 31 | % 32 | % ---------------------------------------------------------------------------- 33 | 34 | % ---------------------------------------------------------------------------- 35 | % This file is part of HFSS-MATLAB-API. 36 | % 37 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 38 | % under the terms of the GNU General Public License as published by the Free 39 | % Software Foundation; either version 2 of the License, or (at your option) 40 | % any later version. 41 | % 42 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 43 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 44 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45 | % for more details. 46 | % 47 | % You should have received a copy of the GNU General Public License along with 48 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 49 | % Place, Suite 330, Boston, MA 02111-1307 USA 50 | % 51 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 52 | % ---------------------------------------------------------------------------- 53 | function hfssCircularPort(fid, Name, ObjectName, Axis, Center, Radius, Units) 54 | 55 | hfssCircle(fid, ObjectName, Axis, Center, Radius, Units); 56 | hfssAssignWavePort(fid, Name, ObjectName, 1, false, [0,0,0], ... 57 | [0,0,0], Units); 58 | -------------------------------------------------------------------------------- /hfss_matlab_api/boundary/hfssEditSources.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssEditSources(fid, num, name, mag, phase) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates the VB Script necessary to indicates which source excitations 7 | % should be used for fields post processing. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % num - the number of source. 13 | % name - a source name is typically the name of the associated 14 | % excitation. 15 | % mag - this gives the mag of the complex excitation for each 16 | % source. 17 | % phase - this gives the phase in degrees of the complex excitation 18 | % for each source. 19 | % 20 | % Note : 21 | % ------ 22 | % 1. if an integration line is not required for a particular mode, then the 23 | % corresponding entries in intStart and intEnd are ignored. 24 | % 2. mostly, we will be using a single-mode and a single integration line. 25 | % 26 | % Example : 27 | % --------- 28 | % fid = fopen('myantenna.vbs', 'wt'); 29 | % ... 30 | % 31 | % ---------------------------------------------------------------------------- 32 | 33 | % ---------------------------------------------------------------------------- 34 | % This file is part of HFSS-MATLAB-API. 35 | % 36 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 37 | % under the terms of the GNU General Public License as published by the Free 38 | % Software Foundation; either version 2 of the License, or (at your option) 39 | % any later version. 40 | % 41 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 42 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 43 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 44 | % for more details. 45 | % 46 | % You should have received a copy of the GNU General Public License along with 47 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 48 | % Place, Suite 330, Boston, MA 02111-1307 USA 49 | % 50 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 51 | % ------------------------------------------------------------------------- 52 | % --- 53 | function hfssEditSources(fid, num, name, mag, phase) 54 | 55 | % preamble 56 | fprintf(fid, '\n'); 57 | fprintf(fid, 'Set oModule = oDesign.GetModule("Solutions") \n'); 58 | fprintf(fid, 'oModule.EditSources "NoIncidentWave", _\n'); 59 | fprintf(fid, 'Array("NAME:Names", _\n'); 60 | for i = 1:num-1 61 | fprintf(fid, '"%s", _\n', name{i}); 62 | end 63 | fprintf(fid, '"%s"), Array("NAME:Modes", _\n', name{num}); 64 | for i = 1:num-1 65 | fprintf(fid, '1, '); 66 | end 67 | fprintf(fid, '1), Array("NAME:Magnitudes", _\n'); 68 | for i = 1:num-1 69 | fprintf(fid, '"%f", ', mag(i)); 70 | end 71 | fprintf(fid, '"%f"), Array("NAME:Phases", _\n', mag(num)); 72 | for i = 1:num-1 73 | fprintf(fid, '"%fdeg", ', phase(i)); 74 | end 75 | fprintf(fid, '"%fdeg"), Array("NAME:Terminated"), _\n', phase(num)); 76 | fprintf(fid, 'Array("NAME:Impedances") \n'); -------------------------------------------------------------------------------- /hfss_matlab_api/contrib/hfssSetDesign.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSetDesign(fid, designName, [designType = 'driven modal']) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the necessary VB Script to insert an HFSS Design into the Project 7 | % and set it as the active design. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % designName - name of the new design to be inserted. 13 | % designType - (Optional String) choose from the following: 14 | % 1. 'driven modal' (default) 15 | % 2. 'driven terminal' 16 | % 3. 'eigenmode' 17 | % 18 | % Note : 19 | % ------ 20 | % This function is usually called after a call to hfssOpenProject(), but 21 | % this is not necessary. 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssInsertDesign(fid, 'Dipole_SingleElement'); 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % Written by James L. McDonald 32 | % jlm88byu@gmail.com 33 | % 26 March 2005 34 | % ---------------------------------------------------------------------------- 35 | 36 | function hfssSetDesign(fid, designName) 37 | 38 | % arguments processor. 39 | if (nargin < 2) 40 | error('Insufficient number of arguments !'); 41 | end; 42 | 43 | % create the necessary script. 44 | fprintf(fid, '\n'); 45 | 46 | fprintf(fid, 'Set oDesign = oProject.SetActiveDesign("%s")\n', designName); 47 | fprintf(fid, 'Set oEditor = oDesign.SetActiveEditor("3D Modeler")\n'); -------------------------------------------------------------------------------- /hfss_matlab_api/contrib/hfssVariableChange.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssVariableChange(fid, variable, value, units) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the VB Script necessary to change the value of an existing 7 | % variable. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % variable - The name of the variable to be changed. 13 | % value - The new value for the variable (DOUBLE). 14 | % units - units of the variable (specify using either 'in', 'mm', 15 | % 'meter' or anything else defined in HFSS). 16 | % 17 | % Example : 18 | % --------- 19 | % fid = fopen('myantenna.vbs', 'wt'); 20 | % ... 21 | % % change the value of a variable. 22 | % hfssVariableChange(fid, 'radius', 5, 'cm') 23 | % 24 | % ---------------------------------------------------------------------------- 25 | 26 | % ---------------------------------------------------------------------------- 27 | % Written by James L. McDonald 28 | % jlm88byu@gmail.com 29 | % 26 March 2005 30 | % ---------------------------------------------------------------------------- 31 | 32 | function hfssVariableChange(fid, variable, value, units) 33 | 34 | % Preamble. 35 | fprintf(fid, '\n'); 36 | 37 | % Change the variable name 38 | fprintf(fid, 'oDesign.ChangeProperty _\n'); 39 | fprintf(fid, 'Array("NAME:AllTabs", _\n'); 40 | fprintf(fid, 'Array("NAME:LocalVariableTab", _\n'); 41 | fprintf(fid, 'Array("NAME:PropServers", _\n'); 42 | fprintf(fid, '"LocalVariables"), _\n'); 43 | fprintf(fid, 'Array("NAME:ChangedProps", _\n'); 44 | fprintf(fid, 'Array("NAME:%s", _\n', variable); 45 | fprintf(fid, '"Value:=", "%f%s"))))\n', value, units); -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssAddMaterial.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssAddMaterial(fid, Name, Er, bSigma, tanDelta) 3 | % 4 | % Description : 5 | % ------------- 6 | % Creates VB Script necessary to add a new material to the HFSS Materials 7 | % Manager. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % Name - name of the material to be added. 13 | % Er - dielectric constant of the material to be added. 14 | % bSigma - bulk conductivity of the material to be added (Siemens) 15 | % tanDelta - loss tangent of the material. 16 | % 17 | % Note : 18 | % ------ 19 | % If a material with the given name already exists in HFSS, this code will 20 | % have no effect and the script will continue running. A warning message will 21 | % appear in the HFSS message log. 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('Dipole.vbs', 'wt'); 26 | % ... 27 | % hfssAddMaterial(fid, 'CoaxDielectric', 2.07, 0, 0); 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % This file is part of HFSS-MATLAB-API. 32 | % 33 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 34 | % under the terms of the GNU General Public License as published by the Free 35 | % Software Foundation; either version 2 of the License, or (at your option) 36 | % any later version. 37 | % 38 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 39 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 40 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41 | % for more details. 42 | % 43 | % You should have received a copy of the GNU General Public License along with 44 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 45 | % Place, Suite 330, Boston, MA 02111-1307 USA 46 | % 47 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 48 | % ---------------------------------------------------------------------------- 49 | function hfssAddMaterial(fid, Name, Er, bSigma, tanDelta) 50 | 51 | % Preamble. 52 | fprintf(fid, '\n'); 53 | fprintf(fid, 'oProject.AddMaterial _\n'); 54 | 55 | % Name. 56 | fprintf(fid, 'Array("NAME:%s", _\n', Name); 57 | 58 | % Dielectric Properties. 59 | fprintf(fid, '"permittivity:=", "%f", _\n', Er); 60 | fprintf(fid, '"conductivity:=", "%f", _\n', bSigma); 61 | fprintf(fid, '"dielectric_loss_tangent:=", "%f")\n', tanDelta); 62 | -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssCloseActiveProject.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssCloseActiveProject(fid) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the VB Script necessary to close the active project. The unsaved 7 | % changes made so far will be IGNORED. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % 13 | % Note : 14 | % ------ 15 | % To repeat, the unsaved changes will be ignored. Use hfssSaveProject() 16 | % before this if you wish to retain all the changes that you did. 17 | % 18 | % Example : 19 | % --------- 20 | % fid = fopen('myantenna.vbs', 'wt'); 21 | % ... 22 | % hfssCloseActiveProject(fid); 23 | % 24 | % ---------------------------------------------------------------------------- 25 | 26 | % ---------------------------------------------------------------------------- 27 | % This file is part of HFSS-MATLAB-API. 28 | % 29 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 30 | % under the terms of the GNU General Public License as published by the Free 31 | % Software Foundation; either version 2 of the License, or (at your option) 32 | % any later version. 33 | % 34 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 35 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 36 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37 | % for more details. 38 | % 39 | % You should have received a copy of the GNU General Public License along with 40 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 41 | % Place, Suite 330, Boston, MA 02111-1307 USA 42 | % 43 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 44 | % ---------------------------------------------------------------------------- 45 | 46 | function hfssCloseActiveProject(fid) 47 | 48 | fprintf(fid, '\n'); 49 | fprintf(fid, 'Set oProject = oDesktop.GetActiveProject()\n'); 50 | fprintf(fid, 'oProject.Close\n'); 51 | -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssExecuteScript.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/hfss_matlab_api/general/hfssExecuteScript.m -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssInsertDesign.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssInsertDesign(fid, designName, [designType = 'driven modal']) 3 | % 4 | % Description : 5 | % ------------- 6 | % Create the necessary VB Script to insert an HFSS Design into the Project 7 | % and set it as the active design. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % designName - name of the new design to be inserted. 13 | % designType - (Optional String) choose from the following: 14 | % 1. 'driven modal' (default) 15 | % 2. 'driven terminal' 16 | % 3. 'eigenmode' 17 | % 18 | % Note : 19 | % ------ 20 | % This function is usually called after a call to either hfssNewProject() 21 | % or hfssOpenProject(), but this is not necessary. 22 | % 23 | % Example : 24 | % --------- 25 | % fid = fopen('myantenna.vbs', 'wt'); 26 | % ... 27 | % hfssInsertDesign(fid, 'Dipole_SingleElement'); 28 | % ---------------------------------------------------------------------------- 29 | 30 | % ---------------------------------------------------------------------------- 31 | % This file is part of HFSS-MATLAB-API. 32 | % 33 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 34 | % under the terms of the GNU General Public License as published by the Free 35 | % Software Foundation; either version 2 of the License, or (at your option) 36 | % any later version. 37 | % 38 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 39 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 40 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41 | % for more details. 42 | % 43 | % You should have received a copy of the GNU General Public License along with 44 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 45 | % Place, Suite 330, Boston, MA 02111-1307 USA 46 | % 47 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 48 | % ---------------------------------------------------------------------------- 49 | function hfssInsertDesign(fid, designName, designType) 50 | 51 | % arguments processor. 52 | if (nargin < 2) 53 | error('Insufficient number of arguments !'); 54 | elseif (nargin < 3) 55 | designType = []; 56 | end; 57 | 58 | % default arguments. 59 | if isempty(designType) 60 | designType = 'driven modal'; 61 | end; 62 | 63 | % create the necessary script. 64 | fprintf(fid, '\n'); 65 | fprintf(fid, 'oProject.InsertDesign "HFSS", '); 66 | fprintf(fid, '"%s", ', designName); 67 | switch (lower(designType)) 68 | case 'driven terminal', 69 | fprintf(fid, '"DrivenTerminal", ""\n'); 70 | case 'driven modal' 71 | fprintf(fid, '"DrivenModal", ""\n'); 72 | case 'eigenmode' 73 | fprintf(fid, '"Eigenmode", ""\n'); 74 | end; 75 | fprintf(fid, 'Set oDesign = oProject.SetActiveDesign("%s")\n', designName); 76 | fprintf(fid, 'Set oEditor = oDesign.SetActiveEditor("3D Modeler")\n'); 77 | -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssNewProject.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % function hfssNewProject(fid) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the necessary VBScript to create a new HFSS project 7 | % file, set it as the active project. 8 | % 9 | % Parameters: 10 | % ----------- 11 | % fid - file identifier of the VBScript File. 12 | % -------------------------------------------------------------------------- % 13 | 14 | % ---------------------------------------------------------------------------- 15 | % This file is part of HFSS-MATLAB-API. 16 | % 17 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 18 | % under the terms of the GNU General Public License as published by the Free 19 | % Software Foundation; either version 2 of the License, or (at your option) 20 | % any later version. 21 | % 22 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 23 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25 | % for more details. 26 | % 27 | % You should have received a copy of the GNU General Public License along with 28 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 29 | % Place, Suite 330, Boston, MA 02111-1307 USA 30 | % 31 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 32 | % ---------------------------------------------------------------------------- 33 | function hfssNewProject(fid) 34 | 35 | % Preamble. 36 | fprintf(fid, 'Dim oHfssApp\n'); 37 | fprintf(fid, 'Dim oDesktop\n'); 38 | fprintf(fid, 'Dim oProject\n'); 39 | fprintf(fid, 'Dim oDesign\n'); 40 | fprintf(fid, 'Dim oEditor\n'); 41 | fprintf(fid, 'Dim oModule\n'); 42 | fprintf(fid, '\n'); 43 | 44 | % Create a New Project. 45 | fprintf(fid, 'Set oHfssApp = CreateObject("AnsoftHfss.HfssScriptInterface")\n'); 46 | fprintf(fid, 'Set oDesktop = oHfssApp.GetAppDesktop()\n'); 47 | fprintf(fid, 'oDesktop.RestoreWindow\n'); 48 | fprintf(fid, 'oDesktop.NewProject\n'); 49 | 50 | % The new project created is the active project. 51 | fprintf(fid, 'Set oProject = oDesktop.GetActiveProject\n'); 52 | -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssOpenProject.m: -------------------------------------------------------------------------------- 1 | % -------------------------------------------------------------------------- % 2 | % function hfssOpenProject(fid, hfssFile) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the VB Script necessary to open a specified HFSS 7 | % project file in HFSS. The FULL PATH of the HFSS project file must be 8 | % provided for HFSS to properly open the file (and ofcourse, the file must 9 | % already exist !) 10 | % 11 | % Parameters : 12 | % ------------ 13 | % fid - file identifier for the VBScript file. 14 | % hfssFile - the (existing) HFSS project file to be opened. The file 15 | % specification must include the FULL FILE PATH and the file 16 | % extension. 17 | % 18 | % Note : 19 | % ------ 20 | % Use this function if you wish to open an already existing HFSS design and 21 | % add some MATLAB-generated VB script components into it. 22 | % 23 | % -------------------------------------------------------------------------- % 24 | 25 | % ---------------------------------------------------------------------------- 26 | % This file is part of HFSS-MATLAB-API. 27 | % 28 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 29 | % under the terms of the GNU General Public License as published by the Free 30 | % Software Foundation; either version 2 of the License, or (at your option) 31 | % any later version. 32 | % 33 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 34 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 35 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36 | % for more details. 37 | % 38 | % You should have received a copy of the GNU General Public License along with 39 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 40 | % Place, Suite 330, Boston, MA 02111-1307 USA 41 | % 42 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 43 | % ---------------------------------------------------------------------------- 44 | 45 | function hfssOpenProject(fid, hfssProjectFile) 46 | 47 | [Path, projectName, Ext] = fileparts(hfssProjectFile); 48 | 49 | % Check extension. 50 | if (~strcmp(Ext, '.aedt')) 51 | warning('File Extension is not .aedt !'); 52 | end; 53 | 54 | % Preamble. 55 | fprintf(fid, 'Dim oHfssApp\n'); 56 | fprintf(fid, 'Dim oDesktop\n'); 57 | fprintf(fid, 'Dim oProject\n'); 58 | fprintf(fid, 'Dim oDesign\n'); 59 | fprintf(fid, 'Dim oEditor\n'); 60 | fprintf(fid, 'Dim oModule\n'); 61 | fprintf(fid, '\n'); 62 | fprintf(fid, 'Set oHfssApp = CreateObject("AnsoftHfss.HfssScriptInterface")\n'); 63 | fprintf(fid, 'Set oDesktop = oHfssApp.GetAppDesktop()\n'); 64 | fprintf(fid, 'oDesktop.RestoreWindow\n'); 65 | fprintf(fid, 'oDesktop.OpenProject "%s"\n', hfssProjectFile); 66 | fprintf(fid, 'Set oProject = oDesktop.SetActiveProject("%s")\n', projectName); 67 | -------------------------------------------------------------------------------- /hfss_matlab_api/general/hfssSaveProject.m: -------------------------------------------------------------------------------- 1 | % ---------------------------------------------------------------------------- 2 | % function hfssSaveProject(fid, projectFile, [Overwrite = false]) 3 | % 4 | % Description : 5 | % ------------- 6 | % This function creates the necessary VB script to save the active HFSS 7 | % project onto a disk file. 8 | % 9 | % Parameters : 10 | % ------------ 11 | % fid - file identifier of the HFSS script file. 12 | % projectFile - full file name of the project file into which the active HFSS 13 | % project will be saved. 14 | % [Overwrite] - (boolean) if set to true will overwrite any existing file with 15 | % the same name as that specified by projectFile. 16 | % 17 | % 18 | % Note : 19 | % ------ 20 | % The active HFSS project MUST be saved prior to solving it. This is slightly 21 | % disadvantageous because we cannot create and solve projects "on-the-fly" - 22 | % i.e., in memory without creating a project file on the disk. One workaround 23 | % is to write the project to a temporary file and then delete the temporary 24 | % file after the required solution is obtained. 25 | % 26 | % Example : 27 | % --------- 28 | % fid = fopen('myantenna.vbs', 'wt'); 29 | % ... 30 | % 31 | % ---------------------------------------------------------------------------- 32 | 33 | % ---------------------------------------------------------------------------- 34 | % This file is part of HFSS-MATLAB-API. 35 | % 36 | % HFSS-MATLAB-API is free software; you can redistribute it and/or modify it 37 | % under the terms of the GNU General Public License as published by the Free 38 | % Software Foundation; either version 2 of the License, or (at your option) 39 | % any later version. 40 | % 41 | % HFSS-MATLAB-API is distributed in the hope that it will be useful, but 42 | % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 43 | % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 44 | % for more details. 45 | % 46 | % You should have received a copy of the GNU General Public License along with 47 | % Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple 48 | % Place, Suite 330, Boston, MA 02111-1307 USA 49 | % 50 | % Copyright 2004, Vijay Ramasami (rvc@ku.edu) 51 | % ---------------------------------------------------------------------------- 52 | 53 | function hfssSaveProject(fid, projectFile, Overwrite) 54 | 55 | % arguments processor. 56 | if (nargin < 2) 57 | error('Insufficient # of arguments !'); 58 | elseif (nargin < 3) 59 | Overwrite = []; 60 | end; 61 | 62 | % default arguments. 63 | if isempty(Overwrite) 64 | Overwrite = false; 65 | end; 66 | 67 | % create the script. 68 | fprintf(fid, '\n'); 69 | fprintf(fid, 'oProject.SaveAs _\n'); 70 | fprintf(fid, ' "%s", _\n', projectFile); 71 | if (Overwrite) 72 | fprintf(fid, ' true\n'); 73 | else 74 | fprintf(fid, ' false\n'); 75 | end; 76 | 77 | -------------------------------------------------------------------------------- /reconfigrable_antenna/create_model_of_single_switchArray/createModelOfSingleSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/create_model_of_single_switchArray/createModelOfSingleSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/create_model_of_single_switchArray/resources/createUnite_R_A_Model.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/create_model_of_single_switchArray/resources/createUnite_R_A_Model.m -------------------------------------------------------------------------------- /reconfigrable_antenna/create_model_of_single_switchArray/resources/exeModelForCreateModelOfSinlgeSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/create_model_of_single_switchArray/resources/exeModelForCreateModelOfSinlgeSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/getFreqOfAllSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/getFreqOfAllSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/get_write_freq_of_switchArray/getAndWriteFreqOfSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/get_write_freq_of_switchArray/getAndWriteFreqOfSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/resources/executeModelForGetAndWriteFreqOfSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/resources/executeModelForGetAndWriteFreqOfSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/resources/setupParametersOfHFSSForGetAndWriteFreqOfSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/resources/setupParametersOfHFSSForGetAndWriteFreqOfSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeFreqAndS11ForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeFreqAndS11ForTest.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeStartMessagesForGetAndWriteFreqOfSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeStartMessagesForGetAndWriteFreqOfSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeStopMessagesForGetAndWriteFreqOfSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/resources/writeStopMessagesForGetAndWriteFreqOfSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/test/myTestSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/test/myTestSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_freq_of_all_switchArray/test/testGetFreqOfAllSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_freq_of_all_switchArray/test/testGetFreqOfAllSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_message_of_single_switchArray/getMessageOfSingleSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_message_of_single_switchArray/getMessageOfSingleSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_message_of_single_switchArray/resources/executeModelForGetMessageOfSinlgeSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_message_of_single_switchArray/resources/executeModelForGetMessageOfSinlgeSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/get_message_of_single_switchArray/resources/setupParametersOfHFSSForGetMessageOfSingleSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/get_message_of_single_switchArray/resources/setupParametersOfHFSSForGetMessageOfSingleSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/GetMessageForOneFrequencyPoint.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/GetMessageForOneFrequencyPoint.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/resources/executeModelForOneFrequencyPoint.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/resources/executeModelForOneFrequencyPoint.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/resources/getFigureForOneFrequencyPoint.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/resources/getFigureForOneFrequencyPoint.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/resources/getFigureOfOneSwitchArrayForOneFrequencyPoint.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/resources/getFigureOfOneSwitchArrayForOneFrequencyPoint.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/resources/getMessageOfOneSwitchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/resources/getMessageOfOneSwitchArray.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/resources/setupParametersOfHFSSForOneFrequencyPoint.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/resources/setupParametersOfHFSSForOneFrequencyPoint.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayForOneFrequencyPoint_3_85.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayForOneFrequencyPoint_3_85.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayForOneFrequencyPoint_9_97.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayForOneFrequencyPoint_9_97.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_C_Band.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_C_Band.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_L_Band.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_L_Band.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_S_Band.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_S_Band.m -------------------------------------------------------------------------------- /reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_X_Band.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/one_frequency_point/switch_array/SwitchArrayFor_X_Band.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/model/ModelDemo.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/model/ModelDemo.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/model/createUniteReconfigurableAntennaModelForOpenProject.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/model/createUniteReconfigurableAntennaModelForOpenProject.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/model/createUniteReconfigurableAntennaModelForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/model/createUniteReconfigurableAntennaModelForTest.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/parameters_for_test/modelParametersForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/parameters_for_test/modelParametersForTest.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/parameters_for_test/setupParametersOfHFSSForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/parameters_for_test/setupParametersOfHFSSForTest.m -------------------------------------------------------------------------------- /reconfigrable_antenna/resources/switch_array/switchArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/reconfigrable_antenna/resources/switch_array/switchArray.m -------------------------------------------------------------------------------- /test/ArrayToString.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/ArrayToString.m -------------------------------------------------------------------------------- /test/TestGetFigure.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/TestGetFigure.m -------------------------------------------------------------------------------- /test/dataProcessing.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/dataProcessing.m -------------------------------------------------------------------------------- /test/executeModelForGetMessageOfSinlgeSwitchArrayByOpenProject.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/executeModelForGetMessageOfSinlgeSwitchArrayByOpenProject.m -------------------------------------------------------------------------------- /test/getRuntime.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/getRuntime.m -------------------------------------------------------------------------------- /test/other/My_GA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/other/My_GA.m -------------------------------------------------------------------------------- /test/other/fun.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/other/fun.m -------------------------------------------------------------------------------- /test/testArray.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testArray.m -------------------------------------------------------------------------------- /test/testCallMfile.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testCallMfile.m -------------------------------------------------------------------------------- /test/testCell.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testCell.m -------------------------------------------------------------------------------- /test/testCreateRAModel.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testCreateRAModel.m -------------------------------------------------------------------------------- /test/testDirectory.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testDirectory.m -------------------------------------------------------------------------------- /test/testError.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testError.m -------------------------------------------------------------------------------- /test/testExecute.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testExecute.m -------------------------------------------------------------------------------- /test/testModel.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testModel.m -------------------------------------------------------------------------------- /test/testRand.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testRand.m -------------------------------------------------------------------------------- /test/testString.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testString.m -------------------------------------------------------------------------------- /test/testWrite2Txt.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testWrite2Txt.m -------------------------------------------------------------------------------- /test/testXlswrite.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/testXlswrite.m -------------------------------------------------------------------------------- /test/test_open_project/testDemo.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/test/test_open_project/testDemo.m -------------------------------------------------------------------------------- /tools/fileDirectoryParameters_V2ForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/fileDirectoryParameters_V2ForTest.m -------------------------------------------------------------------------------- /tools/getFigureByDataFile.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/getFigureByDataFile.m -------------------------------------------------------------------------------- /tools/getFigureForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/getFigureForTest.m -------------------------------------------------------------------------------- /tools/getFreqAndS11ForTest.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/getFreqAndS11ForTest.m -------------------------------------------------------------------------------- /tools/getHFSSName.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/getHFSSName.m -------------------------------------------------------------------------------- /tools/write100Star.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Konmoron/matlab_GA/9e46a98c0ee83c0ba509e36442d32a973fed761e/tools/write100Star.m --------------------------------------------------------------------------------