Plotting y'=te^{-2t}-2y: Seeking Help

  • Thread starter Thread starter DivGradCurl
  • Start date Start date
  • Tags Tags
    Plotting
AI Thread Summary
The discussion revolves around difficulties in plotting the direction field for the differential equation y' = te^{-2t} - 2y using Mathematica 5. The original poster struggles with the appearance of the plot, noting that the solution is complex and the arrows in the direction field are not displaying as expected. Another user provides a solution for the equation, suggesting a range for the axes but the original poster still encounters issues with the plotting command. There is confusion regarding the correct syntax for plotting, particularly the use of constants and the representation of the variables. The thread highlights the challenges of visualizing differential equations in Mathematica and seeks advice on proper plotting techniques.
DivGradCurl
Messages
364
Reaction score
0
I've had quite a bit of difficulty to properly fit into the screen the direction field plot of

y^{\prime}=te^{-2t}-2y​

which is happening because the solution to this differential equation is pretty ugly. I'm working in Mathematica 5. The plot and the notebook are attached so that you can have a clear idea of what I'm talking about.

Any help is highly appreciated.
 

Attachments

  • direction_field.jpg
    direction_field.jpg
    11.3 KB · Views: 398
  • mathematica notebook.zip
    mathematica notebook.zip
    7.9 KB · Views: 191
Physics news on Phys.org
When ploting a vector field don't you usally plot y' vs y'. In other words you should not need to use t in your answer right?
 
I don't think so. In this case, I have y(t)---i.e. y is a function of t. So, I'd definitely need axes for both of those. By the way, I could have used x instead of t. I just find it convenient this way. I don't mean to plot y^{\prime} \mbox{ vs } y^{\prime} because it does not represent a direction field.

Anyway, I've used the same type of commands (found in the mathematica notebook attached to the 1st post) to get various direction fields, but this one happens not to work exactly how I expected. I don't see those small arrows throughout. There are fewer and they appear much larger. Maybe, it's just a matter of getting the right window settings, which I haven't been able to achieve so far.

Thank you
 
thiago_j said:
I've had quite a bit of difficulty to properly fit into the screen the direction field plot of

y^{\prime}=te^{-2t}-2y​

which is happening because the solution to this differential equation is pretty ugly. I'm working in Mathematica 5. The plot and the notebook are attached so that you can have a clear idea of what I'm talking about.

Any help is highly appreciated.

It is not that ugly.

y=(t^2/2+C)\exp(-2t)

I've plotted the direction field in the range (-1,1) for both t and y.

ehild
 
Last edited:
Unfortunately, I still get the same kind of picture. Have you done that in mathematica 5? I'm trying to do it w/ the command "PlotVectorField", using the range you've suggested, but it just won't work.

Thanks
 
Davorak said:
When ploting a vector field don't you usally plot y' vs y'. In other words you should not need to use t in your answer right?
Sorry about that what I meant was Y' vs y. Right now in your Mathematica file you have y vs t and for the y component of the vector you have a constant 1. I am pretty sure Y should not be a constant 1. ehild gave a nice form for the solution of Y.

I also get what ehild does when plotting the vector field Y vs t, I how ever need to assume a constant. How did you get around this ehild? Or did you?
 
Davorak said:
Sorry about that what I meant was Y' vs y. Right now in your Mathematica file you have y vs t and for the y component of the vector you have a constant 1. I am pretty sure Y should not be a constant 1. ehild gave a nice form for the solution of Y.

I also get what ehild does when plotting the vector field Y vs t, I how ever need to assume a constant. How did you get around this ehild? Or did you?

It was made by an old program called NPHASER. It handles systems of first order differential equations of form xi = fi(x1...xn). In this case, x1 = t, x2=y, and the system is
x1'=1
x2'=x1(exp(-2x1))-2x2

I do not need any constant, but should input the range on both the x and y axes (t and y) and the grid size. The program draws a little arrow (all of equal length) to any grid points (t,y), with tangent equal to x2'/x1', that is y' in our case.

ehild
 
Davorak said:
Right now in your Mathematica file you have y vs t and for the y component of the vector you have a constant 1. I am pretty sure Y should not be a constant 1.

The constant 1 you refer to is separeted by a comma from the right-hand side of the differential equation. It indicates the 1st derivative. I've got it from a manual, and that syntax works fine for most problems. It should be something else (maybe one of the options).

Is there anybody who frequently uses "PlotVectorField" in mathematica 5?

Thanks
 
Back
Top