-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesign_doc.txt
More file actions
182 lines (140 loc) · 14.2 KB
/
design_doc.txt
File metadata and controls
182 lines (140 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
design doc
Main Goal:
Automate the design, optimization and post-processing of openEMS microstrip patch antenna simulation
Requirements:
Patch Antenna Designer
Simulation Setup
Simulation Execution
Simulation Post Processing
Retrospective Simulation Analysis
Batch Simulation Choreography and Execution
Uses Simulation Setup, Simulation Execution, and Simulation Post Processing
Patch Optimization Algorithm
Patch Antenna Designer:
This system will use 2 main classes: InputParameters and CalculatedParameters
Input parameters (f0, eps_r, substrate thickness, input impedance, and loss tangent)
Calculated parameters stores all of the calculated parameters.
User creates a InputParameters object, load parameters into it, and then feed into all of the functions in the library
Each function updates a ledger stored in a user-instantiated CalculatedParams obj
This allows the user to auto store information and then quickly run calculations
Simulation Setup:
This system will use a single class: SimulationSetup
This system requires InputParameters and CalculatedParameters object, but does not work on the notion that it knows anything outside of those objects
This system does not know who these objects belong to or their purpose. It simply just prepares all the setup necessary for openEMS to run the simulation
User begins by spawning 3 objects, first the input params object and populating it, then sending it into a newly spawned calculated params object. The user then spawns a new
simulation obj and feeds the input and calculated parameters into it and run the setup. The resulting final sim obj is ready for execution.
Simulation Execution:
This system will use a single class: SimRunner
There will be second object for storing the results : SimResults
This system only requires the simulation setup object, contains all necessary simulation settings
This system does not care about anything but running and saving all the data to both an output object and a file
This system is not worried about post processing. Its entire job is to just run a valid simulation and report the results data (not the post processing data)
Simulation Post Processing:
This system will use one main class: PostProcessor
This system will use a second object for storing results: PostProcessingData
This system works simply by taking the results object from the simulation (derived from the direct function call, or from reading the save file and populating the result object)
and producing the desired output. IN essence, it takes the results object and derives S(1,1), Z(1,1) -Real and imaginary, H-Plane E-Plane views, 3D radiation pattern, as well as smith plot.
The results of generating these plots (or the generation of the plot data) will be stored in a dataclass for storing the results (PostProcessingData)
Retrospective Simulation Analysis:
This system will make use of the post processing as well as state information. My idea is to use a class that acts as a simulation daemon. Its job is to monitor performance statistics,
logging, as well as failure information. By attaching Daemons to simulations, we can ensure each simulation (even in the event of some crash or error) can be tracked and monitored.
This means you can create a simulation analysis object and register daemons with it. This allows the user to create a database and update it with a simulation analysis object.
This object has the following responsibilities:
- Analyze crashes
- Analyze errors
- Analyze performance behavior
- Prepare a report in json format
The goal of this system is to provide a method for getting detailed analysis of not just the simulation itself, but how it performs,
giving access to finding bottlenecks and deriving fixes for problems in orchestration. It also aims to give access to functions for creating a rather concise
output for databasing, other processes, etc.
Not necessary for handling and executing simulations, nor is it necessary for the post-processing. This is more executive in the fact that it needs to handle talking to the daemons and
potentially automate daemon management.
Batch Simulation Choreography and Execution:
This system will make use of a single master class. Individual simulations (sim objects that are ready to execute) are registered to the batch object. The batch object will handle
monitoring and maintaining stability. Its job is not to decide how to control things in events of error or crash. A crash handler system (separately described from here) will do that job and report
the results back. The batch handler only needs to orchestrate, gather data, and return the results. Once a crash/error analyzer/handler is made, then we can pass results to the analyzer, and then the analyzer can
send its determinations back for the batch handler to act upon. This separates the decision logic allowing for plug n play usage.
Separately but related, this system will make use of simulation setup, simulation execution, and simulation post processing classes for orchestration and execution
Patch Optimization Algorithm:
The patch optimization system will be simple. Its only job is to orchestrate the optimization of the patch antenna dimensions. The logic will be indeed distinct,
but it will use common optimizers, and only derive logic for controlling the optimizer. For example, the logic is derived from the data output (graph data) from the analysis
to determine what variable/dimension to alter to get to the target return loss and target frequency. The optimizer is essentially divided into two parts:
- An iteration device that handles iterating through a different dimension (length, width, notch depth, notch width, feedline length, feedline width, etc.) and sweeping
from one size to another, allowing for a progressive graphing of the results
- A logic system for decision making. This system will take the bulk csv or whatever type of spreedsheet file type, and process it. Each dimension being varied will have a 3D output,
which means you will have 3 axes: X axis is the frequency, y axis is return loss in dB, and z axis is the numerical value of whatever dimension. ie. y axis is patch length or width
This is a very powerful and complex system and will require serious planning.
FOR LATER, BUT PLANNED:
API for programming
CLI for those who wish to work inside the command line and want to avoid coding.
Who is this for:
- Beginners
- Students
- Hobbyists
- Real engineers
- Literally anyone who wants to design an antenna without fancy tools like Ansys or CST or Sonnet
NOTES:
┌─────────────────────────────────────────────────────────────────┐
│ User Interface Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ CLI Tool │ │ Python API │ │ Web UI (?) │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
└─────────┼──────────────────┼──────────────────┼─────────────────┘
│ │ │
└──────────────────┼──────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Orchestration Layer │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ BatchSimulationOrchestrator │ │
│ │ - Manages multiple simulation instances │ │
│ │ - Coordinates with optimization algorithms │ │
│ │ - Aggregates results for analysis │ │
│ └────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ OptimizationEngine │ │
│ │ - Implements optimization strategies │ │
│ │ - Manages parameter sweeps and sensitivity analysis │ │
│ │ - Converges on design goals │ │
│ └────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Simulation Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ SimSetup │→ │ SimRunner │→ │PostProcessor │ │
│ │ (COMPLETE) │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Design Layer │
│ ┌──────────────┐ ┌──────────────┐ │
│ │InputParams │→ │CalculatedParams │
│ │(COMPLETE) │ │(COMPLETE) │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Monitoring & Analysis Layer │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ SimulationDaemon │ │
│ │ - Monitors performance metrics │ │
│ │ - Captures errors and crashes │ │
│ │ - Logs resource usage │ │
│ └────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ RetrospectiveAnalyzer │ │
│ │ - Post-mortem analysis of simulations │ │
│ │ - Performance bottleneck identification │ │
│ │ - Report generation │ │
│ └────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Data Persistence Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ SQLite │ │ HDF5 Files │ │ JSON/CSV │ │
│ │ (Metadata) │ │(Large Arrays)│ │ (Reports) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