SlideShare a Scribd company logo
Considers applying the boundary conditions on the boundary between two different media.
Considering er1=2 and er2=3
Use the given MATLAB code that's provided with question to calculate the following fields:
% This script allows the user to enter an electric field
% on either side of a dielectric boundary and compute the
% electric field on the other side of the boundary
%
% The boundary is assumed to be the plane z=0, with E1 the field in
% the region z >=0 and E2 the field in the region z <= 0
%
% inputs: E1 or E2, er1 and er2 (the relative permittivities of both media
% outputs: E1 or E2, the field not input by the user
clear
% prompt user for input materials
er1 = input('Enter the relative permittivity in the region z > 0...  > ');
if isempty(er1); er1 = 1; elseif er1 < 1; er1 = 1; end % check if dielectric is physical
er2 = input('Enter the relative permittivity in the region z < 0...  > ');
if isempty(er2); er2 = 1; elseif er2 < 1; er2 = 1; end % check if dielectric is physical
% prompt the user for the region
side = input('Enter the side of the interface where the electric field is known (given)...  > ');
% if user entered something other than "r" "c" or "s" set default as "r"
if isempty(side); side = 1; elseif side > 2; side = 2; end % check if dielectric is physical
if side == 1;
% prompt the user for the field
E1 = input('Enter the electric field in side 1 in the form [Ex Ey Ez]...  >');
E1n = E1(3)*[0 0 1]; % normal direction is +z
E2n = E1n*er1/er2; % e-field boundary condition for normal component
E1t = E1 - E1n; % tangential component of E1
E2t = E1t; % e-field boundary condition for tangential component
E2 = E2t + E2n;
elseif side == 2;
% prompt the user for the field
E2 = input('Enter the electric field in side 2 in the form [Ex Ey Ez]...  >');
E2n = E2(3)*[0 0 1]; % normal direction is +z
E1n = E2n*er2/er1; % e-field boundary condition for normal component
E2t = E2 - E2n; % tangential component of E2
E1t = E2t; % e-field boundary condition for tangential component
E1 = E1t + E1n;
else
disp('Invalid specification, please re-try  ');
end
% Display results
disp(sprintf('The electric fields are  E1 = (%d, %d, %d) V/m E2 = (%d, %d, %d) V/m',...
E1(1), E1(2), E1(3), E2(1), E2(2), E2(3))) 1- E2 given that E1 - 3ax + 4ay + 5a, 2- E1 given
that E2 -3ax + 4ay 5az
Solution
matlab result:
>> electricboundary
Enter the relative permittivity in the region z > 0...
> 2
Enter the relative permittivity in the region z < 0...
> 3
Enter the side of the interface where the electric field is known (given)...
> 1
Enter the electric field in side 1 in the form [Ex Ey Ez]...
>[3 4 5]
The electric fields are
E1 = (3, 4, 5) V/m
E2 = (3, 4, 3.333333e+00) V/m
>>
for side 2:
>> electricboundary
Enter the relative permittivity in the region z > 0...
> 2
Enter the relative permittivity in the region z < 0...
> 3
Enter the side of the interface where the electric field is known (given)...
> 2
Enter the electric field in side 2 in the form [Ex Ey Ez]...
>[3 4 5]
The electric fields are
E1 = (3, 4, 7.500000e+00) V/m
E2 = (3, 4, 5) V/m
MAtlab code:
% This script allows the user to enter an electric field
% on either side of a dielectric boundary and compute the
% electric field on the other side of the boundary
%
% The boundary is assumed to be the plane z=0, with E1 the field in
% the region z >=0 and E2 the field in the region z <= 0
%
% inputs: E1 or E2, er1 and er2 (the relative permittivities of both media
% outputs: E1 or E2, the field not input by the user
clear
% prompt user for input materials
er1 = input('Enter the relative permittivity in the region z > 0...  > ');
if isempty(er1); er1 = 1; elseif er1 < 1; er1 = 1; end % check if dielectric is physical
er2 = input('Enter the relative permittivity in the region z < 0...  > ');
if isempty(er2); er2 = 1; elseif er2 < 1; er2 = 1; end % check if dielectric is physical
% prompt the user for the region
side = input('Enter the side of the interface where the electric field is known (given)...  > ');
% if user entered something other than "r" "c" or "s" set default as "r"
if isempty(side); side = 1; elseif side > 2; side = 2; end % check if dielectric is physical
if side == 1;
% prompt the user for the field
E1 = input('Enter the electric field in side 1 in the form [Ex Ey Ez]...  >');
E1n = E1(3)*[0 0 1]; % normal direction is +z
E2n = E1n*er1/er2; % e-field boundary condition for normal component
E1t = E1 - E1n; % tangential component of E1
E2t = E1t; % e-field boundary condition for tangential component
E2 = E2t + E2n;
elseif side == 2;
% prompt the user for the field
E2 = input('Enter the electric field in side 2 in the form [Ex Ey Ez]...  >');
E2n = E2(3)*[0 0 1]; % normal direction is +z
E1n = E2n*er2/er1; % e-field boundary condition for normal component
E2t = E2 - E2n; % tangential component of E2
E1t = E2t; % e-field boundary condition for tangential component
E1 = E1t + E1n;
else
disp('Invalid specification, please re-try  ');
end
% Display results
disp(sprintf('The electric fields are  E1 = (%d, %d, %d) V/m E2 = (%d, %d, %d) V/m',...
E1(1), E1(2), E1(3), E2(1), E2(2), E2(3)))

More Related Content

PDF
EM Theory Term Presentation PDF Version
ZIP
EM Theory Term Presentation Keynotes Version
PDF
PDF
Presentation of an Algorithm for Secure Data Transmission based on Optimal Ro...
PDF
Optical fiber communication prof harsha sanap (1)
PPTX
Dsp GA (1).pptx
PDF
A MATLAB project on LCR circuits
DOCX
ANtenna Final.docx
EM Theory Term Presentation PDF Version
EM Theory Term Presentation Keynotes Version
Presentation of an Algorithm for Secure Data Transmission based on Optimal Ro...
Optical fiber communication prof harsha sanap (1)
Dsp GA (1).pptx
A MATLAB project on LCR circuits
ANtenna Final.docx

Similar to Considers applying the boundary conditions on the boundary between t.pdf (18)

PDF
Antenna Physical Characetristics
PDF
assignment pdd.pdf power distributiom matlab assignment
PPT
PEEC based electromagnetic simulator
PPTX
Projects on MATLAB For ECE Research Topics
PDF
3 (a) calculate thy potential at point P located a distance z above .pdf
PDF
Computational Electromagnetics For Rf And Microwave Engineering 2nd Ed David ...
PDF
This problem illustrates one of the possible pitfalls of blindly appl.pdf
PDF
Capitulo 6, 7ma edición
PDF
Design of 3x6 axial-slot array antenna on circular cylinder waveguide for 2.4...
PPTX
Computation Assignment Help
PPTX
Electrostatic field in a coaxial transmission line
PDF
Application of Differential Equation
PDF
Iterative Green's function analysis of an H-plane T-junction in a parallel-pl...
PDF
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
PPTX
Final Year Projects for ECE Using MATLAB Research Guidance
PDF
On Data Mining in Inverse Scattering Problems: Neural Networks Applied to GPR...
PDF
Final Design Project - Memo (with GUI)
PDF
Fields Lec 5&amp;6
Antenna Physical Characetristics
assignment pdd.pdf power distributiom matlab assignment
PEEC based electromagnetic simulator
Projects on MATLAB For ECE Research Topics
3 (a) calculate thy potential at point P located a distance z above .pdf
Computational Electromagnetics For Rf And Microwave Engineering 2nd Ed David ...
This problem illustrates one of the possible pitfalls of blindly appl.pdf
Capitulo 6, 7ma edición
Design of 3x6 axial-slot array antenna on circular cylinder waveguide for 2.4...
Computation Assignment Help
Electrostatic field in a coaxial transmission line
Application of Differential Equation
Iterative Green's function analysis of an H-plane T-junction in a parallel-pl...
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
Final Year Projects for ECE Using MATLAB Research Guidance
On Data Mining in Inverse Scattering Problems: Neural Networks Applied to GPR...
Final Design Project - Memo (with GUI)
Fields Lec 5&amp;6
Ad

More from alsufi1 (12)

PDF
Consider two population distributions labeled X and Y. Distribution .pdf
PDF
Consider two new ideas in motivation that managers are using.Sol.pdf
PDF
Consider the vector field F = -y,-x. Let C be the semicircle y =.pdf
PDF
Consider the sun as an isotropic radiation source. Calculate the tot.pdf
PDF
Consider the statements P There exists some x R such that f(.pdf
PDF
convert 1.625 to binarySolution 1.625 base .pdf
PDF
Contribution Margin= $13111Operating Income = $6377if volume goe.pdf
PDF
Continuous improvements will often require new organizational capabi.pdf
PDF
Construct the FM demodulator circuit with MultiSIM.Capture a scree.pdf
PDF
Construct a concept map that links “Groundwater” to major water reso.pdf
PDF
Consider the regression model yi = B0 + B1xi + . Find var(ei), wher.pdf
PDF
Consolidated Power wants to raise $15 million in new equity. The sub.pdf
Consider two population distributions labeled X and Y. Distribution .pdf
Consider two new ideas in motivation that managers are using.Sol.pdf
Consider the vector field F = -y,-x. Let C be the semicircle y =.pdf
Consider the sun as an isotropic radiation source. Calculate the tot.pdf
Consider the statements P There exists some x R such that f(.pdf
convert 1.625 to binarySolution 1.625 base .pdf
Contribution Margin= $13111Operating Income = $6377if volume goe.pdf
Continuous improvements will often require new organizational capabi.pdf
Construct the FM demodulator circuit with MultiSIM.Capture a scree.pdf
Construct a concept map that links “Groundwater” to major water reso.pdf
Consider the regression model yi = B0 + B1xi + . Find var(ei), wher.pdf
Consolidated Power wants to raise $15 million in new equity. The sub.pdf
Ad

Recently uploaded (20)

PPTX
Introduction to Building Materials
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Lesson notes of climatology university.
PDF
RMMM.pdf make it easy to upload and study
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
Cell Types and Its function , kingdom of life
PDF
IGGE1 Understanding the Self1234567891011
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
Trump Administration's workforce development strategy
PDF
advance database management system book.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Introduction to Building Materials
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Lesson notes of climatology university.
RMMM.pdf make it easy to upload and study
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Digestion and Absorption of Carbohydrates, Proteina and Fats
Cell Types and Its function , kingdom of life
IGGE1 Understanding the Self1234567891011
History, Philosophy and sociology of education (1).pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
A systematic review of self-coping strategies used by university students to ...
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
A powerpoint presentation on the Revised K-10 Science Shaping Paper
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Hazard Identification & Risk Assessment .pdf
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Trump Administration's workforce development strategy
advance database management system book.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx

Considers applying the boundary conditions on the boundary between t.pdf

  • 1. Considers applying the boundary conditions on the boundary between two different media. Considering er1=2 and er2=3 Use the given MATLAB code that's provided with question to calculate the following fields: % This script allows the user to enter an electric field % on either side of a dielectric boundary and compute the % electric field on the other side of the boundary % % The boundary is assumed to be the plane z=0, with E1 the field in % the region z >=0 and E2 the field in the region z <= 0 % % inputs: E1 or E2, er1 and er2 (the relative permittivities of both media % outputs: E1 or E2, the field not input by the user clear % prompt user for input materials er1 = input('Enter the relative permittivity in the region z > 0... > '); if isempty(er1); er1 = 1; elseif er1 < 1; er1 = 1; end % check if dielectric is physical er2 = input('Enter the relative permittivity in the region z < 0... > '); if isempty(er2); er2 = 1; elseif er2 < 1; er2 = 1; end % check if dielectric is physical % prompt the user for the region side = input('Enter the side of the interface where the electric field is known (given)... > '); % if user entered something other than "r" "c" or "s" set default as "r" if isempty(side); side = 1; elseif side > 2; side = 2; end % check if dielectric is physical if side == 1; % prompt the user for the field E1 = input('Enter the electric field in side 1 in the form [Ex Ey Ez]... >'); E1n = E1(3)*[0 0 1]; % normal direction is +z E2n = E1n*er1/er2; % e-field boundary condition for normal component E1t = E1 - E1n; % tangential component of E1 E2t = E1t; % e-field boundary condition for tangential component E2 = E2t + E2n; elseif side == 2; % prompt the user for the field E2 = input('Enter the electric field in side 2 in the form [Ex Ey Ez]... >'); E2n = E2(3)*[0 0 1]; % normal direction is +z E1n = E2n*er2/er1; % e-field boundary condition for normal component
  • 2. E2t = E2 - E2n; % tangential component of E2 E1t = E2t; % e-field boundary condition for tangential component E1 = E1t + E1n; else disp('Invalid specification, please re-try '); end % Display results disp(sprintf('The electric fields are E1 = (%d, %d, %d) V/m E2 = (%d, %d, %d) V/m',... E1(1), E1(2), E1(3), E2(1), E2(2), E2(3))) 1- E2 given that E1 - 3ax + 4ay + 5a, 2- E1 given that E2 -3ax + 4ay 5az Solution matlab result: >> electricboundary Enter the relative permittivity in the region z > 0... > 2 Enter the relative permittivity in the region z < 0... > 3 Enter the side of the interface where the electric field is known (given)... > 1 Enter the electric field in side 1 in the form [Ex Ey Ez]... >[3 4 5] The electric fields are E1 = (3, 4, 5) V/m E2 = (3, 4, 3.333333e+00) V/m >> for side 2: >> electricboundary Enter the relative permittivity in the region z > 0... > 2 Enter the relative permittivity in the region z < 0... > 3 Enter the side of the interface where the electric field is known (given)... > 2 Enter the electric field in side 2 in the form [Ex Ey Ez]...
  • 3. >[3 4 5] The electric fields are E1 = (3, 4, 7.500000e+00) V/m E2 = (3, 4, 5) V/m MAtlab code: % This script allows the user to enter an electric field % on either side of a dielectric boundary and compute the % electric field on the other side of the boundary % % The boundary is assumed to be the plane z=0, with E1 the field in % the region z >=0 and E2 the field in the region z <= 0 % % inputs: E1 or E2, er1 and er2 (the relative permittivities of both media % outputs: E1 or E2, the field not input by the user clear % prompt user for input materials er1 = input('Enter the relative permittivity in the region z > 0... > '); if isempty(er1); er1 = 1; elseif er1 < 1; er1 = 1; end % check if dielectric is physical er2 = input('Enter the relative permittivity in the region z < 0... > '); if isempty(er2); er2 = 1; elseif er2 < 1; er2 = 1; end % check if dielectric is physical % prompt the user for the region side = input('Enter the side of the interface where the electric field is known (given)... > '); % if user entered something other than "r" "c" or "s" set default as "r" if isempty(side); side = 1; elseif side > 2; side = 2; end % check if dielectric is physical if side == 1; % prompt the user for the field E1 = input('Enter the electric field in side 1 in the form [Ex Ey Ez]... >'); E1n = E1(3)*[0 0 1]; % normal direction is +z E2n = E1n*er1/er2; % e-field boundary condition for normal component E1t = E1 - E1n; % tangential component of E1 E2t = E1t; % e-field boundary condition for tangential component E2 = E2t + E2n; elseif side == 2; % prompt the user for the field E2 = input('Enter the electric field in side 2 in the form [Ex Ey Ez]... >'); E2n = E2(3)*[0 0 1]; % normal direction is +z
  • 4. E1n = E2n*er2/er1; % e-field boundary condition for normal component E2t = E2 - E2n; % tangential component of E2 E1t = E2t; % e-field boundary condition for tangential component E1 = E1t + E1n; else disp('Invalid specification, please re-try '); end % Display results disp(sprintf('The electric fields are E1 = (%d, %d, %d) V/m E2 = (%d, %d, %d) V/m',... E1(1), E1(2), E1(3), E2(1), E2(2), E2(3)))