N=50
Lmax=70
Tstim=12.0
Ttot=16.0
Hz=2.0

gEE=12.0
gEI=20.0
gIE=20.0
tau=20
Apluss=(0.02 0.022 0.024 0.026 0.027 0.028 0.029 0.03 0.032 0.035 0.04 0.045)
Aminus_factors=(-0.7 -0.8 -0.9 -1.0 -1.1 -1.2 -1.5 -2.0 -3.0 -4.0)

#For panel A:
echo python3 stdpsynfire_noNMDA_synstim_vartau.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE 0.0 0.0 0.03 $tau 1 $myseed
python3 stdpsynfire_noNMDA_synstim_vartau.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE 0.0 0.0 0.03 $tau 1 $myseed

#For panels B-L, N-O:
for iAplus in `seq 0 11`
do
    for iAminus in `seq 0 9`
    do
        Aplus=${Apluss[iAplus]}
        Aminus_factor=${Aminus_factors[iAminus]}
        Aminus=$(echo "scale=6; $Aplus * $Aminus_factor" | bc | sed 's/-./-0./')
        wInit=$Aplus
      
        for myseed in `seq 1 20`
        do
            if [ $myseed == 1 ]
            then
                seedadd=""
            else
                seedadd="_seed${myseed}"
            fi

            filename=stdpsynfire_synstim_N${N}_L${Lmax}_T${Tstim}_${Ttot}_${Hz}Hz_gEE${gEE}_gEI${gEI}_gIE${gIE}_A${Aplus}_${Aminus}_${wInit}${seedadd}.mat
            if [ -f $filename ]
            then
                echo "${filename} exists"
            else
                echo "${filename} does not exist"
                echo python3 stdpsynfire_noNMDA_synstim_vartau.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE $Aplus $Aminus $wInit $tau 1 $myseed
                python3 stdpsynfire_noNMDA_synstim_vartau.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE $Aplus $Aminus $wInit $tau 1 $myseed
            fi
        done
    done
done
			
#For panel M:
Aplus=0.029
Aminus_factor=-1.0
Aminus=$(echo "scale=6; $Aplus * $Aminus_factor" | bc | sed 's/-./-0./')
wInit=$Aplus

for myseed in `seq 1 5`
do
    tau=20
    if [ $myseed == 1 ]
    then
        seedadd=""
    else
        seedadd="_seed${myseed}"
    fi

    filename=stdpsynfire_synstim_allweights_N${N}_L${Lmax}_T${Tstim}_${Ttot}_${Hz}Hz_gEE${gEE}_gEI${gEI}_gIE${gIE}_A${Aplus}_${Aminus}_${wInit}${seedadd}.mat
    if [ -f $filename ]
    then
        echo "${filename} exists"
    else
        echo "${filename} does not exist"
        echo python3 stdpsynfire_noNMDA_synstim_vartau_saveallweights.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE $Aplus $Aminus $wInit $tau 1 $myseed
        python3 stdpsynfire_noNMDA_synstim_vartau_saveallweights.py $N $Lmax $Tstim $Ttot $Hz $gEE $gEI $gIE $Aplus $Aminus $wInit $tau 1 $myseed
    fi
done