Using Julia to perform simple interpolation operations.

 What is Julia?

Julia is a high-level programming language, it is considered to be a general purpose programming language in which anyone can write applications using Julia, but its main features are specializes in the Mathematical and Scientific computing.

This makes Julia an attractive programming language to perform complex mathematical calculations and scientific analysis.

Julia has many of the mathematical computing modules built into the software bundle, making it very easy to get started on mathematical visualization coding.

The one in which we'll be focusing on today is the "Interpolations" modules.

Using Julia's Interpolation modules.

The included Julia Interpolation module has the 4 main interpolation algorithms.

1. Constant
2. Linear
3. Quadratic
4. Cubic

Which corresponds to B-Splines interpolation degrees of 0 to 3, respectively.

The accuracy of each B-Spline degree interpolation is represented in the following picture.

B-spline basis functions of degree zero to three. | Download Scientific  Diagram

We'll now demonstrate the use of simple linear and quadratic interpolation to approximate the data points, sampled from a portion of the sinusoidal waveform

Given the actual waveform of Sin(x)

And defining 5 sample points along the X-Axis. Starting from 0 to half of the sinusoidal wave, represented by the "Pi" constant.




We can observe that in order to use the appropriate algorithms, we can simply call the associated interpolation algorithms functions from the Interpolation libraries.

For example, a linear interpolation is achieved with a "LinearInterpolation" function

The general formatting of the Interpolation syntaxes are as follows.

var = "interpolation functions"("x data","y data", drawn function")

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

Introduction to Interpolation