Visually similar pcbstack objects resulting in different S parameter responses
Hi Mathworks community,
For the last couple of days I have been playing around with the antenna toolbox. I ran into a strange phenomenon when calculating the S parameters for an antenna configuration.
In my simulation, I am trying to take an antenna design and change the top layer to a parameterized version so that I can optimize the shape of the antenna. I added the pcbStack object describing the original antenna design in the attachment. The following code shows the steps I take to replace the top layer with the parameterized version:
clear all
close all
clc
% load the original antenna design
load("simplified_antenna.mat")
p.FeedViaModel = "octagon";
antenna_0 = p;
% define the parameterized version of the top layer
start = [7.74,8.73]*10^-3;
a = 0.999*10^-3;
b = 2.53*10^-3;
c = 4.1*10^-3;
d = 3.13*10^-3;
e = 1.4*10^-3;
f = 6*10^-3;
g = 1.3*10^-3;
h = 0.5*10^-3;
R = 0.35*10^-3;
ant1 = antenna.Rectangle( Length=g+h,Width=a, center=start+[-(g+h)/2,+a/2]);
ant2 = antenna.Rectangle( Length=h,Width=f+a, center=start+[-g-h/2,(a+f)/2]);
ant3 = antenna.Rectangle( Length=e,Width=a, center=start+[-g-h-e/2,a/2]);
ant4 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,a/2]);
ant5 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b/2]);
ant6 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b-a/2]);
ant7 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b-a+b/2]);
ant8 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b-a*1.5]);
ant9 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b+b-a-a+b/2]);
ant10 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b-a*2.5]);
ant11 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b+b+b-a-a-a+b/2]);
ant12 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b+b-a*3.5]);
ant13 = antenna.Rectangle( Length=a,Width=d, center=start+[-g-h-e-c+a/2,b+b+b+b-a-a-a-a+d/2]);
ant14 = antenna.Circle(center=start+[-g-h/2,f+a], Radius=R);
Newobj = ant1+ant2+ant3+ant4+ant5+ant6+ant7+ant8+ant9+ant10+ant11+ant12+ant13+ant14;
% check if the parameterized and original version are the same:
figure
show(p.Layers{1,2})
title("Original top layer")
figure
show(Newobj)
title("Parameterized top layer")
% calculate the S parameters
spar_0 = sparameters(antenna_0, (2:0.1:4)*10^9);
figure
rfplot(spar_0);
title("S parameter original design")
antenna_1 = antenna_0;
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
spar_1 = sparameters(antenna_1, (2:0.1:4)*10^9);
figure
rfplot(spar_1);
title("S parameter parameterized version 1")
antenna_2 = antenna_0;
antenna_2.Layers{1,2} = Newobj;
spar_2 = sparameters(antenna_2, (2:0.1:4)*10^9);
figure
rfplot(spar_2);
title("S parameter parameterized version 2")
To make sure that the parameterization is correct, I take two steps. First I check if the original and paramterized version look the same. The result is as follows and shows a nearly similar polygon:
After this, I calculate the S parameters of the resulting antenna design. This is where the strange phenomenon occurs. As the code shows, I add the parameterized top layer to the antenna design in two different ways: antenna_1.Layers{1,2}.Vertices = Newobj.Vertices; and antenna_2.Layers{1,2} = Newobj;. The resulting pcbStack objects are identical but give a significantly different simulation result as shown below:
My question is: How can these two simulations (version 1 and version 2) be significantly different even though the pcbStack objects corresponding to these two simulations are identical. On top of this, how do I know which of the two is the correct simulation. Am I missing a crucial difference between the two antennas designs?
My guess is that something is wrong with antenna design version 2 since the S parameter behaviour differs so much from the original antenna design’s S parameter behaviour. It is very unlikely that this huge difference is caused by the minimal difference between the original toplayer and parameterized top layer definitions.
Best regards,
Richard EveleensHi Mathworks community,
For the last couple of days I have been playing around with the antenna toolbox. I ran into a strange phenomenon when calculating the S parameters for an antenna configuration.
In my simulation, I am trying to take an antenna design and change the top layer to a parameterized version so that I can optimize the shape of the antenna. I added the pcbStack object describing the original antenna design in the attachment. The following code shows the steps I take to replace the top layer with the parameterized version:
clear all
close all
clc
% load the original antenna design
load("simplified_antenna.mat")
p.FeedViaModel = "octagon";
antenna_0 = p;
% define the parameterized version of the top layer
start = [7.74,8.73]*10^-3;
a = 0.999*10^-3;
b = 2.53*10^-3;
c = 4.1*10^-3;
d = 3.13*10^-3;
e = 1.4*10^-3;
f = 6*10^-3;
g = 1.3*10^-3;
h = 0.5*10^-3;
R = 0.35*10^-3;
ant1 = antenna.Rectangle( Length=g+h,Width=a, center=start+[-(g+h)/2,+a/2]);
ant2 = antenna.Rectangle( Length=h,Width=f+a, center=start+[-g-h/2,(a+f)/2]);
ant3 = antenna.Rectangle( Length=e,Width=a, center=start+[-g-h-e/2,a/2]);
ant4 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,a/2]);
ant5 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b/2]);
ant6 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b-a/2]);
ant7 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b-a+b/2]);
ant8 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b-a*1.5]);
ant9 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b+b-a-a+b/2]);
ant10 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b-a*2.5]);
ant11 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b+b+b-a-a-a+b/2]);
ant12 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b+b-a*3.5]);
ant13 = antenna.Rectangle( Length=a,Width=d, center=start+[-g-h-e-c+a/2,b+b+b+b-a-a-a-a+d/2]);
ant14 = antenna.Circle(center=start+[-g-h/2,f+a], Radius=R);
Newobj = ant1+ant2+ant3+ant4+ant5+ant6+ant7+ant8+ant9+ant10+ant11+ant12+ant13+ant14;
% check if the parameterized and original version are the same:
figure
show(p.Layers{1,2})
title("Original top layer")
figure
show(Newobj)
title("Parameterized top layer")
% calculate the S parameters
spar_0 = sparameters(antenna_0, (2:0.1:4)*10^9);
figure
rfplot(spar_0);
title("S parameter original design")
antenna_1 = antenna_0;
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
spar_1 = sparameters(antenna_1, (2:0.1:4)*10^9);
figure
rfplot(spar_1);
title("S parameter parameterized version 1")
antenna_2 = antenna_0;
antenna_2.Layers{1,2} = Newobj;
spar_2 = sparameters(antenna_2, (2:0.1:4)*10^9);
figure
rfplot(spar_2);
title("S parameter parameterized version 2")
To make sure that the parameterization is correct, I take two steps. First I check if the original and paramterized version look the same. The result is as follows and shows a nearly similar polygon:
After this, I calculate the S parameters of the resulting antenna design. This is where the strange phenomenon occurs. As the code shows, I add the parameterized top layer to the antenna design in two different ways: antenna_1.Layers{1,2}.Vertices = Newobj.Vertices; and antenna_2.Layers{1,2} = Newobj;. The resulting pcbStack objects are identical but give a significantly different simulation result as shown below:
My question is: How can these two simulations (version 1 and version 2) be significantly different even though the pcbStack objects corresponding to these two simulations are identical. On top of this, how do I know which of the two is the correct simulation. Am I missing a crucial difference between the two antennas designs?
My guess is that something is wrong with antenna design version 2 since the S parameter behaviour differs so much from the original antenna design’s S parameter behaviour. It is very unlikely that this huge difference is caused by the minimal difference between the original toplayer and parameterized top layer definitions.
Best regards,
Richard Eveleens Hi Mathworks community,
For the last couple of days I have been playing around with the antenna toolbox. I ran into a strange phenomenon when calculating the S parameters for an antenna configuration.
In my simulation, I am trying to take an antenna design and change the top layer to a parameterized version so that I can optimize the shape of the antenna. I added the pcbStack object describing the original antenna design in the attachment. The following code shows the steps I take to replace the top layer with the parameterized version:
clear all
close all
clc
% load the original antenna design
load("simplified_antenna.mat")
p.FeedViaModel = "octagon";
antenna_0 = p;
% define the parameterized version of the top layer
start = [7.74,8.73]*10^-3;
a = 0.999*10^-3;
b = 2.53*10^-3;
c = 4.1*10^-3;
d = 3.13*10^-3;
e = 1.4*10^-3;
f = 6*10^-3;
g = 1.3*10^-3;
h = 0.5*10^-3;
R = 0.35*10^-3;
ant1 = antenna.Rectangle( Length=g+h,Width=a, center=start+[-(g+h)/2,+a/2]);
ant2 = antenna.Rectangle( Length=h,Width=f+a, center=start+[-g-h/2,(a+f)/2]);
ant3 = antenna.Rectangle( Length=e,Width=a, center=start+[-g-h-e/2,a/2]);
ant4 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,a/2]);
ant5 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b/2]);
ant6 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b-a/2]);
ant7 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b-a+b/2]);
ant8 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b-a*1.5]);
ant9 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-c+a/2,b+b-a-a+b/2]);
ant10 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b-a*2.5]);
ant11 = antenna.Rectangle( Length=a,Width=b, center=start+[-g-h-e-a/2,b+b+b-a-a-a+b/2]);
ant12 = antenna.Rectangle( Length=c,Width=a, center=start+[-g-h-e-c/2,b+b+b+b-a*3.5]);
ant13 = antenna.Rectangle( Length=a,Width=d, center=start+[-g-h-e-c+a/2,b+b+b+b-a-a-a-a+d/2]);
ant14 = antenna.Circle(center=start+[-g-h/2,f+a], Radius=R);
Newobj = ant1+ant2+ant3+ant4+ant5+ant6+ant7+ant8+ant9+ant10+ant11+ant12+ant13+ant14;
% check if the parameterized and original version are the same:
figure
show(p.Layers{1,2})
title("Original top layer")
figure
show(Newobj)
title("Parameterized top layer")
% calculate the S parameters
spar_0 = sparameters(antenna_0, (2:0.1:4)*10^9);
figure
rfplot(spar_0);
title("S parameter original design")
antenna_1 = antenna_0;
antenna_1.Layers{1,2}.Vertices = Newobj.Vertices;
spar_1 = sparameters(antenna_1, (2:0.1:4)*10^9);
figure
rfplot(spar_1);
title("S parameter parameterized version 1")
antenna_2 = antenna_0;
antenna_2.Layers{1,2} = Newobj;
spar_2 = sparameters(antenna_2, (2:0.1:4)*10^9);
figure
rfplot(spar_2);
title("S parameter parameterized version 2")
To make sure that the parameterization is correct, I take two steps. First I check if the original and paramterized version look the same. The result is as follows and shows a nearly similar polygon:
After this, I calculate the S parameters of the resulting antenna design. This is where the strange phenomenon occurs. As the code shows, I add the parameterized top layer to the antenna design in two different ways: antenna_1.Layers{1,2}.Vertices = Newobj.Vertices; and antenna_2.Layers{1,2} = Newobj;. The resulting pcbStack objects are identical but give a significantly different simulation result as shown below:
My question is: How can these two simulations (version 1 and version 2) be significantly different even though the pcbStack objects corresponding to these two simulations are identical. On top of this, how do I know which of the two is the correct simulation. Am I missing a crucial difference between the two antennas designs?
My guess is that something is wrong with antenna design version 2 since the S parameter behaviour differs so much from the original antenna design’s S parameter behaviour. It is very unlikely that this huge difference is caused by the minimal difference between the original toplayer and parameterized top layer definitions.
Best regards,
Richard Eveleens pcbstack, sparameter MATLAB Answers — New Questions