{"id":554,"date":"2017-09-14T13:34:51","date_gmt":"2017-09-14T16:34:51","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=554"},"modified":"2017-09-14T13:34:51","modified_gmt":"2017-09-14T16:34:51","slug":"smdode45-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/smdode45-m\/","title":{"rendered":"smdode45.m."},"content":{"rendered":"<pre>% function file for spring-mass-damper ode45 solution\r\n%\r\nfunction dydx = smdode45(time,variables)\r\n\r\nm = 1;         % mass\r\nc = 1;         % damping\r\nk = 6;         % spring stiffness\r\n\r\nt1 = 2;        % start time of square wave\r\nt2 = 14;       % end time of square wave\r\nfsquare = 10;  % square wave amplitude\r\n\r\nif (time &gt;= t1) &amp; ( time &lt;= t2)   % evaluate forcing function\r\n  f = fsquare;                    % amplitude\r\nelse\r\n  f = 0;\r\nend\r\n\r\nx = variables(1);                 % the input variables\r\nv = variables(2);\r\n\r\ndydx(1) = v;                      % and their derivatives\r\ndydx(2) = (f - c*v - k*x)\/m;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>% function file for spring-mass-damper ode45 solution % function dydx = smdode45(time,variables) m = 1; % mass c = 1; % damping k = 6; % spring stiffness t1 = 2; % start time of square wave t2 = 14; % end time of square wave fsquare = 10; % square wave amplitude if (time [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-554","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=554"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/554\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/554\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}