Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Graphing Heat Equation

  1. Oct 16, 2011 #1
    1. The problem statement, all variables and given/known data
    Graph T(x,t) = T1e^(lambda*x)sin(wt-lambda*x) in Maple
    lambda = -.2
    T1 = 10
    omega = constant

    2. Relevant equations
    Maybe heat equation
    ut(x,t) = uxx(x,t)

    3. The attempt at a solution
    I'm really unsure on how to graph a multiple variable function/equation in Maple. I gave it a couple of tries using plot3d, but I really don't have a clear understanding of how exactly the functions work (I only plot 2d stuff before this).

    My only close attempt was when I typed in:
    plot3d(T1e^(lambda*x)sin(wt-lambda*x), x=0..10, t=0..10)
    where I had define lambda := -.2 and T1 := 10;
    It didn't give me any errors, but it gave me an empty plot.

    I also looked up procedures in graphing heat equation, but it didn't give me a plot I wanted. Rather I wanted a plot in 3d, while it gave me a plot in 2d as the end result.

    I guess my biggest problem right now is how to get Maple to treat omega (w) as a constant. Should I leave it out while trying to plot it? Because when I do I get a curved 2d line on the graph.
    I'm unsure if graphing if covered in this forum, but it would be really helpful if a person could direct me in the right direction, maybe drop some advice as to which plot to use (like PDEplot or if plot3d is fine?)

    Thanks a lot for the help guys.
  2. jcsd
  3. Oct 17, 2011 #2
    So I kept trying it, and looking up guides to graph said equation in the end I got:

    T(x,t) := 10 exp(-.2 *x)*sin(omega*t+.2*x);
    plot3d(T(x, t), x = -10 .. 10, t = 0 .. 10, axes = framed, orientation = [-20, 20])

    I don't think I need too many lines of code to graph it, but I keep getting a flat graph. I mean I get a 2d plot on the xt plane while I want a 3d plot. I'm not 100% what I'm doing wrong, does anybody have a clue?

    Thank you.
  4. Oct 17, 2011 #3


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I assume you have assigned a value to ω (you can't leave it undefined in a plot). I think if you remove the (x,t) like this:

    T := 10 exp(-.2 *x)*sin(omega*t+.2*x);
    plot3d(T, x = -10 .. 10, t = 0 .. 10, axes = framed, orientation = [-20, 20]);

    it will work.
  5. Oct 17, 2011 #4
    Oh wow that worked :O
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook