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

  • Thread starter DivGradCurl
  • Start date
  • Tags
    Plotting
In summary: 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.
  • #1
DivGradCurl
372
0
I've had quite a bit of difficulty to properly fit into the screen the direction field plot of

[tex]y^{\prime}=te^{-2t}-2y[/tex]​

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: 358
  • mathematica notebook.zip
    7.9 KB · Views: 166
Physics news on Phys.org
  • #2
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?
 
  • #3
I don't think so. In this case, I have [tex]y(t)[/tex]---i.e. [tex]y[/tex] is a function of [tex]t[/tex]. So, I'd definitely need axes for both of those. By the way, I could have used [tex]x[/tex] instead of [tex]t[/tex]. I just find it convenient this way. I don't mean to plot [tex]y^{\prime} \mbox{ vs } y^{\prime}[/tex] 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
 
  • #4
thiago_j said:
I've had quite a bit of difficulty to properly fit into the screen the direction field plot of

[tex]y^{\prime}=te^{-2t}-2y[/tex]​

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.

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

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

ehild
 
Last edited:
  • #5
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
 
  • #6
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?
 
  • #7
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
 
  • #8
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
 

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

1. What is the purpose of plotting y'=te^{-2t}-2y?

The purpose of plotting y'=te^{-2t}-2y is to visualize the behavior of the differential equation and understand how the dependent variable y changes in response to the independent variable t. This can help in solving the equation and predicting future values of y.

2. How do I plot y'=te^{-2t}-2y?

To plot y'=te^{-2t}-2y, you can use a graphing calculator or a computer software program such as MATLAB or Python. First, rearrange the equation to solve for y, then choose a range of values for t and calculate the corresponding values of y. Plot these points on a graph and connect them to create a smooth curve.

3. What do the different parts of the equation y'=te^{-2t}-2y represent?

The t represents the independent variable, while y represents the dependent variable. The e^{-2t} is the exponential function, and the te^{-2t} term represents the change in y over time (t). The -2y term represents the negative rate of change of y, indicating that y decreases as t increases.

4. How do I interpret the graph of y'=te^{-2t}-2y?

The graph of y'=te^{-2t}-2y will show a curve that approaches zero as t increases. This indicates that the value of y decreases over time. The steeper the curve, the faster y is decreasing. The y-intercept of the graph represents the initial value of y at t=0.

5. Can I use the graph to solve the equation y'=te^{-2t}-2y?

Yes, you can use the graph to solve the equation y'=te^{-2t}-2y. By plotting the graph, you can visually estimate the values of y at different values of t. You can also use the graph to identify any critical points, such as where the curve crosses the x-axis, which can help in solving the equation algebraically.

Similar threads

  • Differential Equations
Replies
9
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • STEM Educators and Teaching
Replies
5
Views
738
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
Back
Top