Animation of the Heat Diffusion in an L-shaped domain

Standard

\partial_t T = K \partial^2_x T

out.gif

Advertisement

Amazing NASA simulation of Solar Wind Striping the Martian Atmosphere

Video

The following video by NASA’s Scientific Visualization Center simulates the Martian atmosphere being striped by incoming solar wind.

More videos and images can be found here.

Mars is a cold and barren desert today, but scientists think that in the ancient past it was warm and wet. The loss of the early Martian atmosphere may have led to this dramatic change, and one of the prime suspects is the solar wind. Unlike Earth, Mars lacks a global magnetic field to deflect the stream of charged particles continuously blowing off the Sun. Instead, the solar wind crashes into the Mars upper atmosphere and can accelerate ions into space. Now, for the first time, NASA’s MAVEN spacecraft has observed this process in action – by measuring the speed and direction of ions escaping from Mars. This data visualization compares simulations of the solar wind and Mars atmospheric escape with new measurements taken by MAVEN.

OCO-2 scientists @ JPL find patterns in Carbon Dioxide concentrations

Video

On October 29, 2015 JPL announced that scientists have found patterns in the carbon dioxide concentrations in Earth’s atmosphere. What is most interesting is tha

“…OCO-2 scientists are now beginning to study the net sources of carbon dioxide as well as their “sinks””

 

Another interesting video is this supercomputer model of CO2 levels in Earth’s atmosphere for a whole year (2006):

Full story @ JPL: Excitement Grows as NASA Carbon Sleuth Begins Year Two

Orbiting Carbon Observatory – 2 mission page

Vortices in my coffee and the Perpetual Ocean

Image

In a previous post I shared a video on mixing and unmixing of fluids. This time I share with you an image I took of my coffee. With some milk fluid dynamics created amazing vortices. Following it is an animation of the time evolution of the vortices.

Milk vortices.jpg
Milk vortices” by AstrobobOwn work. Licensed under CC BY-SA 4.0 via Commons.

Continue reading

Matlab – Symbolic & Function Handles

Standard

Consider you want to define a function in Matlab, plot it, and differentiate it. This can be done in two ways. Let’s demonstrate the two methods on the function

f(x) = x - 3 * log(x)

whose derivative is

f'(x) = 1 - \frac{3}{x}

The first is using function handles (ie; numerically) that take & return values as input & output. Function handles require the inputs to be initialized. Here’s an example:


x = linspace(0.5, 5.0)'; % range of x as column vector
f = x - 3 * log(x); % returns numerical values
df = diff(f) ./ diff(x); % also numerical values of the derivative

The other is symbolically (ie; like you do in your math class) as such


syms x % define symbolic variables
f = x - 3 * log(x); % symbolic function
df = diff(f, x); % gives the symbolic derivative

which returns

f = x - 3*log(x)
df = 1 - 3/x

But this way you cannot give the funtion numerical inputs and hence can’t plot it. To do so you’ll have to convert the function to a function handle which is easy using matlabFunction():


f_handle = matlabFunction(f); % convert symbolic fn to a handle
f_handle(2); % value of f @ x = 2
x = linspace(0.5, 5.0)'; % define range for x as column vector
plot(x, f_handle(x) ) % plot f on the range x

which return

f_handle = @(x)x-log(x).*3.0
df_handle = @(x)-3.0./x+1.0