Example i63: Magnetic Field Calculations from 3 Dipole sources for SCD Analysis

This example simulates magnetic field activity on a hyperthetical 176 SQUID sensor array located above the stomach. The magnetic fields are calculated from 3 dipole sources. The dipole sources overlap between 41-56 and 81-96 s. The Surface Current Density (SCD) can be calculated from the resultant magnetic fields. The maximum SCD location can be related back to the dipole source(s).

The potential and magnetic field solutions are shown at 10, 20, 30, 40 s. These correspond to solution time steps of 50, 100, 150, 200.


The comfile run by this example is as follows:

#
# Forward Magnetic Calculations from dipole sources created
# from full stomach 
#

$EXPORT=1;

# multiple dipole: solution parameters for time; 
# NOTE: units are in timesteps which correspond to 0.2 seconds. e.g., 50 timesteps = 10 s.

$TSTART="0"; 
$TEND="680"; 
$TSTEP="50"; #<-- changed from 5 to 50 for testing
$FREQ="1"; 

$SQUIDOFFSET=10000;  
$DIPOLEOFFSET=20000; 

$DIPOLE=1;           #dipole region

if(!defined $example) 
{  
    $example='.' ;
    $OUT="output"; unless (-d $OUT) {mkdir $OUT};
} else{
    $OUT=".";
}

fem def para;r;$example/torso_param
fem def coor 3,1
fem def base;r;$example/bicubic_bilinear;

#fem def node;r;$example/stomach;
#fem def elem;r;$example/stomach_lin;
#if($EXPORT)
#{
#    fem export node;$OUT/stomach as stomach offset 5000;
#    fem export elem;$OUT/stomach as stomach offset_elem 5000;
#}

fem def node;r;$example/skin;
fem def elem;r;$example/skin_lin;
if($EXPORT)
{
    fem export node;$OUT/skin as skin;
    fem export elem;$OUT/skin as skin;
}

#group nodes
fem group node 29      as FIXEDNODE;
fem group node 1,290   as SURFENDS;
fem group node 2..28,30..289  as SURFNORM;

fem def equa;r;$example/laplace_nr1 reg all;
fem def mate;r;$example/mate_nr1    reg all;
fem def init;r;$example/noflux_nr1  reg all;
fem def solv;r;$example/static_nr1 reg all;

# Define dipole source
fem def source;r;$example/dipole_triple scale -1.0;
fem export source;$OUT/dipole as dipole offset $DIPOLEOFFSET;

# squid 
fem def data;r;$example/squid176 field num_field 3;

#transform form to our coordinates system
fem change data rotate by 90,0,0 about 1,0,0;
fem change data trans  by 0,-280,0

fem exp data;$OUT/squid as squid offset $SQUIDOFFSET error;

#solve
for ($TIME=$TSTART;$TIME<=$TEND;$TIME+=$TSTEP)
{
    $FILENAME=sprintf("%05d",$TIME);

    printf("*** Potential solve at time= $TIME\n");
    printf("*********************************\n");

    fem up sour reg $DIPOLE time $TIME;

    fem solve at $TIME;
    fem up phi tstart $TIME tend $TIME from nodes phi; 
    fem export node;"$OUT/phi_$FILENAME" as skin field reg 1 class 1;

    printf("\n\n");
    printf("*** Magnetic solve at time= $TIME\n");
    printf("*********************************\n");

    fem eval solu mag from MFI nss 1 time $TIME freq $FREQ squid_conf 0 both;
    fem up data field from MFI nss 1 time $TIME freq $FREQ;
    fem export data;$OUT/mfi_known_$FILENAME as mfi_known field_num 1..3 field_name mag offset $SQUIDOFFSET;
} 

fem export elem;"$OUT/phi" as skin field reg 1 class 1;

quit


Files used by this example are:

Name                     Modified     Size

example_i63.com 14-Mar-2011 2.5k bicubic_bilinear.ipbase 22-Feb-2011 7.8k dipole_triple.ipsour 22-Feb-2011 139k draw.com 22-Feb-2011 1.3k laplace_nr1.ipequa 22-Feb-2011 1.3k mate_nr1.ipmate 22-Feb-2011 859 noflux_nr1.ipinit 22-Feb-2011 575 skin.ipnode 22-Feb-2011 258k skin_lin.ipelem 22-Feb-2011 118k squid176.ipdata 22-Feb-2011 17k static_nr1.ipsolv 22-Feb-2011 1.2k stomach.ipnode 22-Feb-2011 64k stomach_lin.ipelem 22-Feb-2011 24k torso_param.ippara 22-Feb-2011 5.9k

Download the entire example:

Name                      Modified     Size

examples_i_i6_i63.tar.gz 15-Mar-2011 581k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:16:01 201622
cm-debugSuccessSat Mar 5 01:48:06 2016184
x86_64-linux
cmSuccessSun Mar 6 00:01:49 201610
cm-debugSuccessSat Mar 5 00:07:12 201674

Testing status by file:


Html last generated: Sun Mar 6 05:51:41 2016

Input last modified: Mon Mar 14 13:42:33 2011


CMISS Help / Examples / i / i6 / i63