Solving 2D Heat Equation…

Before we do the Python code, let’s talk about the heat equation and finite-difference method. Heat equation is basically a partial differential equation, it is If we want to solve it in 2D (Cartesian), we can write the heat equation above like this: where u is the quantity that we want to know, t is…

Continua a leggere →

…a doublet.

Think about the Source & Sink again, and now imagine that you are looking at this flow pattern from very far away. The streamlines that are between the source and the sink will be very short, from this vantage point. And the other streamlines will start looking like two groups of circles, tangent at the…

Continua a leggere →

The combinatorial calculus…

The combinatorial calculus studies the groupings that can be obtained with a given number n of objects arranged on a given number k of places. The groupings can be formed without repetitions or with repetitions of the n objects. According to Wikipedia: Factorial of a positive integer n, denoted by n! is the product of…

Continua a leggere →

…in a Freestream

Starting from what is written here, we will try to modularize our code using function definitions. This will make things easier to manage. We start by importing the libraries that we will be using in our code: the NumPy array library, the Matplotlib plotting library and the mathematical functions in the math module. To visualize…

Continua a leggere →

Source & Sink

The definition of circulation: In words, the circulation is the line integral of velocity around a closed contour. In accord with Stockes’ teorem, this line integral is equal to the flux through the contour of the curl of velocity, which is the vorticity, ω=∇×v: If the vorticity is zero (irrotational flow), so is the circulation around any closed contour equal to…

Continua a leggere →

Equazioni differenziali ordinarie…

L’idea è di scrivere un codice per risolvere l’equazione differenziale dell’oscillatore armonico generica, implementando i metodi di : Eulero, Eulero-Cromer e Verlet. Gli schemi di integrazione sono: Eulero: Eulero-Cromer: Verlet: dove con indichiamo il passo temporale e con indichiamo l’accelerazione, o la forza diviso la massa, a cui è sottoposto il nostro sistema. Nel nostro…

Continua a leggere →

Calendar module in python

The calendar module in python enables us to print calendars on the terminal and other cool functions with the calendar. Import the calendar module to access all these functions. The prmonth() method helps us to print a month’s calendar. It requires the year and the month in the form of integers as arguments. Check leap…

Continua a leggere →

Using AnimatPlot for Animating Graphs & Plots

Data Visualization helps in understanding different patterns, associations, visual insights from the data, etc. It is important because it uncovers the mystery behind the data tables in form of charts, graphs, and plots. There are tons of python libraries that help in visualizing the data like Matplotlib, Seaborn, etc. AnimatPlot is an open-source python library…

Continua a leggere →

Insieme di Mandelbrot…

L’insieme di Mandelbrot o frattale di Mandelbrot è l’insieme dei numeri complessi per i quali la successione definita da: è limitata. Nonostante la semplicità della definizione, l’insieme ha una forma complessa il cui contorno è un frattale. Qui, la funzione per la costruzione della matrice da diagrammare: Di seguito, invece, la routine per verificare la…

Continua a leggere →