
{"id":120,"date":"2014-04-22T10:29:44","date_gmt":"2014-04-22T14:29:44","guid":{"rendered":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/?p=120"},"modified":"2014-04-22T10:35:36","modified_gmt":"2014-04-22T14:35:36","slug":"direction-fields-for-2x2-systems","status":"publish","type":"post","link":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/direction-fields-for-2x2-systems\/","title":{"rendered":"Direction fields for 2&#215;2 systems"},"content":{"rendered":"<p>Here is the Sage code to produce a direction field for a 2&#215;2 system of ODEs.<\/p>\n<p><code><br \/>\n# v' = Av, A is 2x2 matrix<br \/>\nA = matrix([[-1\/2,1],[-1,-1\/2]]);<br \/>\nprint 'You entered: A = ';<br \/>\nprint A;<br \/>\nx,y = var('x,y');<br \/>\nintermediate_step = (A*vector([x,y])).normalized();<br \/>\nv_prime(x,y) = (intermediate_step[0],intermediate_step[1]);<br \/>\nplot_vector_field(v_prime(x,y), (x,-2,2), (y,-2,2))<br \/>\n<\/code><\/p>\n<p>If you haven&#8217;t already, go to <a href=\"http:\/\/sagenb.org\">sagenb.org<\/a>, log in (you might should click the Google or Yahoo icon), open a new worksheet, copy paste this into a cell, and click &#8220;evaluate&#8221;. You should get a beautiful direction field.<\/p>\n<p>Note, I&#8217;m finding that sagenb.org isn&#8217;t working the way it used to. If having trouble, you might try <a href=\"https:\/\/cloud.sagemath.com\/\">https:\/\/cloud.sagemath.com\/<\/a> and create a new project and create a new Sage worksheet, then copy, paste, and run the code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is the Sage code to produce a direction field for a 2&#215;2 system of ODEs. # v&#8217; = Av, A is 2&#215;2 matrix A = matrix([[-1\/2,1],[-1,-1\/2]]); print &#8216;You entered: A = &#8216;; print A; x,y = var(&#8216;x,y&#8217;); intermediate_step = (A*vector([x,y])).normalized(); v_prime(x,y) = (intermediate_step[0],intermediate_step[1]); plot_vector_field(v_prime(x,y), (x,-2,2), (y,-2,2)) If you haven&#8217;t already, go to sagenb.org, log [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/posts\/120"}],"collection":[{"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":5,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/posts\/120\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pdhorn.expressions.syr.edu\/spring2014mat414\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}