{"id":26,"date":"2014-11-17T18:14:58","date_gmt":"2014-11-17T18:14:58","guid":{"rendered":"http:\/\/lop.blogwyrm.com\/?p=26"},"modified":"2014-11-17T18:14:58","modified_gmt":"2014-11-17T18:14:58","slug":"numerically-solve-an-ode-in-maxima","status":"publish","type":"post","link":"https:\/\/lop.blogwyrm.com\/?p=26","title":{"rendered":"Numerically solve an ODE in Maxima"},"content":{"rendered":"<p>As an example, solve the SHO numerically in Maxima<\/p>\n<ol>\n<li>load(\"dynamics\")<\/li>\n<li>Specify only the RHS of <span class='MathJax_Preview'><img src='https:\/\/lop.blogwyrm.com\/wp-content\/plugins\/latex\/cache\/tex_658c40ae09f3ca2766de78dcd9ccc803.gif' style='vertical-align: middle; border: none; ' class='tex' alt=\"\" \/><\/span><script type='math\/tex'><\/script>. Note that dx_dt and dvx_dt are simply names of expressions\n<ul>\n<li>dx_dt \u00a0 \u00a0 \u00a0 \u00a0 : vx<\/li>\n<li>dvx_dt \u00a0 \u00a0 \u00a0 : -omega^2 * x<\/li>\n<li>my_odes \u00a0: [dx_dt,dvx_dt]<\/li>\n<\/ul>\n<\/li>\n<li>Define the variable names\n<ul>\n<li>var_names : [x,vx]<\/li>\n<\/ul>\n<\/li>\n<li>Specify initial conditions\n<ul>\n<li>x0 \u00a0 \u00a0: 1<\/li>\n<li>vx0 : 0<\/li>\n<li>ICs : [x0,vx0]<\/li>\n<\/ul>\n<\/li>\n<li>define the domain of time (independent variable name, span and step) over which the equations will be solved\n<ul>\n<li>t_var \u00a0 \u00a0 \u00a0 \u00a0 \u00a0: t<\/li>\n<li>t_start \u00a0 \u00a0 \u00a0 : 0<\/li>\n<li>t_stop \u00a0 \u00a0 \u00a0 \u00a0: 10<\/li>\n<li>t_step \u00a0 \u00a0 \u00a0 \u00a0: 0.1<\/li>\n<li>t_domain : [t_var, t_start, t_stop, t_step]<\/li>\n<\/ul>\n<\/li>\n<li>Issue the command to run\n<ul>\n<li>Z : rk(my_odes,var_names,ICs,t_domain)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>As an example, solve the SHO numerically in Maxima load(\"dynamics\") Specify only the RHS of . Note that dx_dt and dvx_dt are simply names of expressions dx_dt \u00a0 \u00a0 \u00a0 \u00a0 : vx dvx_dt \u00a0 \u00a0 \u00a0 : -omega^2 * x my_odes \u00a0: [dx_dt,dvx_dt] Define the variable names var_names : [x,vx] Specify initial conditions x0 &hellip; <a href=\"https:\/\/lop.blogwyrm.com\/?p=26\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Numerically solve an ODE in Maxima<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11,12],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-maxima","tag-ode"],"_links":{"self":[{"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":9,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lop.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}