Welcome again, to another fantabulous 1/7th of a week.

With that out of the way lets begin. My primary choices were Java and C++ to exploit OOPS since a lot of components in electronics share common traits. Between Java and C++, I opted for Java since I am more comfortable with handling GUI in Java than in C++. I was apprehensive about Java's performance since these design environments usually involve thousands of iterations with matrices in the order of hundreds. My first intention was to implement the basic graphing requirements and GUI in Java and then the computationally expensive portions in C++ or Julia but decided against it for two reasons. Firstly, Julia's benchmarking page shows that Java is comparable to Julia. Secondly, most importantly, any JNI pipes to C++ would create a bottleneck since enormous amounts of data will have to be passed in and out of this pipe with each iteration. Its better to profile and optimize the Java code than transfer the complexity to other languages for arguably minor improvements.
The first problem to tackle was that of assigning ID to each node. With large circuits this could take quite sometime if done at the end of connecting the components which is why I decided to do it on the go. Every time a connection is made to a node, its assigned the same ID if any of its neighbors
have already been assigned an ID and a new ID if none have been assigned. The GND node can be arbitrarily chosen just before the simulation begins. With the mapping done, the next issue was to tackle MNA. For this purpose there was a need to construct a Hashmap, mapping every node assigned a certain ID as it becomes a lot easier to implement the simulation. I had initially used images from flaticon for the various components, however they don't take well to scaling which is direly required as the circuits get bigger. This was subsequently replaced by manual painting. At the end of the day, simple linear circuits could be solved with DC and AC sources.
"As the day awakens with the crowing of the rooster,
And the simple minded folk begin to till their land,
I'm starting to ponder which language is chaster,
Java, C++ or C Borland "
With that out of the way lets begin. My primary choices were Java and C++ to exploit OOPS since a lot of components in electronics share common traits. Between Java and C++, I opted for Java since I am more comfortable with handling GUI in Java than in C++. I was apprehensive about Java's performance since these design environments usually involve thousands of iterations with matrices in the order of hundreds. My first intention was to implement the basic graphing requirements and GUI in Java and then the computationally expensive portions in C++ or Julia but decided against it for two reasons. Firstly, Julia's benchmarking page shows that Java is comparable to Julia. Secondly, most importantly, any JNI pipes to C++ would create a bottleneck since enormous amounts of data will have to be passed in and out of this pipe with each iteration. Its better to profile and optimize the Java code than transfer the complexity to other languages for arguably minor improvements.
The first problem to tackle was that of assigning ID to each node. With large circuits this could take quite sometime if done at the end of connecting the components which is why I decided to do it on the go. Every time a connection is made to a node, its assigned the same ID if any of its neighbors
have already been assigned an ID and a new ID if none have been assigned. The GND node can be arbitrarily chosen just before the simulation begins. With the mapping done, the next issue was to tackle MNA. For this purpose there was a need to construct a Hashmap, mapping every node assigned a certain ID as it becomes a lot easier to implement the simulation. I had initially used images from flaticon for the various components, however they don't take well to scaling which is direly required as the circuits get bigger. This was subsequently replaced by manual painting. At the end of the day, simple linear circuits could be solved with DC and AC sources.
No comments:
Post a Comment