Saturday, September 27, 2014

New Blog

This weekend, I figured out how to use Jekyll, so this blog is moving to nielskornerup.github.io/Blog. I hope to see you all there!

Sunday, September 14, 2014

Elastic collisions

Hi! Today, I will tell you about a project that I have been working on in Independent study; an Elastic Collision simulator.

The Idea:
An Elastic Collision is one in which momentum and kinetic energy are conserved. Over the summer, I made a charged particle simulator, and starting this school year, I took the idea and made a gravity simulator. The primary problem with these two simulators is that particles can move inside of each other. In order to solve this problem, I want to implement Elastic Collisions, so I am working on the code with a different simulator. After I finish it, I plan to copy the code over to these two simulators to improve them as well.

The process:
To start this process, I first had to learn how Elastic collisions work. I found an equation to model the motion on Wikipedia. In order to implement this algorithm, I had to remember how to use arc tangent to compute angles from x and y speeds. The problem with arc tangent is that it has a range of (-pi/2, pi/2), so I had to figure out what the actual angle is depending on the sign on the X speed. If the X speed was negative, I would need to add pi to my result to get the correct angle. In order to calculate phi, I used the difference between x and y coordinates using the same basic system with arc tangent. In order to calculate the mass of a particle, I would square its radius.

The result:
This worked better than I expected, as a majority of the collisions looked accurate. Despite this, about 30% of my collisions were not working out as I expected them to. I started analyzing my code for bugs, but I could not find any. Eventually a classmate said that I could be having problems with particles tunneling into each other and preforming multiple collisions before escaping. Using this advice, I worked on creating anti-tunneling code.

Anti-tunneling:
In order to stop tunneling, I worked on a system where if two particles move into each-other, one will move backwards at the same angle until it is outside of the other. This seemed to solve my problem; however, I started having problems where particles would teleport when they collided. Thinking that this could be caused by multiple attempt to stop tunneling, I created a cool down timer for collisions, but this caused particles to get trapped inside of each other.

The state of my progress:
I have made significant progress on this project; however, I still have two bugs that I need to fix. I am hoping to fix these problems next week. See you then!

Tuesday, September 2, 2014

New year, new projects

Now I am in independent study for computer science, and I am working on a server that will allow clients to play games with clients that can be either AIs or actual players. We have decided on how we want to send input and output to and from the server. We have also implemented the rules for tic tack toe, which will be the default game for this project. Also, individually, I have worked on some of my own projects. I managed to get my charge simulator online, and I also wrote a gravity simulator. The charge simulator generates random charged particles at random velocities, and then simulates their movement while the gravity simulator does the same thing, but with gravity using differently sized objects. For both of these projects, I also figured out how to implement settings. The algorithms might still have a few bugs, so this is something that I plan to work on. I also plan to make a new project that tracks elastic collisions, but I need to learn how the physics behind that works first. I am also learning more javascript from this tutorial, and I plan to learn node.js for my projects. This year, I might also want to work on making my own blog using bootstrap, but I will see how things go. On a more personal level, I have been doing Aikido for about 1/2 a year now, and I have successfully advanced a rank.

Sunday, May 4, 2014

5/4/14 Update

Hi, today I will be giving you a status report on my progress. Thanks to the help of group members, I have figured out how to connect to git on a VPN. After figuring this out, I coded a signup confirmation Email using Nodemailer. Also, I wrote a java program to parse teacher names from the LASA website, which we will need for our website when students sign up for their classes. Last week, we were having difficulty connecting to koding, the service that we are using for our code, and so I worked on individual projects. First, I messed around with HTML because I haven't used it for a full  year. After that, I coded a java program that allows me to make digital quizbowl flashcards. Progress on our project has been slow, but I think that we will be able to work at full speed starting next week.

Monday, April 21, 2014

New project

Hi, and i'm back! I am currently working on a project with some of my friends where we are creating a website where students can access crowd sourced grades for assignments. I am new to web development, and so far I have been mostly working on figuring how things work. I learned how to connect to git using a terminal, and I am working on learning node and SQL. So far, we have created register and login pages, and I helped write the code for making sure that the usernames and passwords are registered. It works, but we are having a problem with how we hash our passwords. I have learned a lot, and this looks like it will be a lot of fun. I will be keeping you updated every other week with my progress.