mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-25 06:12:11 +08:00
Documentation for f4403718ef
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.20"/>
|
||||
<meta name="generator" content="Doxygen 1.9.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: numerical_methods/ode_forward_euler.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -42,10 +42,10 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.20 -->
|
||||
<!-- Generated by Doxygen 1.9.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search','.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
@@ -143,7 +143,7 @@ Functions</h2></td></tr>
|
||||
<p>To implement <a href="https://en.wikipedia.org/wiki/Van_der_Pol_oscillator">Van der Pol oscillator</a>, change the <a class="el" href="../../db/dd3/ode__forward__euler_8cpp.html#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>
|
||||
<div class="line">dy[0] = y[1];</div>
|
||||
<div class="line">dy[1] = mu * (1.f - y[0] * y[0]) * y[1] - y[0];</div>
|
||||
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d6/dd3/ode__midpoint__euler_8cpp.html" title="Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method">ode_midpoint_euler.cpp</a>, <a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html" title="Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler met...">ode_semi_implicit_euler.cpp</a> </dd></dl>
|
||||
</div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d6/dd3/ode__midpoint__euler_8cpp.html" title="Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method">ode_midpoint_euler.cpp</a>, <a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html" title="Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler met...">ode_semi_implicit_euler.cpp</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="af3adf7b092a87868917ee5fb4255192b"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#af3adf7b092a87868917ee5fb4255192b">◆ </a></span>exact_solution()</h2>
|
||||
@@ -183,6 +183,8 @@ Functions</h2></td></tr>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  y[0][0] = <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a>(x);</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  y[0][1] = -<a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a>(x);</div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||
<div class="ttc" id="acos_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a></div><div class="ttdeci">T cos(T... args)</div></div>
|
||||
<div class="ttc" id="asin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a></div><div class="ttdeci">T sin(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -241,6 +243,12 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  </div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span> }</div>
|
||||
<div class="ttc" id="aatof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a></div><div class="ttdeci">T atof(T... args)</div></div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="agroup__ode_html_gae0509f8843e2bc42de2abbd00a14b7b9"><div class="ttname"><a href="../../d6/d60/group__ode.html#gae0509f8843e2bc42de2abbd00a14b7b9">forward_euler</a></div><div class="ttdeci">double forward_euler(double dx, double x0, double x_max, std::valarray< double > *y, bool save_to_file=false)</div><div class="ttdoc">Compute approximation using the forward-Euler method in the given limits.</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:102</div></div>
|
||||
<div class="ttc" id="aode__forward__euler_8cpp_html_aa13517b8e5de1b75592052db7f7e237f"><div class="ttname"><a href="../../db/dd3/ode__forward__euler_8cpp.html#aa13517b8e5de1b75592052db7f7e237f">save_exact_solution</a></div><div class="ttdeci">void save_exact_solution(const double &X0, const double &X_MAX, const double &step_size, const std::valarray< double > &Y0)</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:153</div></div>
|
||||
<div class="ttc" id="avalarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray< double ></a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -377,6 +385,11 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  </div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  fp.close();</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> }</div>
|
||||
<div class="ttc" id="abasic_ofstream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a></div></div>
|
||||
<div class="ttc" id="aclock_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/clock.html">std::clock</a></div><div class="ttdeci">T clock(T... args)</div></div>
|
||||
<div class="ttc" id="aclock_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/clock_t.html">std::clock_t</a></div></div>
|
||||
<div class="ttc" id="aode__forward__euler_8cpp_html_af3adf7b092a87868917ee5fb4255192b"><div class="ttname"><a href="../../db/dd3/ode__forward__euler_8cpp.html#af3adf7b092a87868917ee5fb4255192b">exact_solution</a></div><div class="ttdeci">void exact_solution(const double &x, std::valarray< double > *y)</div><div class="ttdoc">Exact solution of the problem. Used for solution comparison.</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:67</div></div>
|
||||
<div class="ttc" id="aperror_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/c/perror.html">std::perror</a></div><div class="ttdeci">T perror(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -388,24 +401,11 @@ Here is the call graph for this function:</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<div class="ttc" id="aclock_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/clock_t.html">std::clock_t</a></div></div>
|
||||
<div class="ttc" id="acos_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/cos.html">std::cos</a></div><div class="ttdeci">T cos(T... args)</div></div>
|
||||
<div class="ttc" id="aode__forward__euler_8cpp_html_af3adf7b092a87868917ee5fb4255192b"><div class="ttname"><a href="../../db/dd3/ode__forward__euler_8cpp.html#af3adf7b092a87868917ee5fb4255192b">exact_solution</a></div><div class="ttdeci">void exact_solution(const double &x, std::valarray< double > *y)</div><div class="ttdoc">Exact solution of the problem. Used for solution comparison.</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:67</div></div>
|
||||
<div class="ttc" id="aatof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/byte/atof.html">std::atof</a></div><div class="ttdeci">T atof(T... args)</div></div>
|
||||
<div class="ttc" id="aclock_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/clock.html">std::clock</a></div><div class="ttdeci">T clock(T... args)</div></div>
|
||||
<div class="ttc" id="aode__forward__euler_8cpp_html_aa13517b8e5de1b75592052db7f7e237f"><div class="ttname"><a href="../../db/dd3/ode__forward__euler_8cpp.html#aa13517b8e5de1b75592052db7f7e237f">save_exact_solution</a></div><div class="ttdeci">void save_exact_solution(const double &X0, const double &X_MAX, const double &step_size, const std::valarray< double > &Y0)</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:153</div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="abasic_ofstream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ofstream.html">std::ofstream</a></div><div class="ttdoc">STL class.</div></div>
|
||||
<div class="ttc" id="aperror_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/c/perror.html">std::perror</a></div><div class="ttdeci">T perror(T... args)</div></div>
|
||||
<div class="ttc" id="avalarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/valarray.html">std::valarray< double ></a></div></div>
|
||||
<div class="ttc" id="agroup__ode_html_gae0509f8843e2bc42de2abbd00a14b7b9"><div class="ttname"><a href="../../d6/d60/group__ode.html#gae0509f8843e2bc42de2abbd00a14b7b9">forward_euler</a></div><div class="ttdeci">double forward_euler(double dx, double x0, double x_max, std::valarray< double > *y, bool save_to_file=false)</div><div class="ttdoc">Compute approximation using the forward-Euler method in the given limits.</div><div class="ttdef"><b>Definition:</b> ode_forward_euler.cpp:102</div></div>
|
||||
<div class="ttc" id="asin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sin.html">std::sin</a></div><div class="ttdeci">T sin(T... args)</div></div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
|
||||
<!-- start footer part -->
|
||||
<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="http://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </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.9.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user