Skip to main content

All Questions

Tagged with
4 votes
2 answers
117 views

Simulate transmission spectrum of extreme ultraviolet laser pulse through laser-dressed finite sample (Python Version)

I am currently participating in research on transient absorption spectroscopy and four wave mixing. In the experimental design, an extreme ultraviolet (XUV) laser pulse and infrared (IR) laser pulse ...
Matt Bowman's user avatar
8 votes
4 answers
2k views

Simulation of a falling ball

I made a simple simulation of a falling ball. Is it possible to somehow improve or optimize this code? What tips can you give for development? ...
TuleKr1s's user avatar
6 votes
2 answers
339 views

Simulating the orbits of the Earth, Moon and Sun together in Fortran

This has been racking my brain for hours now. I will try to explain as much as I can. I'm aware this code is horrendously ungraceful, but I'm new to Fortran and making things more efficient is not ...
sangstar's user avatar
  • 203
33 votes
9 answers
8k views

Simple n-body class in C++

As part of my training, I implemented a n-body class in C++ to simulate gravitational interaction of bodies and to get more familiar with features that C++ offers such as object oriented programming. ...
Gilfoyle's user avatar
  • 1,125
5 votes
0 answers
85 views

Butter side up?

I've written a piece of code that determines if a piece toast with butter lands on the butter-side or not, depending on its initial velocity and the table height. The code is written in Mathematica ...
Sito's user avatar
  • 394
5 votes
2 answers
864 views

Simulation of spring-loaded inverted pendulum

I've finally committed to moving to Python 3 from MATLAB. I'm currently porting my MATLAB code, and I'm sure I'm missing a lot of common best-practices. For reference, I'm simulating a spring-loaded ...
Steve Heim's user avatar
1 vote
1 answer
316 views

Vector addition and Pythagorean Theorem code

I would like to share my code that is meant to help me add 2 vectors together. It is very simple and I would like to kindly ask you whether you could review my code. Also, I decided to keep separate ...
Matej Novosad's user avatar
2 votes
4 answers
846 views

Calculating energy from mass and light speed

I'm learning Java JDK 1.8 since one day and I'm using Java's methods to the first time. I have never used Java before because I'm a Python/Django developer. I created a method which let to get energy ...
Essex's user avatar
  • 293
9 votes
2 answers
6k views

Kinematic Equations

I'm learning the kinematic equations in Concepts of Engineering and so here are the equations I am learning: To complete the lesson, I was told to create a Python program that outputs the horizontal ...
Anthony Pham's user avatar
5 votes
1 answer
198 views

Calculating a table of deBroglie wavelengths for various electron energies

Here is the formula for the deBroglie wavelength of an electron versus its kinetic energy: $$ \lambda(E_k) = h\left/\sqrt{\frac{(E_k+m_eC^2)^2-m_e^2C^4}{C^2}}\right.$$ and here is simple script that ...
Christian Chapman's user avatar
2 votes
2 answers
5k views

Simulation of 2D elastic balls

Following this SO post and this Wikipedia article, I wrote a Python script to simulate physics of 2D elastic balls. I define the physical behaviour of each ball in the ...
cromod's user avatar
  • 329
2 votes
1 answer
812 views

Velocity verlet implementation

My code is meant to update the positions and velocities of planets. There are a few methods in this class, but updatePosition and ...
user13948's user avatar
  • 225
10 votes
2 answers
5k views

Solar System model

I have a model that works, as far as I know, but it's so messy! I am very new to Java, so I'd really appreciate some help tidying up. In particular, a lot of my constructors are empty which is ...
user13948's user avatar
  • 225
3 votes
2 answers
1k views

Program based on a physics concept

I am a beginner and I wanted to make programs that would help me while I learnt Java. I made a program to help me in my assignments. Any suggetions? Main method ...
Aryan Srivastava's user avatar
6 votes
1 answer
2k views

Kinematic Equations Calculator

The program allows user to enter values for 3 of the following initial velocity final velocity acceleration displacement time and to specify an unknown (one of the previously mentioned variables)....
Johan Ribbing's user avatar

15 30 50 per page