{"id":1417,"date":"2021-10-03T23:18:51","date_gmt":"2021-10-03T14:18:51","guid":{"rendered":"http:\/\/www.miyamoto-lab.com\/?page_id=1417"},"modified":"2021-10-04T12:44:40","modified_gmt":"2021-10-04T03:44:40","slug":"87rghiurgo","status":"publish","type":"page","link":"https:\/\/www.miyamoto-lab.com\/ja\/87rghiurgo\/","title":{"rendered":"3. 3\u7ae0\u306e\u7b54\u3048\u30fb\uff12"},"content":{"rendered":"\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-c\" data-lang=\"C\"><code>#include &lt;stdio.h&gt;\n#include &lt;math.h&gt;\n#define N 100\n#define Xs 0\n#define Xe 3.0\ndouble f(double x, double y);\ndouble analytical(double x);\nint main(void) {\n  double h=(Xe-Xs)\/N;\n  double x=0.0;\n  double y=4.0;\n  double k1,k2,k3,k4;\n  int i;\n  for (i = 0; i &lt; N; i++) {\n    k1=h*f(x, y);\n    k2=h*f(x+h\/2.0, y+k1\/2.0);\n    k3=h*f(x+h\/2.0, y+k2\/2.0);\n    k4=h*f(x+h, y+k3);\n    y=y+(k1+2.0*k2+2.0*k3+k4)\/6.0;\n    x=x+h;\n    printf(&quot;%4.4lf\\t %4.4lf\\t  %4.4lf\\n&quot;,x,y,analytical(x));   \n  }\n}\ndouble f(double x, double y) {\n        return x * y;\n}\ndouble analytical(double x) {\n        return 4.0*exp(x*x \/ 2.0);\n}<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_locale":"ja","_original_post":"http:\/\/www.miyamoto-lab.com\/?page_id=1417","footnotes":""},"class_list":["post-1417","page","type-page","status-publish","hentry","ja"],"_links":{"self":[{"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/pages\/1417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/comments?post=1417"}],"version-history":[{"count":4,"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/pages\/1417\/revisions"}],"predecessor-version":[{"id":1453,"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/pages\/1417\/revisions\/1453"}],"wp:attachment":[{"href":"https:\/\/www.miyamoto-lab.com\/wp-json\/wp\/v2\/media?parent=1417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}