Help please in matlab -- plotting a D'Alembert wave equation

In summary, plotting a D'Alembert wave equation in MATLAB involves using the built-in functions to define the equation, setting up the time and space variables, and using the "surf" function to visualize the wave. The amplitude and frequency of the wave can be adjusted using the appropriate parameters, and the results can be plotted in a 3D graph for visualization. Additionally, creating an animation of the wave's propagation can be achieved by using a loop to update the values at each time step.
  • #1
JI567
174
0
Can someone please help me in plotting a D'Alembert wave equation solution in MATLAB? I am so confused as how to plot it in MATLAB

I need to plot a graph like the one below

upload_2015-1-6_7-24-35.png
 
Physics news on Phys.org
  • #4
It talks about plotting multiple lines.

If you're looking for more info like generating the data for plot then you'll need to find another tutorial.
 
  • #5
jedishrfu said:
It talks about plotting multiple lines.

If you're looking for more info like generating the data for plot then you'll need to find another tutorial.

No man I already know how to plot multiple lines...its on how to generate the data actually
 
  • #6
JI567 said:
No man I already know how to plot multiple lines...its on how to generate the data actually
Show us what you have already tried. Be advised, however, that we're not going to do your work for you...
 
  • #7
Mark44 said:
Show us what you have already tried. Be advised, however, that we're not going to do your work for you...

What do you want to see? I have typed all sorts of commands in MATLAB getting nothing as a result so I have nothing to show you.

I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph

anyways I don't know how to use PDE commands in MATLAB unless someone wants to be generous and teach me...I am good at coding and maths I swear! I will learn fast.
 
  • #8
JI567 said:
What do you want to see?
Show us what you have tried.
JI567 said:
I have typed all sorts of commands in MATLAB getting nothing as a result so I have nothing to show you.

I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph

anyways I don't know how to use PDE commands in MATLAB unless someone wants to be generous and teach me...I am good at coding and maths I swear! I will learn fast.
PDE? Partial differential equations?
 
  • #9
JI567 said:
I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph
To get straigth veritcal lines (by hand), you need to double the points at which the lines appear. For instance, you need two points at x = 0.5, one with y=0 followed by one with y=2.
 

1. What is the D'Alembert wave equation?

The D'Alembert wave equation is a partial differential equation that describes the propagation of waves in a medium. It is commonly used in physics and engineering to model various wave phenomena, such as sound waves and electromagnetic waves.

2. How do I plot the D'Alembert wave equation in MATLAB?

To plot the D'Alembert wave equation in MATLAB, you will need to define the necessary variables and parameters, then use the "plot" function to graph the equation. You can also use the "surf" function to create a 3D plot.

3. What are the limitations of the D'Alembert wave equation?

The D'Alembert wave equation assumes that the medium in which the wave is propagating is homogeneous and isotropic. It also does not take into account factors such as dispersion and dissipation, which can affect the behavior of real waves.

4. Can I use the D'Alembert wave equation to model any type of wave?

No, the D'Alembert wave equation is only applicable to linear waves, meaning that the amplitude of the wave is directly proportional to the driving force. It also cannot be used to model standing waves or waves in non-uniform media.

5. Are there any practical applications of the D'Alembert wave equation?

Yes, the D'Alembert wave equation has many practical applications in fields such as acoustics, optics, and electromagnetics. It is used to study and predict the behavior of waves in various systems, including musical instruments, communication devices, and medical imaging technologies.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top