Ask Your Question

System of differential equations

asked 2017-02-28 04:29:30 +0200

carlotaaa2 gravatar image

updated 2017-02-28 16:35:59 +0200

calc314 gravatar image

Hi! I am doing a project on pursuit curves, and I am trying to plot the system:

de1 = diff(x,t) == 2*(-x)/sqrt(x^2+(t-y)^2)
de2 = diff(y,t) == 2*(t-y)/sqrt(x^2+(t-y)^2)

with x(t) and y(t) being my i and j components for the trajectory a an object.

I wrote:

t = var('t')
x = function('x',t)
y = function('y',t)
de1 = diff(x,t) == 2*(-x)/sqrt(x^2+(t-y)^2)
de2 = diff(y,t) == 2*(t-y)/sqrt(x^2+(t-y)^2)
f,g = desolve_system([de1, de2],[x,y],ics = [0,10,0])

It gives me a solution for my system, x(t) and y(t) (that I don't understand, since I hacen't seen Laplace), but I can't figure out how to plot the vector equation A(t) = *x(t)i + *y(t)j.

I wanted to use parametric_plot(x(t),y(t),(t,0,20)) but it doesn't work.

Could anyone help me?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-28 18:19:10 +0200

calc314 gravatar image

You may be better off with a numerical solution.

var('t x y')
edit flag offensive delete link more


Thank you!

But x and y are not variables, these are the i and j components of my pursuit curve, and they are functions of t. The graph should look a little bit like the one here: (

(I'm sorry if you actually have x and y as functions, I am really new to sage.)

carlotaaa2 gravatar imagecarlotaaa2 ( 2017-02-28 20:39:44 +0200 )edit

x and y are the dependent variables in the differential equations system. They are both functions of t. When you plot x vs. y, you are plotting in the phase plane and this is the graph of $x(t) i +y(t) j$ that you are asking for.

calc314 gravatar imagecalc314 ( 2017-03-01 15:05:42 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-02-28 04:25:07 +0200

Seen: 840 times

Last updated: Feb 28 '17