1 | /* Class TwoWireLine
|
---|
2 | *
|
---|
3 | * Models a two parallel wire transmision line
|
---|
4 | * This is a subclass of the superclass TransmissionLine
|
---|
5 | *
|
---|
6 | * WRITTEN BY: Dr Michael Thomas Flanagan
|
---|
7 | *
|
---|
8 | * DATE: June 2007
|
---|
9 | * UPDATE: 7 April 2008
|
---|
10 | *
|
---|
11 | * DOCUMENTATION:
|
---|
12 | * See Michael T Flanagan's Java library on-line web pages:
|
---|
13 | * http://www.ee.ucl.ac.uk/~mflanaga/java/TwoWireLine.html
|
---|
14 | * http://www.ee.ucl.ac.uk/~mflanaga/java/TransmissionLine.html
|
---|
15 | *
|
---|
16 | * http://www.ee.ucl.ac.uk/~mflanaga/java/
|
---|
17 | *
|
---|
18 | * Copyright (c) 2007 - 2008 Michael Thomas Flanagan
|
---|
19 | *
|
---|
20 | * PERMISSION TO COPY:
|
---|
21 | * Permission to use, copy and modify this software and its documentation for
|
---|
22 | * NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement
|
---|
23 | * to the author, Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies.
|
---|
24 | *
|
---|
25 | * Dr Michael Thomas Flanagan makes no representations about the suitability
|
---|
26 | * or fitness of the software for any or for a particular purpose.
|
---|
27 | * Michael Thomas Flanagan shall not be liable for any damages suffered
|
---|
28 | * as a result of using, modifying or distributing this software or its derivatives.
|
---|
29 | *
|
---|
30 | ***************************************************************************************/
|
---|
31 |
|
---|
32 | package agents.anac.y2015.agentBuyogV2.flanagan.circuits;
|
---|
33 |
|
---|
34 | import agents.anac.y2015.agentBuyogV2.flanagan.complex.Complex;
|
---|
35 |
|
---|
36 | public class TwoWireLine extends TransmissionLine{
|
---|
37 |
|
---|
38 | private double wireRadius = -1.0D; // wire radius - both wires have the same radius
|
---|
39 | private double wireSeparation = -1.0D; // wire separation - wire centre to wire centre
|
---|
40 | private boolean distancesSet = false; // = true when both wire radius and separation entered
|
---|
41 |
|
---|
42 | private double relativePermittivity = 1.0D; // relative electrical permittivity of the material around the conductors
|
---|
43 | private double relativePermeability = 1.0D; // relative magnetic permeability of the material around the conductors
|
---|
44 |
|
---|
45 |
|
---|
46 | // CONSTRUCTOR
|
---|
47 | public TwoWireLine(){
|
---|
48 | }
|
---|
49 |
|
---|
50 | // WIRE RADII
|
---|
51 | // Set wire radius - both wires identical
|
---|
52 | public void setWireRadius(double radius){
|
---|
53 | if(radius<=0.0D)throw new IllegalArgumentException("The wire radius, " + radius + ", must be greater than zero");
|
---|
54 | if(this.wireSeparation!=-1.0D && this.wireSeparation<=2.0D*radius)throw new IllegalArgumentException("The wire separation distance, " + this.wireSeparation + ", must be greater than the sum of the two wire radii, " + 2.0D*radius);
|
---|
55 | this.wireRadius = radius;
|
---|
56 | if(this.wireSeparation!=-1.0)this.distancesSet = true;
|
---|
57 | if(this.distancesSet)this.calculateDistributedCapacitanceAndInductance();
|
---|
58 | }
|
---|
59 |
|
---|
60 | // WIRE SEPARATION
|
---|
61 | // Set wire separation - wire centre to wire centre
|
---|
62 | public void setWireSeparation(double separation){
|
---|
63 | if(separation<=0.0D)throw new IllegalArgumentException("The wire separation, " + separation + ", must be greater than zero");
|
---|
64 | if(this.wireRadius!=-1.0D && separation<=2.0D*this.wireRadius)throw new IllegalArgumentException("The wire separation distance, " + separation + ", must be greater than the sum of the two wire radii, " + 2.0D*this.wireRadius);
|
---|
65 | this.wireSeparation = separation;
|
---|
66 | if(this.wireRadius!=-1.0)this.distancesSet = true;
|
---|
67 | if(this.distancesSet)this.calculateDistributedCapacitanceAndInductance();
|
---|
68 | }
|
---|
69 |
|
---|
70 | // PERMITTIVITY
|
---|
71 | // Set relative electrical permittivity of the material around the conductors
|
---|
72 | public void setRelativePermittivity(double epsilonR){
|
---|
73 | this.relativePermittivity = epsilonR;
|
---|
74 | if(this.distancesSet)this.calculateDistributedCapacitanceAndInductance();
|
---|
75 | }
|
---|
76 |
|
---|
77 | // PERMEABILTY
|
---|
78 | // Set relative magnetic permeability of the material around the conductors
|
---|
79 | public void setRelativePermeability(double muR){
|
---|
80 | this.relativePermeability = muR;
|
---|
81 | if(this.distancesSet)this.calculateDistributedCapacitanceAndInductance();
|
---|
82 | }
|
---|
83 |
|
---|
84 | // CALCULATE DISTRIBUTED PARAMETERS
|
---|
85 | private void calculateDistributedCapacitanceAndInductance(){
|
---|
86 | super.distributedCapacitance = Impedance.parallelWiresCapacitance(1.0D, this.wireRadius, this.wireSeparation, this.relativePermittivity);
|
---|
87 | super.distributedInductance = Impedance.parallelWiresInductance(1.0D, this.wireRadius, this.wireSeparation, this.relativePermeability);
|
---|
88 | }
|
---|
89 |
|
---|
90 | // DEEP COPY
|
---|
91 | public TwoWireLine copy(){
|
---|
92 |
|
---|
93 | if(this==null){
|
---|
94 | return null;
|
---|
95 | }
|
---|
96 | else{
|
---|
97 | TwoWireLine tl = new TwoWireLine();
|
---|
98 |
|
---|
99 | tl.wireRadius = this.wireRadius;
|
---|
100 | tl.wireSeparation = this.wireSeparation;
|
---|
101 | tl.distancesSet = this.distancesSet;
|
---|
102 | tl.relativePermittivity = this.relativePermittivity;
|
---|
103 | tl.relativePermeability = this.relativePermeability;
|
---|
104 |
|
---|
105 | tl.title = this.title;
|
---|
106 | tl.distributedResistance = this.distributedResistance;
|
---|
107 | tl.distributedConductance = this.distributedConductance;
|
---|
108 | tl.distributedCapacitance = this.distributedCapacitance;
|
---|
109 | tl.distributedInductance = this.distributedInductance;
|
---|
110 |
|
---|
111 | tl.distributedImpedance = this.distributedImpedance.copy();
|
---|
112 | tl.distributedAdmittance = this.distributedAdmittance.copy();
|
---|
113 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
114 |
|
---|
115 | tl.lineLength = this.lineLength;
|
---|
116 | tl.segmentLength = this.segmentLength;
|
---|
117 | tl.frequency = this.frequency;
|
---|
118 | tl.segmentLength = this.segmentLength;
|
---|
119 | tl.omega = this.omega;
|
---|
120 |
|
---|
121 | tl.inputVoltage = this.inputVoltage.copy();
|
---|
122 | tl.inputCurrent = this.inputCurrent.copy();
|
---|
123 | tl.outputVoltage = this.outputVoltage.copy();
|
---|
124 | tl.outputCurrent = this.outputCurrent.copy();
|
---|
125 |
|
---|
126 | tl.idealWavelength = this.idealWavelength;
|
---|
127 | tl.generalWavelength = this.generalWavelength;
|
---|
128 | tl.lowLossWavelength = this.lowLossWavelength;
|
---|
129 |
|
---|
130 | tl.idealPhaseVelocity = this.idealPhaseVelocity;
|
---|
131 | tl.generalPhaseVelocity = this.generalPhaseVelocity;
|
---|
132 | tl.lowLossPhaseVelocity = this.lowLossPhaseVelocity;
|
---|
133 |
|
---|
134 | tl.idealGroupVelocity = this.idealGroupVelocity;
|
---|
135 | tl.generalGroupVelocity = this.generalGroupVelocity;
|
---|
136 | tl.lowLossGroupVelocity = this.lowLossGroupVelocity;
|
---|
137 | tl.delta = this.delta;
|
---|
138 |
|
---|
139 | tl.idealAttenuationConstant = this.idealAttenuationConstant;
|
---|
140 | tl.generalAttenuationConstant = this.generalAttenuationConstant;
|
---|
141 | tl.lowLossAttenuationConstant = this.lowLossAttenuationConstant;
|
---|
142 |
|
---|
143 | tl.idealPhaseConstant = this.idealPhaseConstant;
|
---|
144 | tl.generalPhaseConstant = this.generalPhaseConstant;
|
---|
145 | tl.lowLossPhaseConstant = this.lowLossPhaseConstant;
|
---|
146 |
|
---|
147 | tl.idealPropagationConstant = this.idealPropagationConstant.copy();
|
---|
148 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
149 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
150 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
151 |
|
---|
152 | tl.generalPropagationConstant = this.generalPropagationConstant.copy();
|
---|
153 | tl.lowLossPropagationConstant = this.lowLossPropagationConstant.copy();
|
---|
154 | tl.idealCharacteristicImpedance = this.idealCharacteristicImpedance.copy();
|
---|
155 | tl.idealRealCharacteristicImpedance = this.idealRealCharacteristicImpedance;
|
---|
156 |
|
---|
157 | tl.generalCharacteristicImpedance = this.generalCharacteristicImpedance.copy();
|
---|
158 | tl.lowLossCharacteristicImpedance = this.lowLossCharacteristicImpedance.copy();
|
---|
159 | tl.idealInputImpedance = this.idealInputImpedance.copy();
|
---|
160 | tl.generalInputImpedance = this.generalInputImpedance.copy();
|
---|
161 | tl.lowLossInputImpedance = this.lowLossInputImpedance.copy();
|
---|
162 |
|
---|
163 | tl.idealShortedLineImpedance = this.idealShortedLineImpedance.copy();
|
---|
164 | tl.generalShortedLineImpedance = this.generalShortedLineImpedance.copy();
|
---|
165 | tl.lowLossShortedLineImpedance = this.lowLossShortedLineImpedance.copy();
|
---|
166 |
|
---|
167 | tl.idealOpenLineImpedance = this.idealOpenLineImpedance.copy();
|
---|
168 | tl.generalOpenLineImpedance = this.generalOpenLineImpedance.copy();
|
---|
169 | tl.lowLossOpenLineImpedance = this.lowLossOpenLineImpedance.copy();
|
---|
170 |
|
---|
171 | tl.idealQuarterWaveLineImpedance = this.idealQuarterWaveLineImpedance.copy();
|
---|
172 | tl.generalQuarterWaveLineImpedance = this.generalQuarterWaveLineImpedance.copy();
|
---|
173 | tl.lowLossQuarterWaveLineImpedance = this.lowLossQuarterWaveLineImpedance.copy();
|
---|
174 |
|
---|
175 | tl.idealHalfWaveLineImpedance = this.idealHalfWaveLineImpedance.copy();
|
---|
176 | tl.generalHalfWaveLineImpedance = this.generalHalfWaveLineImpedance.copy();
|
---|
177 | tl.lowLossHalfWaveLineImpedance = this.lowLossHalfWaveLineImpedance.copy();
|
---|
178 |
|
---|
179 | tl.idealRefectionCoefficient = this.idealRefectionCoefficient.copy();
|
---|
180 | tl.generalRefectionCoefficient = this.generalRefectionCoefficient.copy();
|
---|
181 | tl.lowLossRefectionCoefficient = this.lowLossRefectionCoefficient.copy();
|
---|
182 |
|
---|
183 | tl.idealStandingWaveRatio = this.idealStandingWaveRatio;
|
---|
184 | tl.generalStandingWaveRatio = this.generalStandingWaveRatio;
|
---|
185 | tl.lowLossStandingWaveRatio = this.lowLossStandingWaveRatio;
|
---|
186 |
|
---|
187 | tl.idealABCDmatrix = this.idealABCDmatrix.copy();
|
---|
188 | tl.generalABCDmatrix = this.generalABCDmatrix.copy();
|
---|
189 | tl.lowLossABCDmatrix = this.lowLossABCDmatrix.copy();
|
---|
190 |
|
---|
191 | tl.numberOfPoints = this.numberOfPoints;
|
---|
192 |
|
---|
193 | return tl;
|
---|
194 | }
|
---|
195 | }
|
---|
196 |
|
---|
197 |
|
---|
198 | // Clone - overrides Java.Object method clone
|
---|
199 | public Object clone(){
|
---|
200 |
|
---|
201 | Object ret = null;
|
---|
202 |
|
---|
203 | if(this!=null){
|
---|
204 |
|
---|
205 | TwoWireLine tl = new TwoWireLine();
|
---|
206 |
|
---|
207 | tl.wireRadius = this.wireRadius;
|
---|
208 | tl.wireSeparation = this.wireSeparation;
|
---|
209 | tl.distancesSet = this.distancesSet;
|
---|
210 | tl.relativePermittivity = this.relativePermittivity;
|
---|
211 | tl.relativePermeability = this.relativePermeability;
|
---|
212 |
|
---|
213 | tl.title = this.title;
|
---|
214 | tl.distributedResistance = this.distributedResistance;
|
---|
215 | tl.distributedConductance = this.distributedConductance;
|
---|
216 | tl.distributedCapacitance = this.distributedCapacitance;
|
---|
217 | tl.distributedInductance = this.distributedInductance;
|
---|
218 |
|
---|
219 | tl.distributedImpedance = this.distributedImpedance.copy();
|
---|
220 | tl.distributedAdmittance = this.distributedAdmittance.copy();
|
---|
221 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
222 |
|
---|
223 | tl.lineLength = this.lineLength;
|
---|
224 | tl.segmentLength = this.segmentLength;
|
---|
225 | tl.frequency = this.frequency;
|
---|
226 | tl.segmentLength = this.segmentLength;
|
---|
227 | tl.omega = this.omega;
|
---|
228 |
|
---|
229 | tl.inputVoltage = this.inputVoltage.copy();
|
---|
230 | tl.inputCurrent = this.inputCurrent.copy();
|
---|
231 | tl.outputVoltage = this.outputVoltage.copy();
|
---|
232 | tl.outputCurrent = this.outputCurrent.copy();
|
---|
233 |
|
---|
234 | tl.idealWavelength = this.idealWavelength;
|
---|
235 | tl.generalWavelength = this.generalWavelength;
|
---|
236 | tl.lowLossWavelength = this.lowLossWavelength;
|
---|
237 |
|
---|
238 | tl.idealPhaseVelocity = this.idealPhaseVelocity;
|
---|
239 | tl.generalPhaseVelocity = this.generalPhaseVelocity;
|
---|
240 | tl.lowLossPhaseVelocity = this.lowLossPhaseVelocity;
|
---|
241 |
|
---|
242 | tl.idealGroupVelocity = this.idealGroupVelocity;
|
---|
243 | tl.generalGroupVelocity = this.generalGroupVelocity;
|
---|
244 | tl.lowLossGroupVelocity = this.lowLossGroupVelocity;
|
---|
245 | tl.delta = this.delta;
|
---|
246 |
|
---|
247 | tl.idealAttenuationConstant = this.idealAttenuationConstant;
|
---|
248 | tl.generalAttenuationConstant = this.generalAttenuationConstant;
|
---|
249 | tl.lowLossAttenuationConstant = this.lowLossAttenuationConstant;
|
---|
250 |
|
---|
251 | tl.idealPhaseConstant = this.idealPhaseConstant;
|
---|
252 | tl.generalPhaseConstant = this.generalPhaseConstant;
|
---|
253 | tl.lowLossPhaseConstant = this.lowLossPhaseConstant;
|
---|
254 |
|
---|
255 | tl.idealPropagationConstant = this.idealPropagationConstant.copy();
|
---|
256 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
257 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
258 | tl.loadImpedance = this.loadImpedance.copy();
|
---|
259 |
|
---|
260 | tl.generalPropagationConstant = this.generalPropagationConstant.copy();
|
---|
261 | tl.lowLossPropagationConstant = this.lowLossPropagationConstant.copy();
|
---|
262 | tl.idealCharacteristicImpedance = this.idealCharacteristicImpedance.copy();
|
---|
263 | tl.idealRealCharacteristicImpedance = this.idealRealCharacteristicImpedance;
|
---|
264 |
|
---|
265 | tl.generalCharacteristicImpedance = this.generalCharacteristicImpedance.copy();
|
---|
266 | tl.lowLossCharacteristicImpedance = this.lowLossCharacteristicImpedance.copy();
|
---|
267 | tl.idealInputImpedance = this.idealInputImpedance.copy();
|
---|
268 | tl.generalInputImpedance = this.generalInputImpedance.copy();
|
---|
269 | tl.lowLossInputImpedance = this.lowLossInputImpedance.copy();
|
---|
270 |
|
---|
271 | tl.idealShortedLineImpedance = this.idealShortedLineImpedance.copy();
|
---|
272 | tl.generalShortedLineImpedance = this.generalShortedLineImpedance.copy();
|
---|
273 | tl.lowLossShortedLineImpedance = this.lowLossShortedLineImpedance.copy();
|
---|
274 |
|
---|
275 | tl.idealOpenLineImpedance = this.idealOpenLineImpedance.copy();
|
---|
276 | tl.generalOpenLineImpedance = this.generalOpenLineImpedance.copy();
|
---|
277 | tl.lowLossOpenLineImpedance = this.lowLossOpenLineImpedance.copy();
|
---|
278 |
|
---|
279 | tl.idealQuarterWaveLineImpedance = this.idealQuarterWaveLineImpedance.copy();
|
---|
280 | tl.generalQuarterWaveLineImpedance = this.generalQuarterWaveLineImpedance.copy();
|
---|
281 | tl.lowLossQuarterWaveLineImpedance = this.lowLossQuarterWaveLineImpedance.copy();
|
---|
282 |
|
---|
283 | tl.idealHalfWaveLineImpedance = this.idealHalfWaveLineImpedance.copy();
|
---|
284 | tl.generalHalfWaveLineImpedance = this.generalHalfWaveLineImpedance.copy();
|
---|
285 | tl.lowLossHalfWaveLineImpedance = this.lowLossHalfWaveLineImpedance.copy();
|
---|
286 |
|
---|
287 | tl.idealRefectionCoefficient = this.idealRefectionCoefficient.copy();
|
---|
288 | tl.generalRefectionCoefficient = this.generalRefectionCoefficient.copy();
|
---|
289 | tl.lowLossRefectionCoefficient = this.lowLossRefectionCoefficient.copy();
|
---|
290 |
|
---|
291 | tl.idealStandingWaveRatio = this.idealStandingWaveRatio;
|
---|
292 | tl.generalStandingWaveRatio = this.generalStandingWaveRatio;
|
---|
293 | tl.lowLossStandingWaveRatio = this.lowLossStandingWaveRatio;
|
---|
294 |
|
---|
295 | tl.idealABCDmatrix = this.idealABCDmatrix.copy();
|
---|
296 | tl.generalABCDmatrix = this.generalABCDmatrix.copy();
|
---|
297 | tl.lowLossABCDmatrix = this.lowLossABCDmatrix.copy();
|
---|
298 |
|
---|
299 | tl.numberOfPoints = this.numberOfPoints;
|
---|
300 |
|
---|
301 | ret = (Object)tl;
|
---|
302 | }
|
---|
303 | return ret;
|
---|
304 | }
|
---|
305 | }
|
---|