Feeds:
Posts
Comments

I’m familiar with C, but in my field, fortran90 or higher version have been widely used. (I met Fortran77, where most irritating and annoying part is dynamic allocation which is not supported) I get accustomed to Fortran, but sometimes, I need to connect my C module to main code written by Fortran. I might describe my know-how here, but I’d better list links which would be helpful for you and my memory.

Following links might be very helpful.

http://www.math.utah.edu/software/c-with-fortran.html

Totalview in PPPL Cluster

If you want to run Totalview for a parallel job using several nodes, you might need following:

Currently, Totalview in PPPL cluster sets default accessing shell as “rsh”. So if you try to run Totalview, the program will try to use “rsh”, which is not supported in PPL cluster, and you’ll meet error message like ” connection refused ” with several lines showing trials of access to other nodes using rsh.
To change the default value, you might need to add a following line to your “.cshrc” (Cshell) or “.bashrc”(bash) as

setenv TVDSVRLAUNCHCMD ssh (cshell)
export TVDSVRLAUNCHCMD=ssh (bash)

In addition, it’ll be necessary to use interactive job(“-I” option) to run totalview. Note that you need one more option “-V” to transfer your environmental variable(esp. for DISPLAY) to allocated nodes. If not, you’ll meet X11 forwarding problem, and an error message telling environmental variable DISPLAY is not properly set.

After you get interactive nodes, you can run totalview(“-tv” option) with MPICH as

mpirun -tv -np (# of CPUs) (executable file)

Vi (or Vim)

For word completion :
(insert mode) ctrl-n / ctrl-p next/previous word completion referring to the editing file.
(insert mode) ctrl-x, ctrl-l line completion

For exploring directories and files :
:e .

For copy or delete using visual block
ctrl-V, (select region using arrowkey), y copy
ctrl-V, (select region using arrowkey), d delete

If you don’t want to change settings every time when you use vi(or vim), the permanent setting can be done by changing( or making if it doesn’t exist in your $HOME directory) following file :
.vimrc

For coloring :
syntax on

For backspace :
set backspace=2

http://www.rayninfo.co.uk/vimtips.html
http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html

I need to finish this post and other posts in my weblog, but due to my laziness and other works in real life, it’s hard to update the contents. If you have any question, please contact me below e-mail address. But, I’ll try to update this subject and differential equations with symmetry in near future. There are lots of funs with this subject.

yoones1@gmail.com

last modified : 28th Oct. 2010

——————————
This article is based on a report entitled “A Pedestrian’s Guide to Lie Transforms: A New Approach to Perturbation Theory in Classical Mechanics” by Robert G. Littlejohn (1978). Before rushing  into Lie transform, understanding the method of average and Poincare’-Von Zeipel perturbation(PV) method would be helpful to understand advantage of Lie trasnform. I’m planning to update this article with more details. 

————————KEY

F(\theta,J') = \theta \cdot J' + \epsilon F_1 \theta, J') + \epsilon^2 F_2(\theta,J')+...

\theta' = \theta + \epsilon \frac{\partial F_1}{\partial J'}(\theta,J') + \epsilon^2 \frac{\partial F_2}{\partial J'}(\theta, J') + ...
J = J' + \epsilon \frac{\partial F_1}{\partial \theta}(\theta,J') + \epsilon^2 \frac{\partial F_2}{\partial \theta}(\theta, J') + ...
ES) How can we express old variables purely in terms of new variables?
Up to O(\epsilon),
\theta = \theta' - \epsilon \frac{\partial F_1}{\partial J'} (\theta',J') + O(\epsilon^2)
J = J' + \epsilon \frac{\partial F_1}{\partial \theta'}(\theta',J') + O(\epsilon^2)
ES) Note that \theta \to \theta' on the account of near-identity transformation up to O(\epsilon). What if we need to get higher order? We would face difficulties with disentangling mixed variables.
page 5.20 “In the Lie method, canonical transformations are generated without mixing old and new variables, therby completely bypassing the disentangling process.”
——————————

page 5.13

“it is necessary to “disentangle” (5.27) to express old variables purely as a function of new variables.”

ES) Due to the generating function with mixed variables, the disentangling is inevitable in PV method. To the first order, it can be achieved easily since near-identity canonincal transformation is used.

page 5.15

“In (5.38) it is necessary to assume that the denominator does not vanish, which is equivalent to assuming that ther are no “first-order resonances” among the unperturbed oscillators.”

ES) What if first-order resononces exist among the unperturbed oscillators? What can we do?

page. 5.19

