VideoPhoto

Showing posts with label plotting. Show all posts
Showing posts with label plotting. Show all posts

30 July, 2023

Charts Based On Parametric Equations: Sinusoidal (Oscilloscope-type) Curves

Curves that can be used in physics for analysing pairs of simple harmonic motions are generally known as Lissajous Curves. They describe the superposition of two oscillations taking place at the right angle to each other,  at different frequencies. Their main application can be found in oscilloscopes. These instruments allow observation of two superimposed sine waves coming from varying signal voltages of sinusoidal nature. Depending on the frequency and amplitude of each wave, and the phase between them, we can see interesting patterns emerging.

Because the superimposed two perpendicular oscillations can be described with parametric equations for x and y in the Cartesian coordinate system, we can quite easily demonstrate the resulting shapes graphically using Excel charts. Let's look first at some of "oscilloscopic" patterns generated with Excel.

29 July, 2023

Shapes Based On Equations: Cardioids

Cardioid curve is formed by tracing a point selected on the circumference of a circle, rolling onto another circle of the same radius. Here are two examples of cardioid graphics, one is just a single cardioid curve and the other is presentation of 4 cardioids positioned within the same coordinates.

These kind of graphics can be generated using the VBA macro listed below the two charts.

28 July, 2023

Shapes Based On Parametric Equations: Epitrochoids

Epitrochoids are curves generated by a point selected on a circle of smaller radius rolling around the outside of a fixed circle of larger radius, and that selected point can be chosen at some distance from the center of the smaller circle. These are then 3-parametric curves. They can be helpful in creating decorative designs and other art applications, and can serve also as pastime and recreation for children. Since 1965 there is available a toy (geometric drawing device) known as spirograph, combining mathematics and art. It allows producing physically numerous curve designs based exactly on epitrochoid and hypotrochoid parametric equations.

However, nowadays the epitrochoids (as well as hypotrochoids - see another post at https://draft.blogger.com/blog/post/edit/3323809043368251287/9189797010242374274?hl=en-GB) can be generated quite easily in Excel by using VBA macro like the one provided at the end of this post.

Here are some examples of charts showing epitrochoid curves generated with the macro. Some of them present combined double curves.

27 July, 2023

Shapes Based On Parametric Equations: Hypotrochoids

Hypotrochoids are curves generated by a point selected on a circle of smaller radius rolling around the inside of a fixed circle of larger radius, and that selected point can be chosen at some distance from the center of the smaller circle. These are then 3-parametric curves.

You don't need any special programs, like e.g. Mathematica, to create hypotrochoids. They can be generated in Excel quite easily by using VBA macro like the one provided at the end of this post.

Here are some examples of charts with generated hypocycloid curves, both single and combined double curves:


Shapes Based On Parametric Equations: Hypocycloids

Hypocycloid is a parametric curve traced by a fixed point on a circle that rolls on the interior of another larger circle. 

The curve - due to its parametric functionality - finds many applications, both theoretical and practical. They include mechanical and construction engineering, e.g. design of gears, cams, valves, robotics (motion planning), and machine/structures design in general. Contribute also to aesthetically pleasing art designs and animations.

The hypocycloid curves can be generated quite easily in Excel with VBA macro,  presented at the end of this post. Here are some examples of charts with generated hypocycloid curves, both single and combined double curves:


25 July, 2023

Shapes Based On Parametric Equations: Epicycloids

Epicycloid is a parametric geometric curve obtained by tracing the path of a chosen point on the circumference of a circle (outside of it). Variety of epicycloid curves find applications in mechanical and construction engineering, e.g. construction of gears, cams, valves, pendulum clocks, robotic actuators, and machine/structures design in general. Contribute also to making designs of arts and animations.

In this context, it is useful to know how to generate epicycloid curves. In this post I'm presenting some of the curves along with the Excel VBA macro for creating this kind of curves. You can try to use it for your own creations. Just copy it to one of the modules in your workbook sheets and experiment with different settings and parameters.

Here are some examples of charts with epicycloid curves, single and double plots. 

11 May, 2021

World of Fractals - Beauty of Recursion

In my computer programming adventures I tried many things.  Among them I've explored  iteration and recursion.

Iteration is simpler, because it's basically just a For loop used in all common languages. It handles a number of steps consecutively.  You go up or down, step by step, until you reach the top or the bottom.

Recursion is much more convoluted.  It's a way of thinking and solving problems, because there is more then iteration to it.  Steps are also repeated here, but you reduce the problem to a smaller tasks and handle them separately;  sort of divide-and-conquer strategy involving inheritance.  You define the value of your function, which has more than one variable, by using other values of the same function, i.e. you change only one variable and keep all others constant, until some endpoint is reached, and then change something else, reach another endpoint, and so forth.

Recursive algorithms take many forms.  It's the beauty of math, really, which shows up in many of those algorithms.  One example of recursion is fractals.  The whole art of fractals evolved in recent years.  Have a look at its beauty e.g. at this website.

I've just touched the recursion issue many years ago.  Sometimes it took several hours of my computer time to produce a complex picture, but it was quite satisfying to see the algorithm at work.

Here are some examples of what I was able to create in early 1990s.

02 May, 2021

Creating graphs based on data table; the easy way

Whatever your Excel data source (entered or generated using a formula), convert the range of cells, they occupy, into Excel table. Simply select the range and use CTRL+T shortcut to do that. This way - when you later expand your data entries (add new data) or contract the table (remove some data) - your chart will get updated automatically (dynamically).

Here is kind of a template I've used to organize my data for charting:

 

I could fill the table with any function data, like in this example, or with raw data and get a graph based on just one function or two, or even three or four. Sometimes, when I've plotted e.g. two functions that have had different orders of magnitude, I used a secondary axis for one of them to display results in relevant scales.

To create your graph, select X column and appropriate Y column(s), then go to Insert tab and in Charts group select whatever chart type you need. That's it.

Now format your chart as you want to. Excel provides for that the whole plethora of options. Here I'm providing just two formatting examples to show you variety of possible solutions:



 

Enjoy Excel Charting!