Sunday, July 19, 2015

Interactive Cross Plots

Another simple user interface: SimpleLasXPlot!

This cross plotting application is an extension of the SimpleLasCurveViewer which adds a cross plot. The data being plotted is only the region highlighted. You can resize this region and slide the region up or down log interactive changing the data being plotted in the cross plot space. I hope this will help those having trouble visualizing cross plots. As usual, I have included a few screen caps below.


Code can be found at my github page.

Sunday, July 12, 2015

SimpleLasCurveViewer Updated

I have added crosshairs and another dock widget to the viewer that shows the value of the depth and the curve for which you are hovering over in the zoomed plot on the left. Take a look at the screen shot below.

The code can be found at my github page under simpleUIs/simpleLasCurveViewer.

Tuesday, July 7, 2015

Simple Sum 2 Cosines UI

Another user interface added to github very similar to SimpleCosineWaveUI, except there are now 2 cosine plots and a third plot that is the sum of the first two.

Below are some images.

Saturday, July 4, 2015

Problems & Solutions: Partial Differentiation 001

The first example is from: Widder, David V., "Advanced Calculus", Dover Books on Mathematics

Prerequisites: single-variable calculus, specifically u-substitution

Example 1:

Find $$\frac{\partial }{\partial x}\frac{sin(xy)}{cos(x+y)}$$

Solution:

We will need the quotient rule: $$\left ( \frac{f}{g} \right )' = \frac{f(x)g'(x) - f'(x)g(x)}{[g(x)]^{2}}$$

Setting $$f(x) = sin(xy)$$ and $$g(x) = cos(x+y)$$ we will need to find the derivatives of each.

Using the rule: $$\frac{\mathrm{d} }{\mathrm{d} x}sin(u(x)) = cos(u(x))\frac{\mathrm{d} u}{\mathrm{d} x}$$ $$f'(x) = cos(xy)\frac{\partial }{\partial x}(xy)$$ $$f'(x) = ycos(xy)$$

And conversely, setting $$g(x) = cos(x+y)$$

Using the rule: $$\frac{\mathrm{d} }{\mathrm{d} x}cos(u(x)) = -sin(u(x))\frac{\mathrm{d} u}{\mathrm{d} x}$$ $$g'(x) = -sin(x+y)\frac{\partial }{\partial x}(x+y)$$ $$g'(x) = -sin(x+y)(1+0)$$ $$g'(x) = -sin(x+y)$$

Putting the parts together: $$\frac{\partial }{\partial x}\frac{sin(xy)}{cos(x+y)} = \frac{sin(xy)(-sin(x+y))-(ycos(xy)cos(x+y))}{[cos(x+y)]^{2}}$$


This is usually sufficient for most professors. It is assumed that if you can get this far, you can simplify.

Problems & Solutions: About Page

Problems & Solutions is a series of posts about just that: problems and solutions in mathematics, physics, geophysics, and anything else I feel strongly needs writing about. My experience as an undergraduate was there were never enough examples to fully illustrate the concepts of [insert course name here]. My intention is to provide examples with clear explicit solutions and incorporate numerical methods with analytic solutions.

Simple Cosine Wave UI: illustrating frequency and phase

A new simple user interface has been added to github: SimpleCosineWaveUI! It's not terribly advanced, but it does illustrate two fundamental concepts in exploration geophysics: frequency and phase. The UI graphs a plot of: $$ f(t) = cos(2\pi ft+\phi ) $$ The two sliders at the bottom of the page allow the user to change the frequency and the phase of the signal and interactively view how those changes affect the plot. A "RESET" button is added that sets the phase and frequency of the signal back to zero. Finally, if you would like to see the waves with the area under of the curve filled in, click the check box "add fill". It does make the plot visually more interesting and allows the user to see more in my opinion.

A few of the details for those not interested in scanning through the code:

The minimum time and maximum time of the plot is set to zero and one second, respectively. The interval between samples is 0.001 seconds or one millisecond. Many of you will immediately jump to the fact that that means the sampling frequency (or sampling rate) is 1000 Hz (Fs = 1/dt), and thus the Nyquist frequency is 500 Hz. Although, technically you could reconstruct any frequency (NOT THE SIGNAL ITSELF NECESSARILY, a discussion tabled for another UI) up to Nyquist frequency, I have limited the frequency range from 0 to 100 Hz.

There are 2 interesting things that will notice after playing with the UI:(1) a cosine wave with zero frequency is a linear function with zero slope. In other words a constant: $ f(t) = C $. (2) an increase in phase (moving the phase slider to the right) causes the function to appear to move to the left. The function has undergone a negative translation or time delay. Both of these phenomena will be discussed in a later post and accompanying UI or IPython notebook. For now, it is important to recognize them.

Below are some screenshots. I hope you enjoy this tool and maybe even learn something.