This text is a script of the audio recorded for the lab-13 presentation for AERE-361. Written by Zachary Luppen. 1: Hello everybody, teaching assistant Zachary Luppen here. Welcome back to another week of programming! This week’s lab is lab 13, titled, “Circuit Solver”. Just like the last few weeks, I’ll first be discussing various logistical items, and then I’ll proceed with describing the lab. So let’s dive in! 2: Lab 10 grading is complete now, and Lab 11 grading is just beginning. We’ll be looking over your lab 12 submissions soon, and we’re excited to see what you all were able to create! Keep in mind that lab 12 was the only group lab, and you’ll be switching back to the normal routine of individual assignments for the rest of the semester. We still encourage you to work with other students though. And again, thank you for bearing with us in the switch to being fully online. 3: Since we’ve moved to online instruction, we want to ensure that we can answer questions for the course as effectively as possible. The 361ta@temporallogic.org email is still the best go-to for any questions you may have (once you’ve exhausted looking through your resources for the course). Our office hours are hosted over WebEx at the same times listed on the course website. I am sending out an email each Sunday reminding everybody of my office hours as well as providing the link to connect over WebEx. You are also free to ask questions about your grades and such during office hours, but we may institute just asking over private messaging in order to maintain privacy. Just to reiterate, all of the posts on the discussion forum are anonymous to the class, but not the instructor and TAs. So please keep your comments appropriate or you won’t be able to use it. The discussion forum for lab 13 is aptly titled, “Lab 13 Discussion.” 4: That done, let’s actually get into lab 13 for this week! 5: In this week’s lab, you will be programming an electrical circuit solver. In your lab manual on p. 189-190, you will see a simple resistor circuit and a sample CSV file representing the values of the circuit. Notice each resistor is bounded by a set of nodes. Your goal will be to output all of the electrical current values between each of these nodes. In doing this lab, you’ll demonstrate an understanding of loop invariants, as well as understand changing Big-O complexity for this problem. If you don’t remember what loop invariants are, I recommend look back at lab 9 where they were covered. 6: In order to solve this lab, we give you a refresher of Kirchhoff’s Laws. These should’ve been covered in your physics classes, though it might’ve been a while since you’ve last seen them. Kirchhoff’s laws are methods used to solve circuits, and evaluate the amount of current, voltage or resistance in a particular part of that circuit. They’re used (through various software packages) when creating circuitry for all of your favorite electronic products. While these software packages get pretty complex, we’re just asking you to make a solver for simple circuits with a voltage source(s) and a resistor(s). 7: Since we’re asking you to discuss the varying Big-O complexity of your program, let’s take a closer look at what that actually means. In a handful of labs this semester, you spent time providing us with the Big-O notation of your programs. But these programs have operated in the same manner – the program doesn’t change according to the input file complexity – and so the Big-O notation has generally been the same for each run of your programs. That doesn’t always have to be true. One straightforward examination of Big-O notation comes with different sorting algorithms. Imagine you have a randomized list of numbers, say from 1 to 100. How many different ways can you think of sorting a list of random numbers? Do you go through and look for the smallest numbers first? The highest numbers? Do you look for patterns? Do you go through and compare each number against its neighbors and decide which is higher? There’s loads of different ways to sort things, particularly in code. 8: One major sorting method is insertion sort. This is a very basic sorting method, and involves going through the list of numbers one by one and putting them in order. You can see a gif of this method on the right side of the slide. For this sorting method, the big O notation is O(n) for the best case scenario, when the list is already sorted. It’s the slowest, having a big O notation of O(n^2), when the list is inversely sorted. 9: Another sorting method is Timsort, developed by Tim Peters in 2002 for the Python programming language. It’s a sort of combination of the insertion sort method (from the last slide) and merge sort (a sort of divide and conquer method). This method is considered one of the fastest. Looking at its best-case performance, it has big O notation of O(n). That’s when the list of numbers is randomly sorted. But this method actually has worst-case performance when the list is already sorted. Then, it has Big O notation of O(n * log(n)). That’s kind of a fun little aspect of one of the most efficient sorting algorithms. It’s super-fast when dealing with a random list, but is otherwise slowest when the list has already been sorted. 10: Your LaTeX report this week should have the following components: a title page, references, a complexity analysis of your code, as well as a loop analysis. Just like listed in the lab manual. These analyses will require you to look at the complexity of your code relative to the number of resistors in your circuit, and look at the complexity of the loops in your program. While not required, you could also document your process of writing up the code for this lab, and discuss the problems you encountered while doing it. Please remember that reports that do not compile will be awarded 0 points! 11: Let’s look at the point distribution for this lab. In total, lab 13 is worth 30 points, split up in the following ways. 20 points are allocated towards the circuit solver program. There will be partial credit for certain aspects of this program. And the other 10 points are your report. 12: Always remember that since lab 8, we are now running the make command directly in your lab repositories when grading. We will then run your program with a CSV file matching the format of the sample input file on p. 190 as a command line argument. And that’s how it will get graded. Please make sure that your file names are correct and that your LaTeX report is in a “report” directory as always. 13: I’ve got just some general advice for you as you do this assignment. Recall that we said at the very beginning of the semester that the labs will be ramping up in difficulty, this is still true. We understand going online may make this even a step more difficult, but again, we still expect you to be able to do these assignments utilizing the resources given to you. Something that Dr. Rozier thought I should mention, a lot of the final labs of this semester generally require a fair amount of back-and-forth conversation and troubleshooting, which is obviously difficult to do in our current situation. We therefore recommend you attend lectures, labs and office hours, and also email us questions. The sooner you email us, the faster you’ll be able to receive a response. It’s gotten harder to answer questions being just virtual, so ask a question as soon as you can! Also remember that Dr. Rozier said that these labs will eat your lives, especially towards the end of the semester. Don’t be one of the people who clones their GitHub repository the day before the lab is due and attempts to finish it in 24 hours or less. It’s just not going to be possible for the last labs this semester unless you have Spock-like logic and knowledge of programming.