{"id":1664,"date":"2026-10-19T19:26:16","date_gmt":"2026-10-19T11:26:16","guid":{"rendered":"https:\/\/people.utm.my\/arazin\/?page_id=1664"},"modified":"2026-11-07T20:52:28","modified_gmt":"2026-11-07T12:52:28","slug":"mls-approximation-explorer","status":"publish","type":"page","link":"https:\/\/people.utm.my\/arazin\/mls-approximation-explorer\/","title":{"rendered":"MLS Approximation Explorer"},"content":{"rendered":"<div class=\"rz-page\">\n<p><!-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 ENGLISH \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 --><\/p>\n<div lang=\"en\">\n<p class=\"rz-eyebrow\">Interactive tool &middot; Meshfree methods<\/p>\n<h1>MLS Approximation Explorer<\/h1>\n<details class=\"rz-lead-fold\">\n<summary>About this tool<\/summary>\n<p class=\"rz-lead\">Change the dilation parameter &alpha;, the basis and the weight function, and watch how the Moving Least Squares approximation, its shape functions and its error respond. The sweep at the bottom finds the &alpha; that minimises the error for your current settings.<\/p>\n<\/details>\n<\/div>\n<p><!-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 BAHASA MELAYU \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 --><\/p>\n<div lang=\"ms\">\n<p class=\"rz-eyebrow\">Alatan interaktif &middot; Meshfree methods<\/p>\n<h1>MLS Approximation Explorer<\/h1>\n<details class=\"rz-lead-fold\">\n<summary>Tentang alatan ini<\/summary>\n<p class=\"rz-lead\">Ubah dilation parameter &alpha;, basis dan weight function, dan lihat bagaimana Moving Least Squares approximation, shape functions dan ralatnya bertindak balas. Sweep di bahagian bawah mencari &alpha; yang meminimumkan ralat bagi tetapan semasa anda.<\/p>\n<\/details>\n<\/div>\n<p><!-- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 THE TOOL \u2014 shared by both languages, loaded by the site bundle. Keep this line as it is. \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 --><\/p>\n<div data-rz-tool=\"mls\">\n<p><span lang=\"en\">Loading the interactive tool&hellip;<\/span><span lang=\"ms\">Memuatkan alatan interaktif&hellip;<\/span><\/p>\n<\/div>\n<div class=\"rzt-doc\">\n<div lang=\"en\">\n<details class=\"rz-acc\" open>\n<summary>How MLS works<\/summary>\n<div>\n<p>Moving Least Squares fits a small weighted polynomial around every point x. Each node I has a weight function w<sub>I<\/sub>(x) that is zero outside its support domain of radius d<sub>I<\/sub> = &alpha;h, where h is the nodal spacing and &alpha; is the dilation parameter. The approximation and its shape functions are<\/p>\n<div class=\"rzt-eq\">u<sup>h<\/sup>(x) = &Sigma;<sub>I<\/sub> &phi;<sub>I<\/sub>(x) u<sub>I<\/sub> &nbsp;&nbsp;&nbsp; &phi;<sub>I<\/sub>(x) = p<sup>T<\/sup>(x) A<sup>&minus;1<\/sup>(x) w<sub>I<\/sub>(x) p(x<sub>I<\/sub>)<\/div>\n<div class=\"rzt-eq\">A(x) = &Sigma;<sub>I<\/sub> w<sub>I<\/sub>(x) p(x<sub>I<\/sub>) p<sup>T<\/sup>(x<sub>I<\/sub>) &nbsp;&nbsp;&nbsp; (m &times; m moment matrix)<\/div>\n<ul>\n<li><b>&alpha; too small.<\/b> Some points see fewer than m nodes, A(x) becomes singular and the approximation breaks down. Near the boundary the support is one-sided, so on a regular grid the quadratic basis needs &alpha; &gt; 2 there, but only &alpha; &gt; 1.5 in the interior.<\/li>\n<li><b>&alpha; too large.<\/b> Every point averages over many nodes, the fit over-smooths, locality is lost and cond A(x) grows.<\/li>\n<li><b>In between<\/b> lies an &alpha;* that minimises the error. It depends on the basis, the weight function, the node layout and the function itself, so the sweep is recomputed for your current settings.<\/li>\n<li><b>MLS does not interpolate.<\/b> In general u<sup>h<\/sup>(x<sub>I<\/sub>) &ne; u<sub>I<\/sub>. This is why the Element-Free Galerkin method needs special treatment of essential boundary conditions, such as Lagrange multipliers, penalty, or coupling with finite elements.<\/li>\n<\/ul>\n<p>Implementation: shifted and scaled basis p(s) = [1, s, s&sup2;] with s = (x<sub>I<\/sub> &minus; x)\/h, which keeps A(x) well conditioned. Errors are relative L2 norms over 401 sample points on [0, 1]; du\/dx is obtained by second-order finite differences of u<sup>h<\/sup>.<\/p>\n<\/div>\n<\/details>\n<details class=\"rz-acc\">\n<summary>Things to try<\/summary>\n<div>\n<ol>\n<li>Choose f = 1 + 2x &minus; 3x&sup2; with the quadratic basis. The error drops to machine precision for every &alpha; that keeps A(x) non-singular. This is the reproducing, or consistency, property.<\/li>\n<li>Keep that function and switch to the linear basis. The error now depends on &alpha;. Where is &alpha;*?<\/li>\n<li>With the quadratic basis, slide &alpha; down from 2.5 towards 1.5. Where does the singular region appear first?<\/li>\n<li>Pick the tanh function and switch the sweep between u and du\/dx. Is &alpha;* the same for both?<\/li>\n<li>Switch to irregular nodes and press &ldquo;New layout&rdquo; a few times. How do &alpha;* and the singular region move?<\/li>\n<li>Double the number of nodes and read the error. How fast does it fall with h for each basis?<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<\/div>\n<div lang=\"ms\">\n<details class=\"rz-acc\" open>\n<summary>Bagaimana MLS berfungsi<\/summary>\n<div>\n<p>Moving Least Squares memadankan polinomial berpemberat yang kecil di sekitar setiap titik x. Setiap nod I mempunyai weight function w<sub>I<\/sub>(x) yang sifar di luar support domain berjejari d<sub>I<\/sub> = &alpha;h, dengan h ialah jarak antara nod dan &alpha; ialah dilation parameter. Approximation dan shape functions-nya ialah<\/p>\n<div class=\"rzt-eq\">u<sup>h<\/sup>(x) = &Sigma;<sub>I<\/sub> &phi;<sub>I<\/sub>(x) u<sub>I<\/sub> &nbsp;&nbsp;&nbsp; &phi;<sub>I<\/sub>(x) = p<sup>T<\/sup>(x) A<sup>&minus;1<\/sup>(x) w<sub>I<\/sub>(x) p(x<sub>I<\/sub>)<\/div>\n<div class=\"rzt-eq\">A(x) = &Sigma;<sub>I<\/sub> w<sub>I<\/sub>(x) p(x<sub>I<\/sub>) p<sup>T<\/sup>(x<sub>I<\/sub>) &nbsp;&nbsp;&nbsp; (moment matrix m &times; m)<\/div>\n<ul>\n<li><b>&alpha; terlalu kecil.<\/b> Sesetengah titik melihat kurang daripada m nod, A(x) menjadi singular dan approximation gagal. Berhampiran sempadan support hanya sebelah, jadi pada grid seragam basis kuadratik memerlukan &alpha; &gt; 2 di situ, tetapi hanya &alpha; &gt; 1.5 di bahagian dalam.<\/li>\n<li><b>&alpha; terlalu besar.<\/b> Setiap titik mempuratakan banyak nod, padanan menjadi terlalu licin, sifat setempat hilang dan cond A(x) meningkat.<\/li>\n<li><b>Di antaranya<\/b> terdapat &alpha;* yang meminimumkan ralat. Ia bergantung pada basis, weight function, susunan nod dan fungsi itu sendiri, jadi sweep dikira semula untuk tetapan semasa anda.<\/li>\n<li><b>MLS tidak menginterpolasi.<\/b> Secara umum u<sup>h<\/sup>(x<sub>I<\/sub>) &ne; u<sub>I<\/sub>. Inilah sebabnya Element-Free Galerkin method memerlukan rawatan khas bagi essential boundary conditions, seperti Lagrange multipliers, penalty, atau gandingan dengan finite elements.<\/li>\n<\/ul>\n<p>Pelaksanaan: basis teranjak dan berskala p(s) = [1, s, s&sup2;] dengan s = (x<sub>I<\/sub> &minus; x)\/h, yang mengekalkan A(x) berkeadaan baik. Ralat ialah norma relatif L2 atas 401 titik sampel pada [0, 1]; du\/dx diperoleh melalui finite differences peringkat kedua bagi u<sup>h<\/sup>.<\/p>\n<\/div>\n<\/details>\n<details class=\"rz-acc\">\n<summary>Cubaan untuk anda<\/summary>\n<div>\n<ol>\n<li>Pilih f = 1 + 2x &minus; 3x&sup2; dengan basis kuadratik. Ralat jatuh ke ketepatan mesin bagi setiap &alpha; yang mengekalkan A(x) tidak singular. Inilah sifat reproducing, atau consistency.<\/li>\n<li>Kekalkan fungsi itu dan tukar ke basis linear. Ralat kini bergantung pada &alpha;. Di manakah &alpha;*?<\/li>\n<li>Dengan basis kuadratik, gerakkan &alpha; turun dari 2.5 ke arah 1.5. Di manakah kawasan singular mula-mula muncul?<\/li>\n<li>Pilih fungsi tanh dan tukar sweep antara u dan du\/dx. Adakah &alpha;* sama bagi kedua-duanya?<\/li>\n<li>Tukar ke nod tak seragam dan tekan &ldquo;Susunan baharu&rdquo; beberapa kali. Bagaimana &alpha;* dan kawasan singular berubah?<\/li>\n<li>Gandakan bilangan nod dan baca ralatnya. Seberapa pantas ia jatuh dengan h bagi setiap basis?<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<div lang=\"en\">\n<h3>Related reading<\/h3>\n<div class=\"rz-links\">\n  <a href=\"https:\/\/people.utm.my\/arazin\/2023\/03\/11\/point-interpolation-method-pim\/\"><span class=\"k\">Post<\/span><\/p>\n<div><b>Point Interpolation Method (PIM)<\/b><span>A meshfree method whose shape functions do interpolate &mdash; compare with MLS.<\/span><\/div>\n<p><\/a><br \/>\n  <a href=\"https:\/\/people.utm.my\/arazin\/2023\/04\/01\/1495\/\"><span class=\"k\">Post<\/span><\/p>\n<div><b>Radial Basis Function (RBF)<\/b><span>Radial basis functions and the RPIM shape functions.<\/span><\/div>\n<p><\/a><br \/>\n  <a href=\"https:\/\/people.utm.my\/arazin\/2024\/03\/03\/1605\/\"><span class=\"k\">Review<\/span><\/p>\n<div><b>Meshless methods for crack problems<\/b><span>State-of-the-art review of meshless methods applied to fracture.<\/span><\/div>\n<p><\/a>\n<\/div>\n<p class=\"rz-note\">Runs entirely in your browser; nothing is sent anywhere. Source code: <a href=\"https:\/\/github.com\/RazinUTM\/rz-tools\" target=\"_blank\" rel=\"noopener\">github.com\/RazinUTM\/rz-tools<\/a>. Spotted a bug or have an idea for a tool? Email <a href=\"mailto:arazin@utm.my\">arazin@utm.my<\/a>.<\/p>\n<\/div>\n<div lang=\"ms\">\n<h3>Bacaan berkaitan<\/h3>\n<div class=\"rz-links\">\n  <a href=\"https:\/\/people.utm.my\/arazin\/2023\/03\/11\/point-interpolation-method-pim\/\"><span class=\"k\">Post<\/span><\/p>\n<div><b>Point Interpolation Method (PIM)<\/b><span>Kaedah meshfree yang shape functions-nya menginterpolasi &mdash; bandingkan dengan MLS.<\/span><\/div>\n<p><\/a><br \/>\n  <a href=\"https:\/\/people.utm.my\/arazin\/2023\/04\/01\/1495\/\"><span class=\"k\">Post<\/span><\/p>\n<div><b>Radial Basis Function (RBF)<\/b><span>Radial basis functions dan shape functions RPIM.<\/span><\/div>\n<p><\/a><br \/>\n  <a href=\"https:\/\/people.utm.my\/arazin\/2024\/03\/03\/1605\/\"><span class=\"k\">Ulasan<\/span><\/p>\n<div><b>Meshless methods untuk masalah retak<\/b><span>Ulasan state-of-the-art tentang meshless methods dalam masalah fracture.<\/span><\/div>\n<p><\/a>\n<\/div>\n<p class=\"rz-note\">Berjalan sepenuhnya dalam pelayar anda; tiada data dihantar ke mana-mana. Kod sumber: <a href=\"https:\/\/github.com\/RazinUTM\/rz-tools\" target=\"_blank\" rel=\"noopener\">github.com\/RazinUTM\/rz-tools<\/a>. Jumpa pepijat atau ada idea untuk alatan baharu? E-mel <a href=\"mailto:arazin@utm.my\">arazin@utm.my<\/a>.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Interactive tool &middot; Meshfree methods MLS Approximation Explorer About this tool Change the dilation parameter &alpha;, the basis and the weight function, and watch how the Moving Least Squares approximation, its shape functions and its error respond. The sweep at the bottom finds the &alpha; that minimises the error for your current settings. Alatan interaktif [&hellip;]<\/p>\n","protected":false},"author":6455,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-1664","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/pages\/1664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/users\/6455"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/comments?post=1664"}],"version-history":[{"count":3,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/pages\/1664\/revisions"}],"predecessor-version":[{"id":1724,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/pages\/1664\/revisions\/1724"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/media?parent=1664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}