“The essence of the perturbation method of Poincare’ and Von Zeipel is the use of near-identity canoncical transformations, generated by mixed variable generating functions, to eliminate the dependence of a Hamiltonian on one or more variables or classes of terms.  ……….. in the case of time-dependent systems, it is possible to choose the transformation so that the new Hamiltonian K is independent of time. Or, with systems with some fast variables and some slow variables, it may be desirable to choose the transformatin so that the dependence on the fast generalized coordinates is eliminated.”

page 6.19
“A much more elegant derivation has been summarized by Cary, who centers his arguments around a certain differential equation in operator space. Cary’s formulas, including a Lie generator equivalent of the Hamilton-Jacobi equation, are expressed in closed form, i.e. not as a power seires in \epsilon.”

From Wiki =)

Funny picture

Time dependent field is a key!

The red particle moves in a flowing fluid; its pathline is traced in red; the tip of the trail of blue ink released from the origin follows the particle, but unlike the static pathline (which records the earlier motion of the dot), previously released ink moves up with the flow. (This is a streakline.) The dashed lines represent contours of the velocity field (streamlines), showing the motion of the whole field at the same time.

The red particle moves in a flowing fluid; its pathline is traced in red; the tip of the trail of blue ink released from the origin follows the particle, but unlike the static pathline (which records the earlier motion of the dot), previously released ink moves up with the flow. (This is a streakline.) The dashed lines represent contours of the velocity field (streamlines), showing the motion of the whole field at the same time.

Trace and pressure tensor

Since the trace of any tensor is independent of any coordinate system, the most complete coordinate-free decomposition of a symmetric tensor is to represent it as the sum of a constant tensor and a traceless symmetric tensor. (Symon (1971) Ch. 10) Thus:

\varepsilon_{ij}=\left(\frac{1}{3}\varepsilon_{kk}\delta_{ij}\right) +\left(\varepsilon_{ij}-\frac{1}{3}\varepsilon_{kk}\delta_{ij}\right)

where δij is the Kronecker delta. The first term on the right is the constant tensor, also known as the pressure, and the second term is the traceless symmetric tensor, also known as the shear tensor.

Symon, Keith (1971). Mechanics. Addison-Wesley, Reading, MA. ISBN 0-201-07392-7.

From wiki

Working directory

import os
print os.getcwd()

Data visualization tool

A quick look at six open source graphics utilities

M. Tim Jones (mtj@mtjones.com), Senior Principal Software Engineer, Emulex Corp.

http://www.ibm.com/developerworks/linux/library/l-datavistools/

===============================

This is a good document in that the author explains, compares, and recommend data visualization tools.

Fourier series theorem

Fourier Series theorem is relevant to Ballooning representation.

Theorem 21.2 (Fourier Series Theorem)
.

  1. Let $ f(x)$ be a function which is piecewise continuous on $ [-\pi , \pi ]$ .Its Fourier series is given by

$\displaystyle \frac{1}{2\pi}\int^\pi_{-\pi}f(t)\,dt+\frac{1}{\pi}\sum^\infty_{n=1} \int^\pi_{-\pi} f(t)\cos n(t-x)\,dt = \frac{1}{2}[f(x^-)+f(x^+)] $

at each point $ -\pi<x<\pi$ where the one sided derivatives $ f'_R(x)$ and $ f'_L(x)$ both exist.

2. If $ f$ is continuous the result is

$\displaystyle \frac{1}{2\pi}\sum^\infty_{n=-\infty}\int^\pi_{-\pi} e^{in(x-t)} f(t)\,dt =\frac{1}{2}[f(x^-)+f(x^+)]=f(x)\quad \forall\, f\in C[-\pi ,\pi ]\,. $

Excerpt from http://www.math.ohio-state.edu/~gerlach/math/BVtypset/node27.html#Fourier_series_theorem

Ref. A. Thyagaraja, J. Plasma Physics 59, 367 (1998)

Following module should be installed :

  • X11>xorg-server (required, the Cygwin/X X Server)
  • X11>xinit (required, scripts for starting the X server: xinit, startx, startwin.sh, startxwin.bat (and a shortcut on the Start Menu to run it), startxdmcp.bat )
  • NET> openssh
  • After cygwin 1.7, you need to type NOT “startxwin.bat” BUT “startxwin”.
    There could be some troubles in opening multiple X terminals(xterm), and I found a good reference for it even though it’s for previous version. I have done it with typing “startxwin.bat” again and again, but in v.1.7, repeating “startxwin” doesn’t work.

    http://en.wikibooks.org/wiki/Cygwin#MultiWindow_Mode

    X -multiwindow &
    export DISPLAY=127.0.0.1:0.0
    xterm &
    xterm &

    Older Posts »

    Follow

    Get every new post delivered to your Inbox.