Log on:

Mike Griffiths :: Blog :: matlab

October 31, 2008

This is the first of three articles about charged particle motion in electromagentics fields and the earths magnetic field. The articles will include simple demonstrations built using the matlab clone scilab and the visualisation tool IBM Open data explorer, both of these are open source applications. The first article  will describe a simple scilab based application for modelling charged particle motion. The Lorentz force can be used to model a wide range of systems and phenomena including

  • Motion of particles in colliders and their detectors e.g. the CERN Large Hadron Collider
  • Understanding the solar interior and atmosphere
  • Understanding  the charge particles in the ionosphere e.g. the borealis
  • Confinement of plasmas  for experimental fusion reactors
  • Focusing of beams for electron microscopy

The Lorentz force is the force on point charges due to electric and magnetic fields the elctric field gives rise to a linearly increasing force relationship between the charge and the elctric field intensity. The force generated through the magnetic field is such that it is perpendicular to the plane formed by the particle velocity vector and the magnetic field. This explains the action of the vecotor cross product term.

The cross product term can be undersood from the relativistic nature of the elctromagnetic interaction. It is important to remember that the relativistically covariant Maxwell equations and the special theory of relativity enable us to understand the unified nature of the single electromagnetic interaction. When the lorentz transformations are applied to the electric field we have a cross product relationship between the velocity of the particle and the magnetic field it therfore appears that the magnetic interaction is generated by a relativistic effect, an article in the links provides a good description.

The scilab script uses the lorentz force to update the position of a particle in a constant and uniform electromagnetic field. The equations of motion are solved using a simple Euler integration step. When executed, the script  starts a number of dialogs in turn requesting the user to

  • Define the initial velocity
  • Define the b field
  • Define the e field
  • Provide a tile for the plot
  • The plost is drawn
  • The user is asked if they want to save the plot, if yes and OK are clicked a file save dialog opens.

The particle mass and charge are hard coded at the start of the script but can be altered if the user requires. Not surprisingly there is a lot of information about the lorentz force and charged particle motion, including some interesting video content on utube, one such link in the useful links section below

 

Useful Links

Scilab script requires the lorentz force function file

Matlab script requires the lorentz force function file

Scilab home page

IBM Open data explorer

Wikipedia on Lorentz force

Wikibook on the lorentz force

Science world info about the lorentz force

Article about relativistic transformation of electromagnetic fields

Utube demonstration of Lorentz force

Keywords: lorentz, matlab, scilab

Posted by Mike Griffiths | 0 comment(s)

August 22, 2008

This week work has continued with understanding the visualisation process for MHD data generated using VAC. It has been quite challenging for the following reasons;

  • Processing a fairly large volume of data 415 slices from a data set of 12 double precision fields over an array of 1976x400, this is a binary data file of approximately 40GB
  • For the model under investigation it was necessary to learn how to use the IDL visualisation tool
  • In order to visualise data using data explorer it was necessary to convert the data to an ascii format and then undertake some post processing and data reduction so as to enable data exploration, this was both time and space consuming
  • FORTRAN format statements within the data conversion routines provided by VAC resulted in the incorrect translation of data this was found by using both matlab and IBM data explorer for visualisation.

Current Objectives 

  1. Enable data processing and production of visualisation output using a selection of different compute resources
  2. Process and visualise MHD data generated and stored on range of different compute resources
  3. Automate the production of metadata
  4. Develop visualisation tools enabling researchers to work collaboratively with a data set visualisation

The objectives identified above require that we use open source applications such as IBM data explorer and matlab clones such as scilab. Code for enabling collaborative visualisation has already been tested using IBM DX. Before testing modules using data explorer output was checked against the output generated from exisiting routines with IDL. A rapid introduction was required with frequent reference to the following

IDL tutorial

IDL tutorial2 

IDL online help 

Visualisation routines for IDL had already been generated for the problem under investigation these were fairly easy to use and generated high quality visualisations. However given a lack of experience it was difficult to generate new visualisations. The two other difficulties with IDL was as follows

  • Licensed package only available on patforms where a valid license is available
  • Tools for collaborative visualisation have not yet been developed for IDL
For the tests undertaken this week and given the tools provide by VAC it is clear that the resulting application or research environment should enable researchers to exploit the benefits of the different analysis and visualisation tools. Thus the application will allow the user to provide scripts for driving selected visualisation tools. 

Revised Objectives

  1. Prepare scripts that will be used with the EASA portal
  2. Write matlab data translation and processing task for VAC using the parfor loops with the matlab parallel computing toolbox.
  3. Use matlab and vac programs to generate jpg files from plots, use parallel matlab to run through all the steps
  4. Use DX to enable distributed processing on separate nodes   
  5. Use dx to enable customisable collaborative vusalisation of data   
  6. Write scilab equivalent of data translation task
  7. Investigate use of IBM DX data import module for importing binary VAC data directly into DX  
In the next phase of this work  we are preparing the scripts for creating and running VAC models one of the tasks will be to compare performance of the model with different parallel interconnects. An important test of the scripts if will be to examine the possibility of applying them to a model provided by an independent researcher. Deveopment of code enabling automated metadata capture is in progress.

 

Keywords: data, explorer, IBM dx, IDL, matlab, MHD, Visualisation

Posted by Mike Griffiths | 0 comment(s)

August 07, 2008

Video conferencing technology is a powerful way for fostering and maintaining collaborative projects. This is a brief description of experiences in establishing a parallel computing special interest group with Clemson University in South Carolina.

The motivation for setting up such a group has been encouraged by the following events

  • Clemson has developed the Palmetto cluster, details are given in its top500 listing
  • Matlab is used for parallel computing at The University of Sheffield and Clemson University

Our first experience with meeting up used access grid at first both sites were using different access grid servers. We were unable to connect. Our work around was to use the Evo collaboration network. This proved to be successful video quality was excellent audio quality was average (acceptable) quality was determined by the fact that the session was run from a personal laptop. Fortunately, this was just a test session.

We've just checked that we can connect to the video conferencing facility. Evo users a client called Koala. To connect to the video conference suite we select call from the menu on the Koala client. The call menu has an h323 item and when selected this opens the call h.323 dialog. In this dialog complete the entry in the h323.IP edit box clicking the telephone in this dialog connects to the video conference.

So far so good....  we shall see if this can improve our audio quality for the next meeting.

Other Links

Clemson University Computing and Information Technology

News Item about Clemson develops Palmetto Cluster

Report from Matlab High Productivity Computing Advisory Board Meeting

Presentation to Matlab High Productivity Computing Advisory Board Meeting

Keywords: evo, matlab, parallel

Posted by Mike Griffiths | 3 comment(s)