# Yay, here's a fun one computational physics, but I already did the comp part

• schattenjaeger
In summary, using Euler's algorithm, you can directly obtain x(t) by integrating the differential equation dx/dt = (vl)/x and using the initial condition x(0) = 15. This will give you a continuous function for x(t) instead of just a list of points. It is important to double check instructions and clarify any confusion before starting a project. Good luck!
schattenjaeger
http://pacific.uta.edu/~qiming/Project2.htm

Mind you this is solving NUMERICALLY(hence Euler's algorithm)not analytically
*THIS FOLLOWING PART IS JUST ME EXPLAINING WHAT I DID, it's hard to put into words, if you can follow it and spotted a mistake, let me know*

quick assist to get you up to speed, the differential equation you get out of the given info is (dx/dt)=(vl)/x
where v is that .8 velocity and x is the distance to the bank, of course. Using Euler's equation, I got that each subsequent point x is given by the starting point x + dt*((vl)/x) and as the site suggested, I used .1 for dt

so I basically outputted myself a list of each subsequent point x(so like the first one was 15m, the next was like 14.09 or so, all the way down 'till it hits the wall)and even spot checked a few points but just figuring out what the velocity should be at a point(since I had dx/dt)and making sure that velocity matched up with my points(since I knew the dt was .1)

*Ok, ENOUGH OF THAT STUFF

Anyways, long story short, I have all these points, I know they're .1 seconds apart...umm, is that what I need? Should I just use, say, the method of least squares to get the line of best fit across those points and be done with it?(I believe my error would be .1^2)

Or did I totally miss the point and is there a way to directly obtain x(t) with that algorithm? I think I'm doing it right, but hey, I'd like to be sure. Oh, and like the messed up due date?

Last edited by a moderator:

Thank you for sharing your approach to solving this problem using Euler's algorithm. It seems like you have a good understanding of the method and have successfully obtained a list of points for x at different time intervals. Using the method of least squares to find the line of best fit for these points is a valid approach and could give you a good approximation of x(t). However, there is a way to directly obtain x(t) using Euler's algorithm.

First, let's take a closer look at the differential equation you have derived: dx/dt = (vl)/x. This equation represents a relationship between the rate of change of x (dx/dt) and the current value of x. In other words, it tells us how x changes over time. In order to solve for x(t), we need to integrate this equation with respect to t.

Integrating both sides of the equation gives us: ∫dx/x = ∫(vl)dt. This can be simplified to ln(x) = vlt + C, where C is the constant of integration. Solving for x, we get x = e^(vlt+C). Now, we need to use the initial condition given in the problem, which is x(0) = 15. This means that when t = 0, x = 15. Substituting these values into our equation, we get 15 = e^(vl*0+C). This simplifies to C = ln(15). Therefore, our final equation for x(t) becomes:

x(t) = e^(vlt+ln(15)) = 15e^(vlt)

Now, we can use this equation to directly obtain the value of x at any given time t. This will give us a continuous function for x(t) instead of just a list of points.

In terms of the due date for your project, it is important to always double check the instructions and make sure you understand the requirements before starting any project. In this case, it seems like you may have misunderstood the due date, but it is always better to clarify any confusion before starting the project. Good luck with your project!

Great job on tackling computational physics! It can definitely be a challenging and rewarding field of study. From what you have described, it seems like you have a good grasp on the concepts and have successfully solved the problem using Euler's algorithm. Well done!

To answer your question, yes, you can use the method of least squares to get the line of best fit for your points. This will give you an approximation of the function x(t) that you are looking for. However, keep in mind that this is an approximation and may not be an exact solution to the problem. If you want to obtain the exact solution, you may need to use a different method such as the Runge-Kutta method or a numerical integration method.

As for the due date, it's always frustrating when deadlines are changed, but it's important to stay focused and do your best with the time you have. It seems like you have done just that. Keep up the good work!

## 1. What is computational physics?

Computational physics is a branch of physics that uses computer simulations and mathematical models to study physical phenomena and solve complex problems. It involves the use of advanced algorithms and computer programming to analyze and interpret data, simulate experiments, and make predictions about the behavior of physical systems.

## 2. How is computational physics different from traditional physics?

Traditional physics involves using analytical methods and mathematical equations to study and explain physical phenomena. Computational physics, on the other hand, uses computational methods and simulations to analyze and understand complex systems that may be too difficult or impossible to solve using traditional methods.

## 3. What are some examples of applications of computational physics?

Computational physics has a wide range of applications, including weather forecasting, astrophysics, fluid dynamics, quantum mechanics, and materials science. It is also used in industries such as aerospace, automotive, and energy to optimize designs and predict the behavior of complex systems.

## 4. What skills are needed to work in computational physics?

To work in computational physics, one needs a strong background in physics, mathematics, and computer science. Proficiency in programming languages such as Python, MATLAB, and C++ is also necessary. Additionally, critical thinking, problem-solving, and analytical skills are essential to be successful in this field.

## 5. What are the benefits of using computational physics?

Computational physics allows us to study and understand complex systems that are difficult or impossible to observe and experiment with in real life. It also enables us to make predictions and simulations of physical phenomena, which can save time and resources in the research and development process. Additionally, it can provide insights and solutions to problems that traditional methods may not be able to solve.

Replies
4
Views
2K
Replies
1
Views
784
Replies
31
Views
2K
Replies
4
Views
2K
Replies
2
Views
2K
Replies
4
Views
9K
Replies
11
Views
2K
Replies
8
Views
1K
Replies
29
Views
3K
Replies
1
Views
828