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

Click For Summary
SUMMARY

This discussion focuses on solving a differential equation numerically using Euler's algorithm in computational physics. The equation derived is (dx/dt)=(vl)/x, where v is a velocity of 0.8 and x represents the distance to the bank. The user successfully generated a series of points using a time step (dt) of 0.1 seconds and is considering using the method of least squares to find a line of best fit for these points. Additionally, alternative methods such as the Runge-Kutta method are suggested for obtaining a more precise solution.

PREREQUISITES
  • Understanding of differential equations and their numerical solutions
  • Familiarity with Euler's algorithm for numerical integration
  • Knowledge of the method of least squares for curve fitting
  • Basic concepts of computational physics
NEXT STEPS
  • Learn about the Runge-Kutta method for improved numerical solutions
  • Explore numerical integration techniques beyond Euler's method
  • Study the application of least squares fitting in data analysis
  • Investigate the implications of time step selection in numerical methods
USEFUL FOR

Students and professionals in computational physics, mathematicians, and anyone involved in numerical analysis and modeling of physical systems.

schattenjaeger
Messages
176
Reaction score
0
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:
Physics news on Phys.org


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!
 

Similar threads

Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
2
Views
3K
Replies
4
Views
10K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
29
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K