Ask Your Question
0

System of differential equations

asked 2017-02-27 21:29:30 -0600

updated 2017-02-28 09:35:59 -0600

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])
show(f)
show(g)

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
0

answered 2017-02-28 11:19:10 -0600

calc314 gravatar image

You may be better off with a numerical solution.

var('t x y')
F=[2*(-x)/sqrt(x^2+(t-y)^2),2*(t-y)/sqrt(x^2+(t-y)^2)]
ics=[3,10]
times=srange(0,7,0.5)
soln=desolve_odeint(F,ics,times,[x,y])
line(soln)
edit flag offensive delete link more

Comments

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: http://mathworld.wolfram.com/PursuitCurve.html (http://mathworld.wolfram.com/PursuitC...)

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

carlotaaa2 gravatar imagecarlotaaa2 ( 2017-02-28 13:39:44 -0600 )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 08:05:42 -0600 )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

Stats

Asked: 2017-02-27 21:25:07 -0600

Seen: 98 times

Last updated: Feb 28