If command in shell script

#!/bin/bash
for i in $(seq 0 $2)
do
for j in $(seq 0 $2)

do
if [ “$i” -ge “$1” ] || [ “$j” -ge “$1” ] ; then # or $j>=$a
echo “time math -script jQcoeffs.m $2 $i $j”
fi
done
done
~

 

Courtesy — Pranav

Continue reading If command in shell script

Advertisements

Make gnuplot column as a variable

Consider a case where there is a complicated manipulation of the columns which you wish to do before final plotting. The expression can be made into a variable

a = ‘column(4)/column(3)’
but this will not work if you just put the system as

pl … u 1:a ..

One needs to use this

pl[][] filename1 u 1:(@a) ..

 

courtesy:

https://stackoverflow.com/questions/19003717/gnuplot-using-a-string-variable-to-define-columns

Discontinuous patches in surface plot

 

Sometimes surface plots (Plot3D) in Mathematica can show discontinuous patches.

Use exclusions none (Make sure the exclusions are unphysical)

 

Plot3D[Re[Bands[J1val, J2val, kxval, kyval]], {kxval, kxv – delta,
kxv + delta}, {kyval, kyv – delta, kyv + delta}, Exclusions -> None]

courtesy and more details:

https://mathematica.stackexchange.com/questions/98813/can-anyone-explain-this-weird-plot3d-error