Documentation for c26eea874d

This commit is contained in:
realstealthninja
2025-05-19 11:38:33 +00:00
parent c7a9a42397
commit 14583a2f33
2829 changed files with 30266 additions and 21669 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: numerical_methods/ode_forward_euler.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -60,7 +60,7 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -165,18 +165,16 @@ Functions</h2></td></tr>
<div class="textblock"><p>Solve a multivariable first order <a href="https://en.wikipedia.org/wiki/Ordinary_differential_equation" target="_blank">ordinary differential equation (ODEs)</a> using <a href="https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations#Euler_method" target="_blank">forward Euler method</a> </p>
<dl class="section author"><dt>Authors</dt><dd><a href="https://github.com/kvedala" target="_blank">Krishna Vedala</a> </dd></dl>
<p>The ODE being solved is: </p><p class="formulaDsp">
\begin{eqnarray*}
\dot{u} &amp;=&amp; v\\
\begin{eqnarray*} \dot{u} &amp;=&amp; v\\
\dot{v} &amp;=&amp; -\omega^2 u\\
\omega &amp;=&amp; 1\\
[x_0, u_0, v_0] &amp;=&amp; [0,1,0]\qquad\ldots\text{(initial values)}
\end{eqnarray*}
\end{eqnarray*}
</p>
<p> The exact solution for the above problem is: </p><p class="formulaDsp">
\begin{eqnarray*}
u(x) &amp;=&amp; \cos(x)\\
\begin{eqnarray*} u(x) &amp;=&amp; \cos(x)\\
v(x) &amp;=&amp; -\sin(x)\\
\end{eqnarray*}
\end{eqnarray*}
</p>
<p> The computation results are stored to a text file <code>forward_euler.csv</code> and the exact soltuion results in <code>exact.csv</code> for comparison. <img src="https://raw.githubusercontent.com/TheAlgorithms/C-Plus-Plus/docs/images/numerical_methods/ode_forward_euler.svg" alt="Implementation solution" style="pointer-events: none;" class="inline"/></p>
<p>To implement <a href="https://en.wikipedia.org/wiki/Van_der_Pol_oscillator" target="_blank">Van der Pol oscillator</a>, change the <a class="el" href="#abaeae8f62a018d197f0187a1c80a90fe" title="Problem statement for a system with first-order differential equations. Updates the system differenti...">problem</a> function to: </p><div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">double</span> mu = 2.0;</div>
@@ -395,7 +393,7 @@ Functions</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../db/dd3/ode__forward__euler_8cpp.html">ode_forward_euler.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>