{"id":381,"date":"2019-02-11T01:42:24","date_gmt":"2019-02-11T09:42:24","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=381"},"modified":"2019-02-11T01:42:24","modified_gmt":"2019-02-11T09:42:24","slug":"64","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2019\/02\/64\/","title":{"rendered":"64"},"content":{"rendered":"","protected":true},"excerpt":{"rendered":"","protected":true},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-381","post","type-post","status-publish","format-standard","post-password-required","hentry","category-python"],"modified_by":null,"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s8bH0k-64","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":248,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/clustering\/","url_meta":{"origin":381,"position":0},"title":"#49 Clustering","author":"gantovnik","date":"2019-01-13","format":false,"excerpt":"\u00a0 \u00a0","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example49","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example49.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example49.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example49.png?resize=525%2C300 1.5x"},"classes":[]},{"id":203,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/laplace-equation-2d\/","url_meta":{"origin":381,"position":1},"title":"Laplace equation (2D)","author":"gantovnik","date":"2019-01-10","format":false,"excerpt":"import os import numpy as np import matplotlib.pyplot as plt import scipy.sparse as sp import matplotlib as mpl import scipy.sparse.linalg os.chdir(r'D:\\projects\\wordpress\\ex42') os.getcwd() N = 100 u0_t, u0_b = 5, -5 u0_l, u0_r = 3, -1 dx = 1. \/ (N+1) A_1d = (sp.eye(N, k=-1) + sp.eye(N, k=1) - 4 *\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example42","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example42.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example42.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example42.png?resize=525%2C300 1.5x"},"classes":[]},{"id":130,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/spline-interpolation-2\/","url_meta":{"origin":381,"position":2},"title":"Spline interpolation","author":"gantovnik","date":"2019-01-03","format":false,"excerpt":"import os import matplotlib.pyplot as plt import numpy as np from scipy import interpolate os.chdir(r'D:\\data\\scripts\\web1\\ex26') os.getcwd() def runge(x): return 1\/(1 + 25 * x**2) x = np.linspace(-1, 1, 11) y = runge(x) f = interpolate.interp1d(x, y, kind=3) xx = np.linspace(-1, 1, 100) fig, ax = plt.subplots(figsize=(8, 4)) ax.plot(xx, runge(xx), 'k',\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example26","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example26.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example26.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example26.png?resize=525%2C300 1.5x"},"classes":[]},{"id":82,"url":"https:\/\/gantovnik.com\/bio-tips\/2018\/12\/plot-with-an-inset\/","url_meta":{"origin":381,"position":3},"title":"#12: Plot with an inset in python","author":"gantovnik","date":"2018-12-29","format":false,"excerpt":"","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"example12","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example12.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example12.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2018\/12\/example12.png?resize=525%2C300 1.5x"},"classes":[]},{"id":133,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/spline-interpolation-3\/","url_meta":{"origin":381,"position":4},"title":"#27 Spline interpolation","author":"gantovnik","date":"2019-01-03","format":false,"excerpt":"import os import matplotlib.pyplot as plt import numpy as np from scipy import interpolate os.chdir(r'D:\\data\\scripts\\web1\\ex27') os.getcwd() x = np.array([0, 1, 2, 3, 4, 5, 6, 7]) y = np.array([3, 4, 3.5, 2, 1, 1.5, 1.25, 0.9]) xx = np.linspace(x.min(), x.max(), 100) fig, ax = plt.subplots(figsize=(8, 4)) ax.scatter(x, y) for n\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example27","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example27.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example27.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example27.png?resize=525%2C300 1.5x"},"classes":[]},{"id":200,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/01\/heat-equation-1d\/","url_meta":{"origin":381,"position":5},"title":"Heat equation (1D)","author":"gantovnik","date":"2019-01-10","format":false,"excerpt":"import os import numpy as np import matplotlib.pyplot as plt os.chdir(r'D:\\projects\\wordpress\\ex41') os.getcwd() N = 5 u0 = 1 u1 = 2 dx = 1.0 \/ (N + 1) A = (np.eye(N, k=-1) - 2 * np.eye(N) + np.eye(N, k=1)) \/ dx**2 print(A) d = -5 * np.ones(N) d[0] -= u0\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"example41","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example41.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example41.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2019\/01\/example41.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=381"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/381\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}