<?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 Binayak Bhandari, PhD on Medium]]></title>
        <description><![CDATA[Stories by Binayak Bhandari, PhD on Medium]]></description>
        <link>https://medium.com/@thebinayak?source=rss-48a56d6b6982------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FLMsozHHAAhMtVZd8Pq08A.jpeg</url>
            <title>Stories by Binayak Bhandari, PhD on Medium</title>
            <link>https://medium.com/@thebinayak?source=rss-48a56d6b6982------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:04:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thebinayak/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[How Ready is Your Technology?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/how-ready-is-your-technology-12cd325c2b5e?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2600/1*AqkP1b0iDnkKDYUpikGPSQ.png" width="3573"></a></p><p class="medium-feed-snippet">If you work in the technical field, weather engineering, medical technologies, or applied sciences, you&#x2019;ve likely come across the term&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/how-ready-is-your-technology-12cd325c2b5e?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/how-ready-is-your-technology-12cd325c2b5e?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/12cd325c2b5e</guid>
            <category><![CDATA[innovation-management]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Mon, 08 Dec 2025 10:19:38 GMT</pubDate>
            <atom:updated>2026-07-27T00:24:09.958Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Fundamentals of Engineering Mechanics: Forces and Free Body Diagram]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/fundamentals-of-engineering-mechanics-forces-and-free-body-diagram-20a9f3af1f23?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/1711/1*fOiDFHZUoV9YMm3eYlGS3Q.png" width="1711"></a></p><p class="medium-feed-snippet">Engineers design, test, verify and manufacture machines and devices that shape our daily lives. These designs can range from something as&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/fundamentals-of-engineering-mechanics-forces-and-free-body-diagram-20a9f3af1f23?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/fundamentals-of-engineering-mechanics-forces-and-free-body-diagram-20a9f3af1f23?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/20a9f3af1f23</guid>
            <category><![CDATA[static]]></category>
            <category><![CDATA[mechanics]]></category>
            <category><![CDATA[mechanical-engineering]]></category>
            <category><![CDATA[engineering-mechanics]]></category>
            <category><![CDATA[free-body-diagram]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 19:23:02 GMT</pubDate>
            <atom:updated>2025-10-21T19:23:02.253Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Unsupervised Learning 101: A Deep Dive into k-means Clustering]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/unsupervised-learning-101-a-deep-dive-into-k-means-clustering-8e71f5f6983b?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2400/1*B9PT_AT1Z0qtCjaQnDPsEw.png" width="2400"></a></p><p class="medium-feed-snippet">In our previous articles, we explored supervised learning, where models learn from labelled data. This time, we take a step forward into&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/unsupervised-learning-101-a-deep-dive-into-k-means-clustering-8e71f5f6983b?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/unsupervised-learning-101-a-deep-dive-into-k-means-clustering-8e71f5f6983b?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e71f5f6983b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 08:30:26 GMT</pubDate>
            <atom:updated>2025-09-21T08:30:26.931Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Pen and Paper to Python: Solving Engineering Problems with SymPy]]></title>
            <link>https://medium.com/@thebinayak/from-pen-and-paper-to-python-solving-engineering-problems-with-sympy-6a87389fc5c3?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a87389fc5c3</guid>
            <category><![CDATA[sympy]]></category>
            <category><![CDATA[mathematics-education]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[calculus]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 12:08:59 GMT</pubDate>
            <atom:updated>2025-08-19T12:08:59.193Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll explore one of the most fundamental skills every engineer should master: solving mathematical formulations.</p><p>Gone are the days of sitting at a desk surrounded by stacks of textbooks, painstakingly searching for the right formulas to simplify expressions, compute derivatives and integrals, evaluate limits, solve equations, or work with matrices. Today, all of this can be done quickly and elegantly using SymPy, a Python library for symbolic mathematics.</p><p>In this article, we’ll walk through everything from installing SymPy to performing basic operations, printing and simplifying expressions, applying calculus, and working with matrices. We’ll also try out a few exercises along the way to reinforce these concepts.</p><h3>Introduction to SymPy</h3><p>SymPy is an open-source Python library designed for symbolic mathematics. The project was initiated by Ondřej Čertík in 2005, with significant development contributions in 2006. In early 2007, Fabian Pedregosa joined the project, fixing numerous issues, adding documentation, and giving the library a fresh push forward.</p><h3>What is Symbolic Computation?</h3><p>Symbolic computation refers to performing mathematical operations where expressions are kept in exact symbolic form rather than being converted to decimal approximations.</p><p>For example:</p><ul><li>Instead of sqrt(8) being computed as 2.8284…, it remains expressed as 2sqrt(2)</li><li>If the mathematical expressions cannot be simplified, it is left in symbolic form, e.g., sqrt(3) simply remains sqrt(3).</li></ul><p>This approach makes symbolic computation ideal for algebraic manipulation, equation solving, and mathematical derivation.</p><p>SymPy works especially well in Jupyter Notebooks, where its rendered outputs are displayed neatly and interactively. This setup is perfect for experimenting with formulas, visualising results, and iteratively building solutions. Once your initial exploration is done, moving your code to a production environment or other IDEs becomes straightforward.</p><p>Symbolic computation systems are also called Computer Algebra Systems (CAS), such as SymPy, that are capable of computing symbolic expressions with variables. There are many CAS available.</p><h3>List of computer algebra systems</h3><p>The following table summarises some well-known computer algebra systems, their origins, and costs. For the complete list, please refer to Reference 5 in the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AMbIaSdgKVks69rygRZKrw.png" /></figure><h3>Installation</h3><p>There are a variety of ways to install SymPy in your system:</p><p><strong>a. Using PyPI</strong></p><pre>$ pip install sympy</pre><p><strong>b. Using Anaconda</strong></p><pre>$ conda install -c anaconda sympy</pre><p><strong>c. From GitHub source (two steps)</strong></p><p>First, clone SymPy using git</p><pre>$ git clone https://github.com/sympy/sympy.git #Clone the repo</pre><p>Second, from the sympy directory, run the command</p><pre>cd sympy<br>$ pip install . # Install from the cloned directory</pre><h3>Defining Symbols in SymPy</h3><p>In SymPy, variables must be explicitly defined before use. This is done using the<strong> symbols()</strong> function.</p><pre>from sympy import symbols<br>x, y, = symbols(&#39;x y&#39;)<br>expr = x + 2*y<br>expr</pre><pre>𝑥+2𝑦</pre><p>In the above example:</p><ul><li>We first imported the symbols function from the sympy library, so we can use it without writing sympy.symbols each time.</li><li>In the second line, we are using the symbols () function to define variables; in this case, we are defining two variables, x, y. Note that the variables are separated by space, not a comma or semicolon within the ‘ ’ or “ ”.</li><li>In the third line, we create an expression x+2*y with two variables (x) and (y), just like writing ordinary Python expressions. This expression won’t evaluate immediately; it remains symbolic, ready for further manipulation.</li></ul><p><strong>Basic Operations</strong></p><pre>expr + 1</pre><pre>𝑥+2𝑦+1</pre><p>In the above example, we added 1 to the expression, and that is reflected in the output. Let’s subtract x from the expression above and see what happens:</p><pre>expr - x</pre><pre>2𝑦</pre><p>We did not get 𝑥+2𝑦+x, instead just 2y. This is because x and -x cancelled one another.</p><p><strong>Expanding, Factoring, and Substituting Values</strong></p><p>SymPy can easily switch between expanded and factored forms, and it can evaluate expressions at specific variable values. SymPy has functions to go from one form to the other.</p><pre>from sympy import expand, factor<br><br>expr = (x + 1)**2<br>expanded = sp.expand(expr)<br>factored = sp.factor(expanded)<br>value = expr.subs(x, 2)<br><br>print(&quot;Expanded:&quot;, expanded)<br>print(&quot;Factored:&quot;, factored)<br>print(&quot;Value at x=2:&quot;, value)</pre><pre>Expanded: x**2 + 2*x + 1<br>Factored: (x + 1)**2<br>Value at x=2: 9</pre><p><strong>Why Variable Assignment Doesn’t Change the Expression</strong></p><p>Changing the Python variable (x) does not affect the SymPy Symbobl (x) used in an expression. Let’s see the following example:</p><pre>from sympy import *<br>x = symbols(&#39;x&#39;)<br>expr = x + 1<br>print(expr)</pre><pre>x + 1</pre><p>Now let’s assign the variable a value (2) and see if it has any effect on the expr.</p><pre>x = 2<br>print(expr)</pre><pre>x + 1</pre><p>Here, x = 2 changes the Python variable ‘x’ but not the original symbolic variable. To evaluate with the new value, use <strong>.subs()</strong> instead.</p><pre>from sympy import *<br>x = symbols(&#39;x&#39;)<br>expr = x + 1<br>print(expr.subs(x, 2))</pre><pre>3</pre><p>The original expression remains unchanged unless you explicitly substitute values or reassign the expression.</p><pre>print(expr)</pre><pre>x + 1</pre><h3>Equal Signs</h3><p>In Python, a single equal sign (=) means assignment, not equality. SymPy follows this convention and ‘=’ assigns a value to a variable</p><p>When you need to test equality in Python, you use double equals (==), which checks whether two expressions on the left and right are structurally identical. SymPy uses the same rule for structural (Boolean)equality. For example,</p><pre>x**2 + 1 == 4</pre><pre>False</pre><p>Here, SymPy compares the exact form of both sides x<strong>**</strong>2 <strong>+</strong> 1 is not identical to 4, so it returns False.</p><p><strong>Symbolic Equalities with Eq</strong></p><p>To create symbolic equalities (not a Boolean check), there is a separate Eq() function.</p><pre>from sympy import *<br>Eq(x+1, 4)</pre><pre>𝑥+1=4</pre><p><strong>Testing Mathematical Equality</strong></p><p>Sometimes two expressions may look different but are mathematically the same. The equals() method check numerical equivalence by testing random points.</p><pre>from sympy import symbols, cos, sin  <br>x = symbols(&#39;x&#39;)<br><br>a = cos(x)**2 - sin(x)**2<br>b = cos(2*x)<br>a.equals(b)</pre><pre>True</pre><p>Even though cos(x)**2 - sin(x)**2 looks different from cos(2*x), SymPy verifies that they are mathematically identical.</p><h3>Converting Strings to SymPy Expressions</h3><p>If you have a mathematical expression as a string, you can convert it into a SymPy object using <strong>sympy.sympify()</strong> (not: this is not <strong>simplify()</strong>)</p><pre>from sympy import sympify<br>str_expr = &quot;x**2 + 3*x - 1/2&quot;<br>expr = sympify(str_expr)<br>expr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*U4q0HUa5BcpmcUf1cnZd7Q.png" /></figure><p>We can now substitute values for variable ‘x’ into the expression and get output.</p><pre>expr.subs(x,2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/62/1*mgy6aiBr2FDqVRpQsKPQiQ.png" /></figure><p>Features of SymPy</p><p>The real power of SymPy lies in its ability to do all sorts of computations symbolically. With SymPy, we can:</p><ul><li>Simplify mathematical expressions</li><li>Compute derivatives, integrals, and limits</li><li>Solve equations and systems of equations</li><li>Work with matrices and linear algebra</li><li>Perform number theory, combinatorics, and statistics operations</li><li>Code generation</li><li>Handle symbolic physics, geometry, and logic problems</li></ul><p>It also supports pretty printing (including LaTeX), plotting, and advanced mathematical functions, such as trigonometric, hyperbolic, exponential, logarithmic, gamma and zeta functions.</p><p>In this article, we’ll walk through some examples that provide hands-on to some of the SymPy functionality.</p><p>(Please note these examples are adapted from SymPy Official Documentation)</p><h3>1. Printing</h3><p>SymPy has dedicated modules for output in different formats, such as Unicode pretty printing. LaTeX, MatML, and more.</p><p>Let’s see some printing styles</p><pre>from sympy import symbols, Integral, sqrt<br>from sympy import pprint, latex<br>from sympy.printing.mathml import print_mathml<br>from sympy import init_session<br>init_session(quiet=True)<br>x = symbols(&#39;x&#39;)<br>expr = Integral(sqrt(1/x),x)<br><br>#------Default Representation----------------<br>expr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/99/1*JnX4zI382EsCpYOGb0rwzg.png" /></figure><p><strong>Unicode Pretty Printer</strong></p><pre>pprint(expr, use_unicode=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/149/1*4EsNWI4M0auHKi1k5y5gcw.png" /></figure><p><strong>LaTeX Output</strong></p><pre>print(latex(expr))</pre><pre>\int \sqrt{\frac{1}{x}}\, dx</pre><p><strong>MathML Output</strong></p><pre>from sympy.printing.mathml import print_mathml<br>print_mathml(expr, x)</pre><pre>&lt;apply&gt;<br>   &lt;int/&gt;<br>   &lt;bvar&gt;<br>      &lt;ci&gt;x&lt;/ci&gt;<br>   &lt;/bvar&gt;<br>   &lt;apply&gt;<br>      &lt;root/&gt;<br>      &lt;apply&gt;<br>         &lt;power/&gt;<br>         &lt;ci&gt;x&lt;/ci&gt;<br>         &lt;cn&gt;-1&lt;/cn&gt;<br>      &lt;/apply&gt;<br>   &lt;/apply&gt;<br>&lt;/apply&gt;</pre><h3>1. Simplification</h3><p>SymPy can simplify mathematical expressions using a variety of functions. The most general function is simplify(), that attempts multiple strategies in an intelligent way to produce the simplest form of an expression. Let’s simplify</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkJY2BXNiV4rUavVByjR_g.png" /></figure><pre>from sympy import *<br><br>x, y, z = symbols(&#39;x y z&#39;)<br><br>#init_printing(use_unicode=True)<br>simplify(sin(x)**2 + cos(x)**2)</pre><pre>1</pre><pre>simplify((x**3 + x**2 - x - 1)/(x**2 + 2*x + 1))</pre><pre>𝑥−1</pre><pre>simplify(gamma(x)/gamma(x - 2))</pre><pre>(𝑥−2)(𝑥−1)</pre><p>Sometimes, we want to have a simplified expression in factor form, for example:</p><pre>simplify(x**2 + 2*x + 1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/1*uJvmgNbi9Pedk4NNh1hvTg.png" /></figure><p>It can be converted into the factor form as below:</p><pre>factor(simplify(x**2 + 2*x + 1))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/91/1*fMnG9UX6RN4s-oak_K35yw.png" /></figure><p>Other useful simplification methods in SymPy are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bitQG01dID9xAgUZMERs_g.png" /></figure><h3>Derivative</h3><p>SymPy diff() to compute derivatives of expressions.</p><pre>from sympy import *<br>x, y, z = symbols(&#39;x y z&#39;)<br>init_printing(use_unicode=True)<br><br>diff(cos(x), x)</pre><pre>−sin(𝑥)</pre><pre>diff(exp(x**2), x)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/68/1*yAbkwm2bCGCY-75FL-xeUg.png" /></figure><p>We can also computer higher-order derivatives by passing variable multiple times (two ways).</p><pre>diff(x**4, x, x, x) # Third derivative</pre><pre>24𝑥</pre><pre>diff(x**4, x, 3) #shorthand</pre><pre>24𝑥</pre><p>For expressions with multiple variables, pass them in order.</p><pre>y, z = symbols(&#39;y z&#39;)<br>expr = exp(x*y*z)<br> <br>diff(expr, x, y, y, z, z, z, z)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*zVab11To1KCjdaMS3vLmYw.png" /></figure><h3>Integration</h3><p>Use <strong>integrate()</strong> function to compute indefinite and definite integrals. To compute an indefinite integral, just pass the variable after the expression.</p><p><strong>Indefinite Integrals</strong></p><pre>from sympy import *<br>x, y, z = symbols(&#39;x y z&#39;)<br>init_printing(use_unicode=True)<br><br>expr = cos(x)<br><br>integrate(expr , x)</pre><pre>sin(𝑥)</pre><p><strong>Definite integrals</strong></p><p>Pass the argument (<strong>integration_variable, lower_limit, upper_limit</strong>). For example, to compute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/130/1*MWW56L1QOcKjcCYymAbS7Q.png" /></figure><pre>integrate(exp(-x), (x, 0, oo))</pre><pre>1</pre><p>Infinity in SymPy is oo (that’s the lowercase letter “oh” twice). This is because oo looks like infinity, and is easy to type.</p><p><strong>Multiple definite integrals</strong></p><p>Pass multiple limit tuples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*N62kJBalVgcndyRPyKHTZQ.png" /></figure><pre>integrate(exp(-x**2 - y**2), (x, -oo, oo), (y, -oo, oo))</pre><pre>𝜋</pre><p>Additionally, we can perform numerical integration as well to establish the definite integral of a function across a simplified range.</p><pre>from sympy import Integral, Symbol, sqrt<br>x = Symbol(&#39;x&#39;)<br><br>integral = Integral(sqrt(2)*x, (x, 0, 1))<br>integral</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/138/1*ucGkLXBwQS6Ju930LITijQ.png" /></figure><pre>integral.evalf()</pre><pre>0.707106781186548</pre><h3>Limits</h3><p>In SymPy, limit() function evaluates symbolic limits. For example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*d1a180w6pn_Grpp-D9K1Hw.png" /></figure><pre>from sympy import limit, sin<br><br>limit(sin(x), x, 0)</pre><pre>1</pre><p>To evaluate a one-sided limits, add a directional argument ‘+’ or ‘ -’ as a fourth argument to limit().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/208/1*4A5_PL8baTQ4AkscfyoukA.png" /></figure><pre>limit(1/x, x, 0, &#39;+&#39;)</pre><pre>∞</pre><h3>Solving Equations</h3><p>The main function for solving algebraic equations is solveset(). The syntax for solveset is:</p><p>solveset(equation, variable=None, domain=S.Complexes)</p><p>There is another function called solve() which can also be used to solve equations. The syntax for which is :</p><p>solve(equations, variables)</p><p>But the recommended function is solveset().</p><pre>from sympy import *<br>x, y, z = symbols(&#39;x y z&#39;)<br>init_printing(use_unicode=True)<br><br>solveset(x**2 - x, x)</pre><pre>{0,1}</pre><pre>solveset(sin(x) - 1, x, domain=S.Reals)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*bsnqX09pTFXgPqmt9mfqJA.png" /></figure><h3>Solving Differential Equations</h3><p>To solve the differential equation, we can use dsolve() function from the SymPy library. First, create an undefined function by passing cls=Function to the symbol function</p><pre>f, g = symbols(&#39;f g&#39;, cls=Function)</pre><p>f and g are now undefined functions. If we call f(x), it will represent and unknown function.</p><pre>f(x)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/1*rVhNf8kDvOGkeANGZOQSDw.png" /></figure><p>Derivatives of undefined functions f(x) are unevaluated.</p><pre>f(x).diff(x)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/98/1*pXLsmYFe4-J_78E9VOlaDg.png" /></figure><p>Let’s solve the differential equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*xGnKjtuputLTBHkAGbRQdg.png" /></figure><pre>diffeq = Eq(f(x).diff(x, x) - 2*f(x).diff(x) + f(x), sin(x))<br>dsolve(diffeq, f(x))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*cWEwS6hM_7r3mT92Ghlx3A.png" /></figure><h3>Matrices and Eigenvalues</h3><p>A matrix is constructed by providing a list of row vectors that make up the matrix using Matrix object.</p><pre>from sympy import *<br>init_printing(use_unicode=True)<br>Matrix([[1, -1], [3, 4], [0, 2]])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*HLV1r0Qt9_D4m7hl4Z36iQ.png" /></figure><p>Column vectors can be created as:</p><pre>Matrix([1, 2, 3])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/1*4j0iH9MRVUvq-0KXK-LLkw.png" /></figure><p>Matrix can be multiplied by another matrix.</p><pre>M = Matrix([[1, 2, 3], [3, 2, 1]])<br>N = Matrix([0, 1, 1])<br>M*N</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/52/1*B32CljLRt5QvuAIed_upyw.png" /></figure><p>There are a number of matrix (M) basic operation, for example ,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nT2a6-PsUoTCd-MPqJwaqw.png" /></figure><h3>Eigenvalues, Eigenvectors and Diagonalization</h3><p>To find the eigenvalues of a matrix, use eigenvals() function, which return a dictionary of eigenvalues: algebraic_multiplicity pairs.</p><pre>M = Matrix([[3, -2,  4, -2], [5,  3, -3, -2], [5, -2,  2, -2], [5, -2, -3,  3]])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*y4i-Tm2MJ3i0ziUsQa1a_g.png" /></figure><pre>M.eigenvals()</pre><pre>{−2:1, 3:1, 5:2}</pre><p>The above output means:</p><ul><li>Eigenvalue -2 (multiplicity 1)</li><li>Eigenvalue 3 (multiplicity 1)</li><li>Engenvalue 5 (multiplicity 2)</li></ul><p>To find the eigenvectors of a matrix, use eigenvects(), which returns a list of tuples of the form (eigenvalue, algebraic_multiplicity, [eigenvectors])</p><pre>M.eigenvects()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*dmxLTTrZtKtsKFPIClFhWw.png" /></figure><h3>Conclusion</h3><p>In this article, we explored some fundamental aspect of equations and equalities in SymPy, including the difference between, =, ==, and Eq, as well as how to use .equals() for numerical testing. We also looked at how to convert strings in SymPy expressions with sympify() and apply substitutions to evaluate them. With these tools, you ca begin to use SymPy more effectively for symbolic computation and algebraic manipulations.</p><p>Thank you for taking the time to read through this article. I hope it has been helpful in strengthening your understanding of SymPy. I’d love to hear your thoughs, suggestions, or any additional tips you might have, feel free to share them in the comments so we can all learn together!</p><h3>Reference</h3><p>1. SymPy, <a href="https://www.sympy.org/en/index.html">https://www.sympy.org/en/index.html</a></p><p>2. SymPy <a href="https://pypi.org/project/sympy/">https://pypi.org/project/sympy/</a></p><p>3. SymPy 1.14.0 documentation, <a href="https://docs.sympy.org/latest/index.html">https://docs.sympy.org/latest/index.html</a></p><p>4. <em>Meurer A, Smith CP, Paprocki M, Čertík O, Kirpichev SB, Rocklin M, Kumar A, Ivanov S, Moore JK, Singh S, Rathnayake T, Vig S, Granger BE, Muller RP, Bonazzi F, Gupta H, Vats S, Johansson F, Pedregosa F, Curry MJ, Terrel AR, Roučka Š, Saboo A, Fernando I, Kulal S, Cimrman R, Scopatz A. (2017) SymPy: symbolic computing in Python. PeerJ Computer Science 3:e103 </em><a href="https://doi.org/10.7717/peerj-cs.103"><em>https://doi.org/10.7717/peerj-cs.103</em></a></p><p>5. <em>List of computer algebra systems, </em><a href="https://en.wikipedia.org/wiki/List_of_computer_algebra_systems"><em>https://en.wikipedia.org/wiki/List_of_computer_algebra_systems</em></a></p><p>6. <a href="http://www.freepik.com/">http://www.freepik.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a87389fc5c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dimensionality Reduction and Principal Component Analysis]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/dimensionality-reduction-and-principal-component-analysis-d899e4837e4b?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/1943/1*JH-c4Y0YSgyr4wd9I8j48w.png" width="1943"></a></p><p class="medium-feed-snippet">When a dataset contains thousands or even millions of features, it is considered high-dimensional data. While more features may seem&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/dimensionality-reduction-and-principal-component-analysis-d899e4837e4b?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/dimensionality-reduction-and-principal-component-analysis-d899e4837e4b?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/d899e4837e4b</guid>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 11:46:55 GMT</pubDate>
            <atom:updated>2025-07-28T11:46:55.562Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Robot Modelling and Visualisation in ROS 2: A Practical Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/robot-modelling-and-visualisation-in-ros-2-a-practical-guide-fa666160011d?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/1056/1*tH7GvULieY942SL31VqDUw.png" width="1056"></a></p><p class="medium-feed-snippet">In this article, we continue our journey into the world of robotics by exploring how to model a robot in the ROS 2 environment, visualise&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/robot-modelling-and-visualisation-in-ros-2-a-practical-guide-fa666160011d?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/robot-modelling-and-visualisation-in-ros-2-a-practical-guide-fa666160011d?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa666160011d</guid>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Sun, 29 Jun 2025 07:33:59 GMT</pubDate>
            <atom:updated>2025-06-29T07:33:59.933Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Ensemble Learning: From Voting to Random Forest]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/ensemble-learning-from-voting-to-random-forest-a7a20444f176?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2324/1*3IT8Mfym54488-VZwQw9RA.png" width="2324"></a></p><p class="medium-feed-snippet">In this article, we will look at some fundamental concepts in machine learning, focusing on bias and variance, the two main sources of&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/ensemble-learning-from-voting-to-random-forest-a7a20444f176?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/ensemble-learning-from-voting-to-random-forest-a7a20444f176?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7a20444f176</guid>
            <category><![CDATA[ensemble-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[random-forest]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Sat, 14 Jun 2025 07:34:34 GMT</pubDate>
            <atom:updated>2025-06-14T07:34:34.417Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting Started with Robot Operating System 2 (ROS 2)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/getting-started-with-robot-operating-system-2-ros-2-ef56d2ac29f0?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2028/1*1U2SIjXNmidAmg7UH2H83g.png" width="2028"></a></p><p class="medium-feed-snippet">In this article, we&#x2019;ll explore the evolution of the Robot Operating System (ROS), understand the key differences between ROS and ROS2, and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/getting-started-with-robot-operating-system-2-ros-2-ef56d2ac29f0?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/getting-started-with-robot-operating-system-2-ros-2-ef56d2ac29f0?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef56d2ac29f0</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ros2]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 01:53:32 GMT</pubDate>
            <atom:updated>2025-06-02T01:53:32.808Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting Started with Decision Trees: Concepts, Visualisation, and Practical Implementation in…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/getting-started-with-decision-trees-concepts-visualisation-and-practical-implementation-in-47ccf1b92945?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2600/1*li8GEjzCvubvpQYumW0VeA.png" width="2818"></a></p><p class="medium-feed-snippet">In this article, we will get ourselves familiarize with one of the most intuitive and widely used algorithms in machine learning- Decision&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/getting-started-with-decision-trees-concepts-visualisation-and-practical-implementation-in-47ccf1b92945?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/getting-started-with-decision-trees-concepts-visualisation-and-practical-implementation-in-47ccf1b92945?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/47ccf1b92945</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[decision-tree]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Mon, 19 May 2025 04:23:18 GMT</pubDate>
            <atom:updated>2025-05-19T04:23:18.266Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Getting Started with Support Vector Machines: Theory and Hands-On Applications]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@thebinayak/getting-started-with-support-vector-machines-theory-and-hands-on-applications-09a7ae90cdeb?source=rss-48a56d6b6982------2"><img src="https://cdn-images-1.medium.com/max/2149/1*WlHKETG1pTu5SkSr4EQLgg.png" width="2149"></a></p><p class="medium-feed-snippet">Continuing our machine learning (ML) journey, in this edition, we&#x2019;ll look into Support Vector Machine (SVM). SVM is a powerful and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@thebinayak/getting-started-with-support-vector-machines-theory-and-hands-on-applications-09a7ae90cdeb?source=rss-48a56d6b6982------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@thebinayak/getting-started-with-support-vector-machines-theory-and-hands-on-applications-09a7ae90cdeb?source=rss-48a56d6b6982------2</link>
            <guid isPermaLink="false">https://medium.com/p/09a7ae90cdeb</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[support-vector-machine]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Binayak Bhandari, PhD]]></dc:creator>
            <pubDate>Mon, 28 Apr 2025 23:42:46 GMT</pubDate>
            <atom:updated>2025-04-28T23:42:46.810Z</atom:updated>
        </item>
    </channel>
</rss>