Solve Wave Function - Computational

Click For Summary
SUMMARY

The discussion focuses on solving the wave equation using Python, specifically employing Euler's method. The wave equation presented is d²u(x,t)/dx² = d²u(x,t)/dt², with initial conditions defined by u(x,0) = e^(-x² / (2*sigma²)) and sigma set to 0.1. The user seeks guidance on implementing Euler's method to calculate the next time step using the right-hand side (RHS) vector of derivatives, including u_dot, v_dot, and w_dot. Additionally, the user expresses confusion regarding the variation of the wave equation encountered in their studies.

PREREQUISITES
  • Understanding of wave equations and their mathematical formulation
  • Familiarity with Python programming and numerical methods
  • Knowledge of Euler's method for solving ordinary differential equations
  • Basic concepts of initial conditions in differential equations
NEXT STEPS
  • Implement Euler's method in Python for solving differential equations
  • Research the derivation and application of wave equations in physics
  • Explore the use of NumPy for vectorized operations in Python
  • Study the differences between various forms of the wave equation
USEFUL FOR

Students in computational physics, software developers working on numerical simulations, and anyone interested in applying Python for solving differential equations.

leonmate
Messages
81
Reaction score
1

Homework Statement



Hi all,

I've been working on this assignment for some time now and seem to be stuck before I even get going!
So,

The wave equation:

d^2 u(x,t) / dx^2 = d^2 u(x,t) / dt^2

can be written as:

du/dt = v
dv/dt = dw/dx
dw/dt = dv/dx
w = du/dx

I need to solve this using Python. I'm going to do it using Euler's method.

Some initial conditions:

u(x,0) = e^(-x^2 / 2*sigma^2)

sigma = 0.1

du(x,0) / dt = 0

du(x,0) / dx = -100x*u(x,0)

_________

What I've figured, is that in order to implement Euler I need to use the u_dot, v_dot and w_dot as a vector of your RHS. So you use this do calculate the next time step since

U(u,v,w)n+1 = U(u,v,w)n + dt*RHS(u_dot,v_dot,w_dot)

u_dot being du/dt btw

However, I have no idea how to actually do this, I'm completely thrown :(
I've been trying to get somewhere on paper and on the computer coding and neither has really given me anything I can use. How do I find U(u,v,w)n for a start?? and the RHS is d^2u/dt^2 i think.. How am I ever going to put that into python :S :S :S??

Any help and hints would really be helpful the deadline is coming up soon and I'm very stumped here.

Cheers all
 
Physics news on Phys.org
Also, everywhere I look the wave function equation is written d^2u / dt^2 = c^2 * d^2u / dx^2

I have no idea why the one in my question is different. Any ideas?
 

Similar threads

Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
30
Views
5K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K