[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-85412-en":3,"doc-seo-85412-105":29,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},85412,1099513958762,"Logic","https://ap-avatar.wpscdn.com/avatar/1000023916a998db790?x-image-process=image/resize,m_fixed,w_180,h_180&k=1782109480056885918",8,"Research & Report","A Learning-Based Ansatz Satisfying Boundary Conditions in Variational Problems","Recently, innovative Deep Ritz adaptations use neural networks as trial functions for variational problems, yet trial functions do not automatically satisfy boundary conditions. The Deep Ritz Method typically adds a hyperparameter-dependent penalty term to the functional, which can slow or mislead optimization and complicate convergence. This work proposes an ansatz that inherently satisfies boundary conditions, removing penalty terms. The study proves relevant theorems and corollaries in Sobolev norms, providing a rigorous Ritz-method admissibility justification and improved practical accuracy with reduced complexity.","arXiv :2505 . 12430v2 [ cs .LG] 10 Jul 2026  \nA Learning-Based Ansatz Satisfying Boundary Conditions in Variational Problems  \nRafael Florencio 1*† and Julio Guerrero2†  \n1* Departamento de Matem´aticas, Universidad de Ja´en, Edificio de Servicios Generales-Campus Cient´ıfico Tecnol´ogico de Linares. Avda. de la Universidad (Cintur´on Sur), s/n, Linares, 23700, Ja´en, Espa˜na.  \n2 Departamento de Matem´aticas, Universidad de Ja´en, Campus Las  \nLagunillas, Ja´en, 23071, Ja´en, Espa˜na.  \n*Corresponding author(s) . E-mail(s): [rfdiaz@ujaen.es](rfdiaz@ujaen.es) ; Contributing [authors: jguerrer@ujaen.es](authors: jguerrer@ujaen.es);  \n†These authors contributed equally to this work.  \nAbstract  \nRecently, innovative adaptations of the Ritz method incorporating deep learning have been developed, known as the Deep Ritz Method. This approach employs a neural network as the trial function for variational problems. However, the neural network does not inherently satisfy the boundary conditions of the variational problem. To address this issue, the Deep Ritz Method introduces a penalty term into the functional, which is strongly dependent on hyperparameters and may lead to misleading results during the optimization process.  \nIn this work, we propose an ansatz that inherently satisfies the boundary conditions of the variational problem, thereby eliminating the need for penalty terms. A key contribution of this study is that all supporting theorems and corollaries are established in Sobolev norms, which constitute the natural framework for variational problems, as the functional depends explicitly on the solution and its derivatives. This provides a rigorous justification for the expressiveness and admissibility of the proposed ansatz within the Ritz method.  \nThe results demonstrate that the proposed ansatz not only avoids misleading optimization outcomes but also reduces complexity while maintaining accuracy, highlighting its practical effectiveness for solving variational problems.  \nKeywords: Ritz method, variational problem, approximation, neural network  \n1  \n1 Introduction  \nPartial differential equations (PDEs) arise in many scientific branches. In some cases problems, the PDE can be derived from a functional associated to a variational problem. In these cases, the solutions of the PDE problem can be recognized as critical points of the functional [1] . This forms the foundation of the calculus of variations [2]-[4], and its solutions involve the well-known Euler-Lagrange equations, which allow fora transition to the PDE approach. This approach is frequently found in physics [5] . In fact, there are many versions of this approach depending on the different fields of physics (classical mechanics [6],[7]; quantum mechanics [8],[9]; particle physics [10],[11]; general relativity [12],[13], etc.) . These versions of the approach are known as Action Principles and constitute the core of the different fields of physics. An Action Principle starts with a scalar function called a Lagrangian, which describes the physical system. The accumulated value of this Lagrangian function between two states of the system is called the action. The Action Principles assume that, among all possibilities, the actual evolution of the physical system produces a critical point of the action.  \nWhen exact solutions are not possible, approximation techniques are usually employed, such as the Finite Element Method (FEM) [14], [15], Galerkin Method [16], and Ritz Method [17], [18] . The Ritz Method is an interesting approximation technique which consists of choosing a finite number of admissible trial functions such that the solution y (x) can be determined as a linear combination of these finite trial functions. Recently, novel versions of the Ritz Method integrated with deep learning have been explored. This is known as the Deep Ritz Method [19]-[21] . This method is based on the Universal Approximation Theorem, which essentially states that a neural netwo","cbCainXvMJrvEbMS","https://ap.wps.com/l/cbCainXvMJrvEbMS","pdf",814367,1,22,"English","en",105,"# Introduction\n## Variational problems, action principles, and Ritz approximation\n## Deep Ritz Method and penalty-based boundary enforcement\n## Motivation for ansatzes without penalty terms","[{\"question\":\"Why does the Deep Ritz Method require a penalty term for boundary conditions?\",\"answer\":\"Neural-network trial functions used in the Deep Ritz Method do not inherently satisfy the variational problem’s boundary conditions, so the functional is modified with a penalty term to enforce them.\"},{\"question\":\"What drawbacks can arise from the penalty term in Deep Ritz Method optimization?\",\"answer\":\"The penalty term can make the action non-convex and introduce sensitivity to a hyperparameter, which strongly affects convergence rate and may produce misleading optimization outcomes.\"},{\"question\":\"How does the proposed learning-based ansatz satisfy boundary conditions without penalty terms?\",\"answer\":\"The ansatz is constructed using a term that enforces boundary behavior and a second term formed by multiplying a neural network by a function g chosen to vanish at the domain boundary, ensuring the boundary conditions while keeping differentiability inside the domain.\"}]",1784203214,55,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"a-learning-based-ansatz-satisfying-boundary-conditions-in-variational-problems","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/a-learning-based-ansatz-satisfying-boundary-conditions-in-variational-problems/85412/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"Why does the Deep Ritz Method require a penalty term for boundary conditions?","Question",{"text":74,"@type":75},"Neural-network trial functions used in the Deep Ritz Method do not inherently satisfy the variational problem’s boundary conditions, so the functional is modified with a penalty term to enforce them.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What drawbacks can arise from the penalty term in Deep Ritz Method optimization?",{"text":79,"@type":75},"The penalty term can make the action non-convex and introduce sensitivity to a hyperparameter, which strongly affects convergence rate and may produce misleading optimization outcomes.",{"name":81,"@type":72,"acceptedAnswer":82},"How does the proposed learning-based ansatz satisfy boundary conditions without penalty terms?",{"text":83,"@type":75},"The ansatz is constructed using a term that enforces boundary behavior and a second term formed by multiplying a neural network by a function g chosen to vanish at the domain boundary, ensuring the boundary conditions while keeping differentiability inside the domain.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,127,130,134],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":45,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":45,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":45,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":45,"category_name":136,"show_sort_weight":105,"slug":137},19,"General","general"]