{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/111","repository_url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl","labels_url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/111/comments","events_url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/111/events","html_url":"https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/111","id":189434847,"number":111,"title":"Phase Plot Recipe","user":{"login":"ChrisRackauckas","id":1814174,"avatar_url":"https://avatars.githubusercontent.com/u/1814174?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisRackauckas","html_url":"https://github.com/ChrisRackauckas","followers_url":"https://api.github.com/users/ChrisRackauckas/followers","following_url":"https://api.github.com/users/ChrisRackauckas/following{/other_user}","gists_url":"https://api.github.com/users/ChrisRackauckas/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisRackauckas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisRackauckas/subscriptions","organizations_url":"https://api.github.com/users/ChrisRackauckas/orgs","repos_url":"https://api.github.com/users/ChrisRackauckas/repos","events_url":"https://api.github.com/users/ChrisRackauckas/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisRackauckas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-15T16:11:40Z","updated_at":"2016-11-16T16:44:09Z","closed_at":null,"body":"The current recipes are nice, but many times people would rather plot the phase plot than the timeseries. I think it would be nice to have a `plot(sol,phase=[1,3,5])` to choose what coordinates to do a phase plot from, with the timeplot occuring as the default with `phase=[]`."},"comment":{"url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/comments/261000014","html_url":"https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/111#issuecomment-261000014","issue_url":"https://api.github.com/repos/JuliaDiffEq/DifferentialEquations.jl/issues/111","id":261000014,"user":{"login":"Armavica","id":5855503,"avatar_url":"https://avatars.githubusercontent.com/u/5855503?v=3","gravatar_id":"","url":"https://api.github.com/users/Armavica","html_url":"https://github.com/Armavica","followers_url":"https://api.github.com/users/Armavica/followers","following_url":"https://api.github.com/users/Armavica/following{/other_user}","gists_url":"https://api.github.com/users/Armavica/gists{/gist_id}","starred_url":"https://api.github.com/users/Armavica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Armavica/subscriptions","organizations_url":"https://api.github.com/users/Armavica/orgs","repos_url":"https://api.github.com/users/Armavica/repos","events_url":"https://api.github.com/users/Armavica/events{/privacy}","received_events_url":"https://api.github.com/users/Armavica/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T16:44:09Z","updated_at":"2016-11-16T16:44:09Z","body":"It is not different than when you plot the timeseries of two variables on the same graph. In this case 5 and 6 could be the same thing but related to two different components of the system (like their respective position), or different things related to the same component (like the two components of the velocity vector in 2D for example).\r\n\r\nIf you want a concrete example, here's three agents that start equally distant and that run towards each other:\r\n```julia\r\nusing DifferentialEquations\r\nusing RecursiveArrayTools\r\nusing Plots\r\n\r\nfunction f(t, u)\r\n    u2 = [u[2:end,:]; u[1:1,:]]\r\n    du = u2-u\r\n    for i = 1:size(du,1)\r\n        n = norm(du[i,:])\r\n        du[i,:] /= n\r\n    end\r\n    return du\r\nend\r\n\r\nu0 = [0. 0.; 1. 0.; 1/2 sqrt(3)/2]\r\ntspan = (0., .666)\r\nprob = ODEProblem(f, u0, tspan)\r\nsol = solve(prob, dtmax=.01)\r\n\r\n# plot(sol, vars=([1,3,5], [2,4,6]))\r\nusol = vecvec_to_mat(sol.u')\r\np = plot(usol[:,1], usol[:,2])\r\nplot!(p, usol[:,3], usol[:,4])\r\nplot!(p, usol[:,5], usol[:,6])\r\n```"}}
{"actor":{"display_login":"Armavica"}}