I did an optimization in matlab for a function that describes the transmission coefficient of a 3 layered dialectric stucture with different width for each layer.
My optimization goes through interval of [0,2pi] and for every phase (360 points) give the corresponding widths for maximum transmissiom at that phase angle.
After simulating my structure in CST I get good values for the transmission but the not for the phase.
for example, for parameters values [a(1) a(2) a(3)] I get in matlab simulation phase of 0 and in CST I get 40 degrees.
What could be the problem?
does the distance of the ports from the end of the structure effect the result? (I checked and got the same result so I dont think so).
what was your optimization goal? A matching of the characteristic wave impedance, to meet the intended system impedance (of connectors, cables, ...) i.e. 50 Ω?
What do you mean with transmission? I assume the transmission coeficient S_21 is meant.
What are the three parameters "[a(1) a(2) a(3)]"?
I don't get the point with the phase angle. Is it the impedance's phase angle of your (3 layered dielectric) structur? If so, your designed wave impedance has a real and an imaginary part.
Or is the phase shift along the structure meant by the "phase angle"? If so, for which frequency was your structure designed? Have you considered dispersion effects?
According to your desired MATLAB result of 0 °, I assume the imaginary part of your characteristic wave impedance should be zero.
I don't know which trigonometric functions have been used by your optimization function, but maybe you have mixed radians with degrees (happened to me already a couple of times ;-)).
Yes when I say transmission I mean S_21.
My end goal is to build a grating metasurface with this 3 layer structure, so the optimization is for getting the widths of the layers with all the possible values of phase angles of the TM field coming out from the structure with the abs value of the coefficient to be as close as possible to 1. After ill have all the values I can build my grating by selecting the angles that I need with the coressponding widths.
[a(1) a(2) a(3)] are the widths of the structure.
The frequency is 20GHz.
For the function for my optimization I used atan2(imag(),real()).
My optimization function has complex exponantials, as so is my phase comparison function.
im have the layers in between 2 PEC plates, acting as a waveguide, and using Unitcell boundry conditions.
I assume ikz is your current with frequency dependency as well as geometrical dependency, so your electricel field results in an unit of V • m^-1.
You mentioned ε = 10, I assume ε_r = 10. Have you included the vacuum permittivity ε_0 = 8.8541878128 pF • m^-1 ?
I assume so, otherwise your geometrical dimension would not make sense.