Plot graph of 1D wave equation (using d'Alembert's formula)

Click For Summary
The discussion revolves around plotting the solution to a 1D wave equation using d'Alembert's formula. The user is tasked with plotting u(x,t) at t=2a/v, given specific initial conditions for u(x,0) and its time derivative. They initially struggle to relate the calculated values of u(x+2a,0) and u(x-2a,0) back to the original function u(x,0). After some confusion, they clarify that u(x,0) represents a linear function, which can be plotted as a straight line for the specified range. Ultimately, they express gratitude for the assistance in understanding the graphing process.
whatisreality
Messages
286
Reaction score
1

Homework Statement

[/B]
Don't know if this goes here or in the advanced bit, thought I'd try here first!

I know the general solution of a 1D wave equation is given by d'Alembert's formula

##u(x,t) = 0.5[u(x+vt,0) + u(x-vt,0)] + \frac{1}{2v} \int_{x-vt}^{x+vt} \frac{\partial u}{\partial t}(x,0) \mathrm dx##.

And I've been given that for my particular wave, ##\frac{\partial u}{\partial t}(x,0)## = 0 for all x, so that's nice because I don't have to worry about the integral in d'Alembert's.

I've also been given that u(x,0) is x+a for -a≤x≤0
and u(x,0) is a-x for 0≤x≤a
and 0 otherwise.

##a## is a real positive constant.

Plot u(x,t) as a function of x at time t=2a/v.

Homework Equations

The Attempt at a Solution


My y-axis is going to be labelled u(x) and my x-axis is x. I've subbed in t=2a/v into d'Alembert's, and got

##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##

So u(x+2a) = x+3a for -a≤x≤0
u(x-2a) = x-a for -a≤x≤0

Which means that for -a≤x≤0, my u(x) = 0.5(2x+2a) = x+a

Is that the right sort of thing to do? I'm pretty sure it's not, since it takes me back to where I started.I don't know how to make use of that set of conditions for -a≤x≤0 etc.

I'm really confused about how to plot this.
 
Last edited:
Physics news on Phys.org
whatisreality said:
My y-axis is going to be labelled u(x) and my x-axis is x. I've subbed in t=2a/v into d'Alembert's, and got

##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##
OK

So u(x+2a) = x+3a for -a≤x≤0
u(x-2a) = x-a for -a≤x≤0

Which means that for -a≤x≤0, my u(x) = 0.5(2x+2a) = x+a

I don't follow what you did here. Recall that if you know the graph of f(x), then you can easily plot the graph of f(x+b) where b is a constant. In this problem, you know the graph of u(x, 0) for all x. So, it should be easy to plot the graphs of u(x+2a, 0) and u(x-2a, 0).
 
  • Like
Likes whatisreality
TSny said:
OK

I don't follow what you did here. Recall that if you know the graph of f(x), then you can easily plot the graph of f(x+b) where b is a constant. In this problem, you know the graph of u(x, 0) for all x. So, it should be easy to plot the graphs of u(x+2a, 0) and u(x-2a, 0).

The graph I'm actually plotting is u(x, 2a/v), and I have no idea how that relates to u(x,0).

What I did here:
whatisreality said:
##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##

So u(x+2a) = x+3a for -a≤x≤0
u(x-2a) = x-a for -a≤x≤0

So I'm having to plot ##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##

Then I tried to work out the values of u(x+2a,0) and u(x-2a,0) to sub into the equation for u(x, 2a/v). I did this using the constraints given: u(x,0) is x+a for -a≤x≤0

I'm working out u(x+2a,0), so I replaced x with x+2a to get u(x+2a,0) is (x+2a)+a for -a≤x≤0, and repeated the same process with (x-2a).

Then u(x, 2a/v) = 0.5[u(x+2a,0) + u(x-2a,0)] = 0.5( x+3a + x-a ) = x+a for -a≤x≤0.

I don't know how to plot y = x+a for -a≤x≤0. Or even if that's what I should be plotting.
 
whatisreality said:
The graph I'm actually plotting is u(x, 2a/v), and I have no idea how that relates to u(x,0).
Recall, you have ##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##.
 
  • Like
Likes whatisreality
TSny said:
Recall, you have ##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##.
Oh, right, I see. I have trouble plotting u(x,0) in the first place though, which is why I did those calculations. I suppose both ways should give the same answer?
 
TSny said:
Recall, you have ##u(x, \frac{2a}{v}) = 0.5[u(x+2a,0) + u(x-2a,0)]##.
Actually, to be more specific, I have trouble plotting u(x,0) because I'm not sure what

u(x,0) is x+a for -a≤x≤0

means for a graph, for example y=x+a for x between -a and 0? What does that look like? A horizontal line?
 
whatisreality said:
Actually, to be more specific, I have trouble plotting u(x,0) because I'm not sure what

u(x,0) is x+a for -a≤x≤0

means for a graph, for example.
It means that when x is greater than -a and less than 0, you want to graph the function y = x + a. You can see it's a linear function. So, the graph will be a straight line. What is the value of y at x = -a? What is the value at x = 0?
 
  • Like
Likes whatisreality
TSny said:
It means that when x is greater than -a and less than 0, you want to graph the function y = x + a. You can see it's a linear function. So, the graph will be a straight line. What is the value of y at x = -a? What is the value at x = 0?
I can't believe I even wrote that. I can definitely graph y = x+a! But I'd convinced myself I didn't know. It's the graph of y = x translated down by a, so at x = 0 y= -a and at x = 0 y = a. What an incredibly silly thing to do!

Thank you for being very patient and helping!
 
Last edited:
whatisreality said:
at x = 0 y= -a and at x = 0 y = a.

OK. I guess you meant to type at x = -a, y = 0.
 
Last edited:
  • #10
TSny said:
asdfasdfOK. I guess you meant to type at x = -a, y = 0.
Yes, I did. Sorry. Must be a sign, too late at night for maths.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
9
Views
2K
Replies
15
Views
2K
  • · Replies 20 ·
Replies
20
Views
2K
Replies
6
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
8
Views
2K
Replies
2
Views
904