<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elias Niepötter on Medium]]></title>
        <description><![CDATA[Stories by Elias Niepötter on Medium]]></description>
        <link>https://medium.com/@eliasniepoetter?source=rss-2ce835b80044------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d3AmlSSTGTdFo6sQbyaCpA.jpeg</url>
            <title>Stories by Elias Niepötter on Medium</title>
            <link>https://medium.com/@eliasniepoetter?source=rss-2ce835b80044------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 12:49:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eliasniepoetter/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Shortform: What Exactly are Systems?]]></title>
            <link>https://medium.com/technology-hits/shortform-what-exactly-are-systems-d42fc658633a?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/d42fc658633a</guid>
            <category><![CDATA[time]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[system]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Thu, 15 Apr 2021 14:22:23 GMT</pubDate>
            <atom:updated>2021-04-15T14:22:23.757Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>To be very abstract, a system is something that gets an input and has an output.</strong> The numbers of inputs and outputs can vary so we will differentiate between a Single Input Single Output System (SISO-System) and a Multiple-Inputs Multiple-Output Systems (MIMO-System).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*-qI9l1pOpWXf6AJ3s_u2ig.png" /><figcaption>Figure 1: SISO System (image by author)</figcaption></figure><p>In systems engineering, everything can be broken down into 3 basic elements or any combination of them. These elements are the P-, the I- and D-element. The indices P, I and D correspond to the proportionality of the system&#39;s output to input. The output y of a system is proportional</p><ul><li>directly to the input u (P).</li><li>to the integral of the input u (I).</li><li>to the derivative of the input u (D).</li></ul><p><a href="https://medium.com/illumination/what-exactly-are-systems-2f4b09023747">What exactly are systems?</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xfgi8Xs8_mh7jq3zp9TWYQ.png" /><figcaption>image by author</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d42fc658633a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/technology-hits/shortform-what-exactly-are-systems-d42fc658633a">Shortform: What Exactly are Systems?</a> was originally published in <a href="https://medium.com/technology-hits">Technology Hits</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What exactly are systems?]]></title>
            <link>https://medium.com/illumination/what-exactly-are-systems-2f4b09023747?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f4b09023747</guid>
            <category><![CDATA[system]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[time]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Wed, 07 Apr 2021 13:12:47 GMT</pubDate>
            <atom:updated>2021-04-07T13:12:47.083Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Exactly are Systems?</h3><h4>Math &amp; Math | Introducing Systems Engineering</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OxH41NzAwwNdjDGe.png" /><figcaption>image created by author</figcaption></figure><p>This part of engineering fundamentals is going to introduce you to Systems Engineering. I’m going to explain the basic concepts of how to describe a system in the time domain using examples to make things clearer. This story is not about modeling.</p><ol><li>Abstract</li><li>The basic elements: P, I and D</li><li>Variations of basic elements</li><li>Summary</li></ol><h3>Abstract</h3><p>To be very abstract, a system is something that gets an input and has an output. The numbers of inputs and outputs can vary so we will differentiate between a Single Input Single Output System (SISO-System) and a Multiple-Inputs Multiple-Output Systems (MIMO-System). The input is processed by the system. There are many different types of systems:</p><ul><li>mechanical</li><li>electrical</li><li>hydraulic</li><li>biological</li><li>chemical</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/0*gzO3Unlro7AUPDjc.png" /><figcaption>Figure 1: SISO System (image by author)</figcaption></figure><p>Why is a system even interesting to describe in a theoretical manner? Because if we can describe it, we can approximate outputs for unknown inputs. It is important to differentiate between an exact calculation and an approximation here. There are two reasons why we approximate the behaviour of a system instead of calculating it:</p><ol><li>We can’t describe a real-world system in all of its details, there are just too many</li><li>We can’t solve the mathematical equations describing the system analytically</li></ol><p>Approximations these days are generated by computers through simulations where the mathematical equations are solved numerically. To describe a system, we need mathematics. Mathematic is the general tool used in Systems Engineering. I’m going to cover the most basic elements in System Engineering and their mathematical description in the following.</p><h3>The basics: P, I and D¹</h3><p>In systems engineering, everything can be broken down into 3 basic elements or any combination of them. The most simple element is the P-element. The P stands for “Proportional”. The output is directly proportional to the input, you can imagine it as an amplifier. A simple example for this is a spring. The deflection is proportional to the applied force, the stiffness of the spring is the proportionality factor.</p><p>In systems engineering the input is indicated with <strong><em>u</em></strong> and the output with <strong><em>y</em></strong>. It is a common technique to express the flow of a signal (from input to output) through a block diagram. The block element of a P-element can be seen in Fig. 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/0*SNJNrCTTivhe1Ycy.png" /><figcaption>Figure 1: block of a P-element¹</figcaption></figure><p>Fig. 2 shows the block element of an IT1-element. I will go into more detail on variations of these basic block elements later. The right block in Fig. 2 shows an I-element block. While the output of a P-element is directly proportional to its input, the output of an I-element is proportional to the integral of the input.</p><p>The input is constantly added to the output, e.g. you can imagine an empty glass that you start filling with water. The water level inside the glass is increasing constantly, it is the integral of the volume flow of the water divided by the cross-sectional area of the glass. This is an example of an I-system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/0*QZvoKQyxZNPrOIUc.png" /><figcaption>Figure 2: block of an IT1-element¹</figcaption></figure><p>If the output of a system is proportional to the derivative of the input, it is a D-system. A D-element block is shown in Fig. 3. If we have a constant input, then our output is zero.</p><p>A common example of a D-element in electronics is the induced voltage which is proportional to the derivative of the magnetic flux. However, if neither the magnetic flux density nor the cross-sectional area of our system is changing we won’t measure any induced voltage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/0*ZhK08gXOXlzLdpsX.png" /><figcaption>Figure 3: block of a D-element¹</figcaption></figure><p>Fig. 4 sums up the mathematical formulations of our three basic elements:</p><ol><li>P-element</li><li>I-element</li><li>D-element</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/0*XFp7NSn1z1rYP0Al.png" /><figcaption>Figure 4: basic equations (image by author)</figcaption></figure><h3>Variations of basic elements¹</h3><p>Real-world systems mostly incorporate a T-element in one of the basic elements to reflect a time delay . There are exceptions, but most systems will not respond to an input in an infinitely short amount of time. The delay is another parameter defining a system. Fig. 5 shows the block element of a PT1-system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*MsROB84uTxtdspPf.png" /><figcaption>Figure 5: block of a PT1-element¹</figcaption></figure><p>A common example of a PT1-system is a first-order RC low-pass filter which is used in electronics. In Fig. 6 you can see the mathematical formulations of each basic system. Equation (4) shows a PT1-system, (5) an IT1-system and (6) a DT1-system. These basic systems have one thing in common: <strong>All of them are ordinary first-order differential equations. </strong>In Systems Engineering we can express a system via an ODE. If you are interested in how this is done exactly, have a look at the Author’s note at the end of the story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/0*5_poZbJ0HLiv27lo.png" /><figcaption>Figure 6: basic first-order systems equations (image by author)</figcaption></figure><p>Last we take a look at one of the most common general formulations of a real-world system, the PT2-system shown in Fig. 7. In contrast to the PT1-system, this one can oscillate. The PT2-system is defined by its natural angular frequency and lehr’s damping measure. If D&gt;1 the system won’t oscillate, it is aperiodic. Also, the PT2-system is described through a second-order ODE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/0*W4UyHlU7k6d-OQ8p.png" /><figcaption>Figure 7: equation of a PT2 system (image by author)</figcaption></figure><h3>Summary</h3><p>This story introduced you to the basic concept of systems in the time domain. Basic elements like the P, I and D element were introduced and described mathematically. Also, some common variations of these basic elements like the PT1 and the PT2 system are covered in this story.</p><h3>Author’s note</h3><p>Thank you for reading this far! If you have any thoughts, annotations, or ideas about this story feel free to leave a comment. If you are interested in how to model systems in detail, have a look at my other stories and parts of engineering fundamentals.</p><p><a href="https://medium.com/cantors-paradise/a-beginners-guide-to-modeling-technical-systems-34b300697762">A Beginner’s Guide to Modeling Technical Systems</a></p><h3>References (S.200f.)</h3><ol><li>Lunze, J. (2016). <em>Regelungstechnik 1: Systemtheoretische Grundlagen, Analyse und Entwurf einschleifiger Regelungen</em> (11th edition). Berlin: Springer-Verlag Berlin Heidelberg. Retrieved on 7th of March 2021 from <a href="https://link.springer.com/book/10.1007/978-3-662-52678-1">https://link.springer.com/book/10.1007/978-3-662-52678-1</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f4b09023747" width="1" height="1" alt=""><hr><p><a href="https://medium.com/illumination/what-exactly-are-systems-2f4b09023747">What exactly are systems?</a> was originally published in <a href="https://medium.com/illumination">ILLUMINATION</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Engineers & Algorithms]]></title>
            <link>https://www.cantorsparadise.com/engineers-algorithms-e7759b269a7b?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7759b269a7b</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[matlab]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Wed, 03 Mar 2021 10:16:59 GMT</pubDate>
            <atom:updated>2021-03-05T10:32:05.607Z</atom:updated>
            <content:encoded><![CDATA[<h4>Top 3 must-know Algorithms as an Engineer in modern CAE</h4><p>In this part of the engineering fundamentals series, I’m going to cover why engineers need to know their basic algorithms and why this helps to improve CAE. Three different algorithms from three different fields of application are covered with mathematical descriptions, code, pictures and examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8EnVk3Yu0I2rQ_uigvyJA.png" /><figcaption>image created by author</figcaption></figure><ol><li>Why engineers should know their algorithms</li><li>Jacobi Method</li><li>Heun’s Method</li><li>Gradient Descent</li><li>Summary</li></ol><h3>Why engineers should know their algorithms</h3><p>Computer-Aided Engineering (CAE) is getting more and more important in modern engineering. FEM-programs, simulation tools and huge libraries are offered to the engineer who has to decide what suits his problem best he’s facing. But to make a good decision you have to know at least the basic principles of the algorithms used in the respective tool. Some of the following characteristics of a tool/algorithm might be useful to weigh up:</p><ul><li>accuracy</li><li>computational demand</li><li>flexibility</li></ul><p>In a lot of cases, the engineer has to know the <strong>tradeoffs</strong> of the algorithm. One of the most common tradeoffs is <strong>accuracy vs. computational demand</strong>. So to evaluate the tool/algorithm you need a deeper understanding of the things happening in the background of the CAE-program. I’m going to present three algorithms from three different fields of engineering.</p><ol><li>Jacobi Method -&gt; FEM</li><li>Heun’s Method -&gt; System Simulation</li><li>Gradient Descent -&gt; Optimization</li></ol><h3>Jacobi Method¹</h3><p>The Jacobi Method is used to solve systems of linear equations. Unlike the Gaussian Elimination Method, the Jacobi Method is iterative. Therefore the calculation itself performed on every iteration is rather simple. Another advantage is the fact that you can use <strong>parallel computing</strong> while implementing the algorithm.</p><p>Especially in <strong>FEM</strong> the Jacobi Method (or related algorithms) come into place to solve huge matrices. Figure 1 shows how the iterative representation of the Jacobi Method is derived based on the simple formulation of a system of linear equations (1).</p><p>What’s special about the Jacobi Method is the fact that matrix A is split into 3 matrices, which is called <strong>Splitting</strong> in mathematics (sometimes I can’t believe the overwhelming creativity of mathematicians). Matrix A is split into a Lower, an Upper and a Diagonal Matrix. The advantage gets clear when looking at (6). The inverse of a Diagonal Matrix is quite simple to calculate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*bpX_ZnXWYhDHiblp.png" /><figcaption>Figure 1: Jacobi Method iterative representation matrix (image created by author)</figcaption></figure><p>Figure 2 shows the same as (6) but this time representing it for a single element of our solution vector x.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/0*OQz5uIwlZoXf4UwK.png" /><figcaption>Figure 2: Jacobi Method iterative representation element (image created by author)</figcaption></figure><p>Figure 3 shows the Jacobi Method in action. I had to perform a FEM Analysis on this bridge construction in my FEM Lab last semester. <strong>Splitting Methods</strong> like the Jacobi, Gauß Seidel or Successive Over-Relaxation Method make this possible. But different methods can lead to different results. So you have to understand each method to optimize accuracy / computational demand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yPJEPqUqIUCkq_6a.jpeg" /><figcaption>Figure 3: FEM Analysis of a bridge construction (image created by author)</figcaption></figure><h3>Heun’s Method</h3><p>Heun’s Method is used for numerical integration. Therefore it can be used to solve <strong>Ordinary Differential Equations (ODEs)</strong> which is a common practice in simulation tools like MATLAB Simulink. Whenever you model a System and express it via an ODE you can either solve it analytically or use numerical integration. Heun’s Method uses both, explicit and implicit, <strong>Euler Methods</strong>. Through a <strong>Predictor-Corrector Principle</strong> Heun’s Method is an explicit method. I won’t go much into detail here because I already wrote a story explaining the mathematics behind Euler Methods and Heun’s Method in more detail. I will link all my stories with regards to this in the Author’s note.</p><p>The given MATLAB Code below can be used to implement Heun’s Method for first-order linear ODEs. To use it, you have to define the derivative of the ODE and have to pass it to the algorithm (in this case the handle “yDot” which can be defined using @ in MATLAB). The output is the resulting answer of the system given by two vectors T and Y. The main part of the algorithm is just line 9 and 10. The relevant parameter is tStep defining the size of the increment in each iteration.</p><pre>function [T, Y] = heun(yDot, tStep, tBeg, tEnd, y0)</pre><pre>    Y(1) = y0;<br>    c = 1;<br>    <br>    for i = tBeg : tStep : tEnd<br>        <br>        T(c) = i;<br>        Ypred = Y(c) + tStep*yDot(Y(c));<br>        Y(c+1) = Y(c) + 0.5*tStep*(yDot(Y(c))+yDot(Ypred));<br>        c = c + 1;<br>        <br>    end<br>    <br>end</pre><p>Figure 4 shows a solution to a more <strong>complex ODE higher order</strong>. This was created for a simulation project in university where we modeled and simulated an active suspension of a quarter-vehicle to optimize the dynamics of a Formula Student Race Car.</p><p>The System is stimulated via a Fourier Series that emulates the ground. The upper coordinate system compares the controlled and uncontrolled case. When the controller is on, the suspension is active and the hydraulic actuator works in series with the spring-damper-unit. When the controller is off, the actuator is completely stiff and acts as a rigid connector so the spring-damper-unit acts on its own.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*c1qmLBaMFx2OzNdW.png" /><figcaption>Figure 4: Dynamics simulation of an active suspension (image created by author)</figcaption></figure><p>The lower coordinate system compares Heun’s Method against the <strong>Runge Kutta Solver</strong> used in MATLAB Simulink as a standard (ode23 for you curious folks). However, Heun’s Method is a Runge Kutta Method. The solver used standardly by Simulink is just of a higher order. Runge Kutta Methods are a class of <strong>one-step procedures</strong> used for numerical integration. This should show you how different solvers can affect the result. It is always useful to do a quick study on how the solver affects the result to optimize accuracy / computational demand.</p><h3>Gradient Descent²</h3><p>Gradient Descent is an optimization algorithm for <strong>general optimization </strong>problems. You want to find the global minimum of a function with the input W. The input is a set of parameters that needs to be optimized to reach that minimum. This algorithm is commonly used in <strong>supervised Machine Learning </strong>especially in <strong>Neural Networks</strong>. The Loss L or Cost J respectively is just the difference between the prediction of the NN and the corresponding label in this case.</p><p>Figure 5 shows the update-rules for GD without (8) and with (9) a <strong>momentum term</strong>. The idea is to approach the minimum by <strong>subtracting the gradient</strong> of L(W) from W. Alpha is just a scaling factor defining how big the step is. If we approach the global minimum more and more it is obvious that the gradient approaches 0 and therefore the update of our new set of Parameter W_n+1 will be very small. At the global minimum, there will be no change at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/0*4lMZsxe_4_lIFWVk.png" /><figcaption>Figure 5: Update rule of Gradient Descent without and with Momentum (image created by author)</figcaption></figure><p>Figure 6 visualizes the idea of GD. When reaching the global minimum the gradient is 0 and no further change of W is the consequence. It’s that simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ut6_Du46x5LVsKXB.png" /><figcaption>Figure 6: Gradient Descent Idea (source: <a href="http://rasbt.github.io/mlxtend/user_guide/general_concepts/gradient-optimization/">http://rasbt.github.io/mlxtend/user_guide/general_concepts/gradient-optimization/</a>)</figcaption></figure><p>However, what if we have a function with lots of <strong>local minima</strong>? Then we can add the momentum term mentioned earlier. To avoid sticking in local minima, when the subtrahend is close to 0, an additional term is added to increase the change of W. This additional term called momentum is just the difference between the current set of parameters and the one before that. And again, Gamma is just for scaling purposes. To optimize convergence and accuracy it is important to <strong>understand the impacts of Alpha and Gamma</strong>. Also, GD is just one out of many different gradient-based optimization algorithms. Again, to optimize accuracy / computational demand a basic understanding of the algorithm is necessary.</p><h3>Summary</h3><p>In this part of engineering fundamentals I covered three different algorithms from three different fields of engineering:</p><ol><li>Jacobi Method -&gt; FEM</li><li>Heun’s Method -&gt; System Simulation</li><li>Gradient Descent -&gt; Optimization</li></ol><p>The given examples should demonstrate why it is important to have a basic understanding of certain algorithms as an engineer and how this can affect your work. I hope I could motivate you to dive deeper into a topic even if it looks complicated at first sight.</p><h3>Author’s note</h3><p>Thank you for reading this far! If you have any thoughts, annotations, or ideas about this story feel free to leave a comment. If you are interested in the mathematical background of Heun’s Method or how to model systems like the active suspension have a look at my other stories and parts of engineering fundamentals.</p><ul><li><a href="https://medium.com/cantors-paradise/a-beginners-guide-to-modeling-technical-systems-34b300697762">A Beginner’s Guide to Modeling Technical Systems</a></li><li><a href="https://medium.com/cantors-paradise/numerical-solvers-for-odes-f8ca571e4052">Numerical Solvers for ODEs</a></li></ul><h3>References</h3><ol><li>Stürzekarn, M. (2005). <em>Proseminar Numerik: Jacobi- und Hauß-Seidel-Verfahren, Jacobi-Relaxationsverfahren</em>. (Summer Semester 2005). Hamburg: University of Hamburg</li><li>MATLAB-Documentation. (2021). <em>Options for training deep learning neural network</em>. [Online]. retrieved on 22th of February 2021 from <a href="https://www.mathworks.com/help/deeplearning/ref/trainingoptions.html">https://www.mathworks.com/help/deeplearning/ref/trainingoptions.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7759b269a7b" width="1" height="1" alt=""><hr><p><a href="https://www.cantorsparadise.com/engineers-algorithms-e7759b269a7b">Engineers &amp; Algorithms</a> was originally published in <a href="https://www.cantorsparadise.com/">Cantor’s Paradise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Modeling Technical Systems]]></title>
            <link>https://www.cantorsparadise.com/a-beginners-guide-to-modeling-technical-systems-34b300697762?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/34b300697762</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[systems-engineering]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[modeling]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Thu, 11 Feb 2021 21:23:01 GMT</pubDate>
            <atom:updated>2021-02-19T06:43:02.810Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to describe everything with mathematics</h4><p>This story will give you an introduction to how to model technical systems. It covers why modeling is so important for engineers, some basic techniques, and an example of a technical system describes via an ODE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcCgYnHF_yNNVB88MHF5ew.png" /><figcaption>image created by author <a href="https://medium.com/u/2ce835b80044">Elias Niepötter</a></figcaption></figure><ol><li>Why modeling is so important as an engineer</li><li>Basic techniques &amp; math</li><li>A common example</li><li>Summary</li></ol><p>This story starts a series called <strong>engineering fundamentals </strong>where I’m going to cover different topics from the world of engineering.</p><h3>Why modeling is so important as an engineer</h3><p>Just to make this clear right away: Not every engineer is modeling technical systems at his job, by far. However, in my opinion, it is a more and more important skill to master. Due to the rise of cheap computational power, Computer-Aided Engineering (CAE) replaces or supports different parts in classical product development. And in the end, it mostly breaks down to the point where you need to build a model depicting the reality with adequate accuracy.</p><blockquote><em>Essentially, all models are wrong, but some are useful (George Box)</em></blockquote><p>Modeling consists basically of two aspects. On the one hand, we have the mathematical/technical part where we translate a technical system or concept into something we can solve, with the help of computational resources or by hand. On the other hand, we have a more challenging aspect of modeling. The engineer has to decide how detailed his model has to be to approximate the reality adequately. All the techniques and methods available to analyze and model systems are useless if you focus on the wrong model. Geroge Box really nailed it. No model has ever predicted something 100% exactly, there are too many unknown variables in reality.</p><p>Just to mention a few important fields of engineering with regards to modeling (technical) systems:</p><ul><li>stress analysis and Finite Element Analysis (FEA)</li><li>Computational Fluid Dynamics (CFD)</li><li>Multibody Dynamics</li><li>Controller Design</li><li>Climate Prediction</li><li>Economics</li></ul><h4><strong>Basic techniques &amp; math¹</strong></h4><p>The goal of the modeling process is to create a mathematical formulation which describes our system. The formulation can then be used e.g. to describe how our system reacts to a unit step input over time.</p><p>To build a model of a technical system, you use basic <strong>linear and non-linear equations of laws of physics</strong> and combine them. Figure 1 shows a few examples of commonly used equations to describe a technical system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*9UPY_X_7Wcau1qeYXXis7Q.png" /><figcaption>Figure 1: Common linear and non-linear equations of laws of physics (image by author)</figcaption></figure><p>However, the core of a technical system and therefore the model are the equations that describe the <strong>energy inside the system</strong>. E.g. in classical mechanics, this is the kinetic energy of the system, in electronics this could be a capacitor, and in thermodynamics simply an equation describing the heat of a system. Figure 2 shows the most common equations used to model the energy of a system. These equations e.g. are used to set up the block diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*H5VJGNkLWkvVKdpketcCxA.png" /><figcaption>Figure 2: Equations used to model the energy of a system (image by author)</figcaption></figure><p>If we now have analyzed our system and have written down all of our equations needed, we have two options to continue with modeling.</p><ol><li>Set up the Differential Equation</li><li>Set up the block diagram (and the transfer function)</li></ol><p>Both methods will lead to a proper solution. I will focus on the first method here. The second one is necessary to model and solve systems with simulation software like MATLAB/Simulink. The differential equation can still be solved numerically if the analytical approach is not looking promising (what is mostly the case…).</p><p>Furthermore, I think understanding the basic concept of modeling a system via a Differential Equation definitely helps to get a deeper understanding of systems. So let’s have a look at an example where everything is put together!</p><h4>A common example</h4><p>One of the most common examples in system theory is a mechanical PT2-System modeled via a mass connected to a spring and a damper. Figure 3 shows the technical sketch of the system. The input is an external force F and the output (that’s what we want to describe) is the displacement x.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*nJ8p_ec4r56xNRsC9nSQ6g.png" /><figcaption>Figure 3: Damped-Sprung-Mass (image by author)</figcaption></figure><p>In order to model the system we need an equation that describes:</p><ol><li>The equilibrium of forces</li><li>The damper</li><li>The spring</li></ol><p>The equilibrium of forces is our bases where we input all the equations necessary to describe the output x. Figure 4 shows how the ODE is set up. If we put in some values for our three parameters mass, damping rate, and spring rate we get a final ODE describing our system. If we normalize the ODE so that x has a factor of 1 we can calculate the natural frequency and Lehr’s damping measure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*z2lunLieOgfMk7ac9TBFxw.png" /><figcaption>Figure 4: Modeling the PT2-System (image by author)</figcaption></figure><p>Because 0 &lt; D &lt; 1 the system oscillates which can be seen in Figure 5. The Figure shows the System’s answer to a step input with 300 N. The stationary output of the system can be calculated by setting all derivatives to 0 and solve for x (just 0.001*300 in this case). The analytical solution of the ODE necessary to plot Figure 5 is not covered in this story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WvTiy_5DqHi6NrpbtN_5A.png" /><figcaption>Figure 5: System’s answer to a step input (image by author)</figcaption></figure><h4>Summary</h4><p>Modeling technical systems is an important skill for engineers that is used in many different fields of application e.g. in FEA or Multibody Dynamics. Modeling a system consists basically of two aspects, the mathematical description of the system and the estimation of the degree of detail necessary to approximate the system properly. The mathematical aspect can be done in two different ways:</p><ol><li>Setting up a block diagram</li><li>Setting up an ODE</li></ol><p>Both methods lead to the same solution. The first method is commonly used to simulate dynamic systems with software like MATLAB/Simulink.</p><h4>Author’s Notes</h4><p>Thank you for reading this far! If you have any thoughts, annotations, or ideas about this story feel free to leave a comment. If you are interested in how to solve ODE’s numerically have a look at one of my other stories.</p><p><a href="https://medium.com/cantors-paradise/numerical-solvers-for-odes-f8ca571e4052">Numerical Solvers for ODEs</a></p><p><strong>References</strong></p><ol><li>Nollau, R. (2009). <em>Modellierung und Simulation technischer Systeme: Eine praxisnahe Einführung</em>. Heidelberg: Springer-Verlag Berlin Heidelberg. Retrieved on 17th of January from DOI 10.1007/978–3–540–89121–5</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34b300697762" width="1" height="1" alt=""><hr><p><a href="https://www.cantorsparadise.com/a-beginners-guide-to-modeling-technical-systems-34b300697762">A Beginner’s Guide to Modeling Technical Systems</a> was originally published in <a href="https://www.cantorsparadise.com/">Cantor’s Paradise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Particle Swarm Optimization]]></title>
            <link>https://www.cantorsparadise.com/particle-swarm-optimization-5b03feb724df?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b03feb724df</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[metaheuristics]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[philosophy]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Sat, 16 Jan 2021 18:48:21 GMT</pubDate>
            <atom:updated>2021-01-16T18:48:21.507Z</atom:updated>
            <content:encoded><![CDATA[<p>Math &amp; Nature | An introduction to Metaheuristics</p><p>This story will cover the fundamentals of Metaheuristics and will give you an introduction to the basic concept of the Particle Swarm Optimization (PSO) algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fs_R25Hyd298-3CW" /><figcaption>Photo by <a href="https://unsplash.com/@7bbbailey?utm_source=medium&amp;utm_medium=referral">Barth Bailey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li>What are Metaheuristics?</li><li>Particle Swarm Optimization</li><li>What is this useful for?</li><li>Summary</li></ol><h4>What are Metaheuristics?¹</h4><blockquote>A metaheuristic is a high-level abstraction of established sets of mathematical rules with some randomness that leads a search process to find (near)-optimal solutions to a problem.¹</blockquote><p>Metaheuristics are used to solve optimization problems as an alternative to exact methods like Newton’s Method or Gradient Descent. Their advantage over such exact methods is their low computational costs. The search process of metaheuristic algorithms, like PSO, are based on two main principles.</p><ul><li>Exploration (or Diversification)</li><li>Exploitation (or Intensification)</li></ul><p>Through Exploration the algorithms wants to make sure the whole search space is covered. The algorithm is “exploring” the search space and therefore increasing the chances to find the optimal solution. In contrast to that is Exploitation which describes the process of using already known information and directing the search to promising solutions. The metaheuristic algorithm convergences towards a minimum but it’s not guaranteed to be the overall optimum. One challenge in applying algorithms like PSO is to avoid Exploitation towards local minima. However, over extensive Exploration is not the solution for that challenge because now convergence speed drops. It is always a tradeoff between Exploration and Exploitation.</p><p>Another key element of Metaheuristics are their Hyperparameters. Different Metaheuristics have different Hyperparameters. Because of the impact on convergence speed and accuracy of the solution it’s mostly useful (or necessary) to perform a study on the Hyperparameters of your algorithm. if you are interested in a specific Hyperparameter Tuning method have a look at one of my other stories, covering Deep Random Search.</p><p><a href="https://medium.com/ai-in-plain-english/deep-random-search-74c74b7fbeda">Deep Random Search</a></p><h4>Particle Swarm Optimization²</h4><p>Let’s start with the obvious analogy. PSO works similar to a swarm of birds searching for a food source. Every bird has its own memory and can remember the best solution he has found so far. This is also called the <strong>cognitive component</strong> of the update rule. But the birds can communicate with each other and they can exchange their best found solution. This is the <strong>social component</strong> of the update rule.</p><p>You can now define a weight or a degree of trust for each component. Either you want your particles more isolated from each other and increase the impact of the cognitive component or you want the opposite and therefore increase the impact of the social component. In addition to the weights for each component there is another Hyperparameter. In each iteration of PSO a random scaling factor (between 0 and 2 e.g.) is multiplied with each component. Most Metaheuristics have this probabilistic aspect.</p><p>Figure 1 shows the position update rule of the algorithm. In an analogy to classical mechanics, the next position depends on the current position and the velocity (and a timestep, but you can set this to 1 at the beginning, it’s just another scaling factor). The position is a solution vector for your optimization problem (arguments of the function you want to optimize).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*btejrXs6uZXH5r_1tUpB5g.png" /><figcaption>Figure 1: PSO position update rule</figcaption></figure><p>Figure 2 shows the velocity update rule of the algorithm. The weight <em>c</em> and the random scaling factor <em>r </em>need to be defined for both cognitive and social component. The cognitive component is calculated via the difference of the current position and the individual best known solution of the particle <em>XP</em>. The social component is calculated via the difference of the current position and the global or swarms best known position <em>XG</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*Yxl15bgWjREC3_rD--B7TA.png" /><figcaption>Figure 2: PSO velocity update rule</figcaption></figure><p>There is a third component in the velocity update rule called inertia. Again, as an analogy to classical mechanics, this component affects wether a particle can change its velocity quickly or rather slowly.</p><p>And that’s basically it. You need the position and velocity update rule, define your Hyperparameters and are ready to go!</p><h4>What is this useful for?</h4><p>Metaheuristic optimization can be used in many different fields of application, e.g. mathematics (optimization problems) or engineering (controller tuning). One advantage over gradient based optimization algorithms is the fact that the function of interest has no need to be differentiable at any point in the search space. You also save the computational costs of calculating the gradients. In general, Metaheuristics are considered faster than classical approaches but again, there is no guarantee they find the global optimum.</p><p>Let’s go with an example and analyze a typical benchmark function, the sphere function. I won’t go much into detail here but to compare different algorithms there are many so called benchmark functions which are used to test an optimization algorithm and measure its performance. The sphere function has a global minimum of 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/191/1*urLP9KM3mxsTUKgaGqLneA.png" /><figcaption>Figure 3: mathematical description of the sphere function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*wDroZaiEyGiIav33z8Q6mQ.png" /><figcaption>Figure 4: sphere function (Source: <a href="http://benchmarkfcns.xyz/benchmarkfcns/spherefcn.html">http://benchmarkfcns.xyz/benchmarkfcns/spherefcn.html</a>)</figcaption></figure><p>I defined a PSO algorithm with 50 particles. The sphere function has 10 dimensions in this example. After 5000 iterations (about 5 seconds in this case) the algorithm stopped and the best solution found was 1e-150. Figure 5 shows the result of the search for the first 50 iterations and two selected dimensions. It clearly shows how the particles are exploring the search space and later converging towards 0 (Exploration vs. Exploitation).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*DdK373BR1hyfdFXO5yLq3g.png" /><figcaption>Figure 5: PSO on the sphere function</figcaption></figure><h4>Summary</h4><p>Particle Swarm Optimization is a metaheuristic optimization method. It uses the concept of exploration and exploitation. These class of algorithms can be faster than classical approaches like Newton’s method or Gradient Descent. But you have to be aware that Metaheuristics might not find the global optimum and get stuck in a local minimum.</p><p>The way how PSO works is similar to a swarm of birds searching for a food source. Each bird memorizes his own so far best spotted source. All birds can communicate within the swarm and can share their most promising spots with each other. There is a tradeoff between the impact of the social and cognitive component, always depending on your problem.</p><p>PSO has many Hyperparameters which need to be fitted to your problem. One tuning method e.g. could be a Deep Random Search.</p><p>Thank you for reading this far! If you have any thoughts, annotations or ideas about this story feel free to leave a comment. Also, if you want me to write a story about a specific topic regarding this story (or any other topic) just send me a message or leave a comment.</p><p><strong>References</strong></p><ol><li>Blondin, M. J. (2020). <em>Controller Tuning Optimization Methods for Multi-Constraints and Nonlinear Systems: A Metaheuristic Approach.</em> Switzerland: Springer Switzerland. Retrieved on 15th January 2021 from <a href="https://link.springer.com/book/10.1007%2F978-3-030-64541-0">https://link.springer.com/book/10.1007%2F978-3-030-64541-0</a></li><li>Venter, G. &amp; Sobieski, J. (2002). <em>Particle Swarm Optimization</em>. 43rd AIAA: Structures, Structural Dynamics, and Materials Conference, Denver, Colorado</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b03feb724df" width="1" height="1" alt=""><hr><p><a href="https://www.cantorsparadise.com/particle-swarm-optimization-5b03feb724df">Particle Swarm Optimization</a> was originally published in <a href="https://www.cantorsparadise.com/">Cantor’s Paradise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Random Search]]></title>
            <link>https://ai.plainenglish.io/deep-random-search-74c74b7fbeda?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/74c74b7fbeda</guid>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[random-search]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Fri, 25 Dec 2020 17:11:49 GMT</pubDate>
            <atom:updated>2021-01-03T20:59:59.343Z</atom:updated>
            <content:encoded><![CDATA[<h4>A greedy alternative for your Hyperparameter Tuning</h4><p>This story will show you an alternative Random Search algorithm that might be useful for your Hyperparameter Tuning. I will cover the main concept behind it and give a detailed example of the algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uFUhGLnSFAPQF-Lg" /><figcaption>Photo by <a href="https://unsplash.com/@jeremythomasphoto?utm_source=medium&amp;utm_medium=referral">Jeremy Thomas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li>What is a greedy algorithm?</li><li>The concept of Deep Random Search</li><li>Discussion</li></ol><h4>What is a greedy algorithm?</h4><p>In informatics, an algorithm is used to solve problems systematically. There are many concepts on how to design an algorithm. A greedy concept is one of the most basic ones. A solution is defined stepwise and the greedy algorithm makes his decision (to solve the problem at a certain step) based on the current best available solution. Let’s go with an example and take a look at Figure 1. You can see a tree with weighted edges. The goal is to minimize the overall costs to get from node A to node F.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*pn6iHEUVZRsiBTrBJvwxKg.png" /><figcaption>Figure 1: Example tree (Image by author)</figcaption></figure><p>The correct answer is A-C-E-F. However a greedy algorithm would choose A-B-D-F. Either choose node B or choose node C at the beginning and a greedy algorithm would obviously choose node B over node C. I have to admit that this a rather unfavorable example for a greedy algorithm but it shows the weakness of such an algorithm. A greedy algorithm finds a solution but there is no guarantee it’s the overall best solution.</p><h4>The concept of Deep Random Search</h4><p>In Random Search you simply test a random combination of hyperparameters that lay in a specified range. The algorithm takes random guesses. In Deep Random Search (DRS) you do the same but after a specified amount of guesses you update the ranges of your hyperparameters. The following example demonstrates the algorithm.</p><p>Figure 2 shows a simple Random Search in two dimensions, A and B. The initial ranges in level 1 are [A0;A1] and [B0;B1]. After a specified amount of guesses the range of each dimension is cut in half and now you have four (only in 2D) quadrants. In n dimensions you would get 2 to the power of n quadrants when cutting each dimension in half. The best solution found so far is located in the first quadrant. This is the one we take to level 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*pvPrTGg1AE0xLrURrJh-bA.png" /><figcaption>Figure 2: DRS example Level 1 (Image by author)</figcaption></figure><p>In level 2 we first have to specify the new ranges (shown in Figure 3) and then do the same again. The guesses taken in level 2 are indicated in red (the blue ones belong to level 1). The new best solution is located in the second quadrant. And again, this is the quadrant we take to level 3, the last level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*5IcvJHLnUa8lHDzE1s4S6w.png" /><figcaption>Figure 3: DRS example Level 2 (Image by author)</figcaption></figure><p>As before, after specifying the new ranges a Random Search is performed (guesses taken in level 3 are indicated in green). Now we can identify the best solution again which represents the solution of our Deep Random Search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*P_K7d74_Pd1NfMitXSBlZg.png" /><figcaption>Figure 4: DRS example Level 3 (Image by author)</figcaption></figure><h4>Discussion</h4><p>A Deep Random Search is greedy multilevel Random Search. In each Level a Random Search is performed and the ranges of the dimensions are updated towards the best known solution. The update of the ranges is the greedy part of DRS. The best solution could be located in a different quadrant then the best known solution and now DRS can’t find the overall best solution anymore. This is the weakness of DRS.</p><p>However DRS can help to find new good solutions and new ranges for your hyperparameters for further investigations and analyzes. Also you can try different methods for updating the ranges. For example you can very the amount of cuts you perform in each level (one for each dimension in this example). Or you define a new method for determining the quadrant that is taken to the next level. In this example we took the quadrant which includes the best known solution. As an alternative you could define a performance index for each quadrant that is influenced by every guess in a quadrant. The amount of guesses you take each level and the amount of levels are general parameters of DRS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74c74b7fbeda" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/deep-random-search-74c74b7fbeda">Deep Random Search</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Numerical Solvers for ODEs]]></title>
            <link>https://www.cantorsparadise.com/numerical-solvers-for-odes-f8ca571e4052?source=rss-2ce835b80044------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8ca571e4052</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[differential-equations]]></category>
            <category><![CDATA[numerical-analysis]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Elias Niepötter]]></dc:creator>
            <pubDate>Thu, 17 Dec 2020 18:56:24 GMT</pubDate>
            <atom:updated>2021-01-04T17:16:25.236Z</atom:updated>
            <content:encoded><![CDATA[<h4>An introduction to Euler methods</h4><p>This story will give you a brief introduction to the basics of numerical integration and how it is used to solve Ordinary Differential Equations. I will cover the explicit Euler and implicit Euler method as well as Heun’s method in this story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuHdvLtVIfl6ftVONhoKcg.jpeg" /></figure><ol><li>How to solve ODEs numerically</li><li>Explicit Euler</li><li>Implicit Euler</li><li>The combination of both Euler methods (aka Heun’s method)</li></ol><h4>How to solve ODEs numerically</h4><p>Ordinary Differential Equations are not only a special set of equations in mathematics. From the perspective of an ongoing engineer, ODEs can be used to describe dynamic systems in our real world. So let’s go with an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*IIO6ZSErvwVJfYbI8Vfmcg.png" /><figcaption>Equation 1: ODE of a PT1-System</figcaption></figure><p>Equation 1 shows an ODE of a PT1-System. This could be e.g. a simple RC-low-pass filter. The analytical solution is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*FiMS8g8MYjz6rhcLIA5kNw.png" /><figcaption>Equation 2: Analytical Solution of the example</figcaption></figure><p>In this case it it quite easy to solve the ODE analytically, but if things get more complicated and an analytical solution is not the way to go, we can solve ODEs numerically. To be more precise: We can <strong>approximate</strong> the solution.</p><p>I won’t go deep into the details here, but the idea is to calculate the gradient at a given point and then approximate a solution (y) at the next point by using this gradient and defined increment. As we decrease the increment we increase the accuracy of our approximation but it takes more computational power to solve the ODE. To calculate the gradient we just have to rearrange Equation 1 and get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*ZvdnTI9_2htyaVcJJuHZBg.png" /><figcaption>Equation 3: How to calculate the gradient</figcaption></figure><p>Now we can calculate the gradient at any given time if we know the current value of y and the time (we assume that u is constant over time). In most cases we have given starting conditions where we know the gradient and the value of y. From this starting point on we have everything to approximate our solution.</p><h4>Explicit Euler</h4><p>The explicit Euler method is the most simple way to perform the approximation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*3jGD9kND66kkghfOwBxvpQ.png" /><figcaption>Equation 4: Explicit Euler</figcaption></figure><p>The approximation in the k+1-th increment (or step) is calculated by adding the product of the increment h and the gradient f to the current solution. As described before, the gradient is a function of the current value of y and the time. It is assumed that the gradient is constant over time. Figure 1 shows how this affects the solution. The explicit Euler “reacts” too slow and overshoots in this example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*9OVGMkzPYIhUDavMa5ozTg.png" /><figcaption>Figure 1: Different numerical solutions compared to the analytical solution of a ODE</figcaption></figure><h4>Implicit Euler</h4><p>The implicit Euler uses 2 explicit Eulers to approximate the solution. The first is called the “predictor” and second is called the “corrector”. The approximation of the predictor is used to approximate the solution again with an explicit Euler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*1O7sEGPbNshu32oirdkm-g.png" /><figcaption>Equation 5: explicit Euler (predictor)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*ADpA2cPt9iOBZUkU-vuirw.png" /><figcaption>Equation 6: implicit Euler (corrector)</figcaption></figure><p>The corrector-approximation tries to correct the predictor-approximation by calculating the gradient at the predicted point instead of the current one. This tends to create the opposite behavior as observed before (Figure 1).</p><h4>Modified explicit Euler method (aka Heun’s method)</h4><p>Heun’s method combines both explicit and implicit Euler methods by averaging them. Figure 1 clearly shows how the error of both Euler methods are cancelling out each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*-uA73WtQoq0fbU849BozSg.png" /><figcaption>Equation 7: explicit Heun</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8ca571e4052" width="1" height="1" alt=""><hr><p><a href="https://www.cantorsparadise.com/numerical-solvers-for-odes-f8ca571e4052">Numerical Solvers for ODEs</a> was originally published in <a href="https://www.cantorsparadise.com/">Cantor’s Paradise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>