#!/usr/bin/perl use POSIX 'log10'; #calculating RF Field and p5 time needed for FSLG #note LG element is start-(p5-p5-p5-p5)-looptostart #p5 = 294 degree pulse # want n*4*p5 = taur # note want 293 degree pulse on res for p5 # which gives a 360 at cnst20/sqrt(2) # using my own lgcalc_dm.incl file which puts p5=(1/4*cnst20) # # note RF_ONRES below should be assigned to cnst20 # the corresponding cwlgs_13 pl13 should be figured with the # p90 calibration value $vr=7000; $cnst20 = 90700; #LG RFfield at plw13 ########################################## # current LG settings: $rf20 = $cnst20; $taur = 1/$vr; #rotor period $p5 = (1/4)*$taur; #rotor period ########################################## # Print ########################################## printf(" ##########################################\n\n"); printf(" Current LG settings: \n"); printf(" MAS_RATE = %4.0f\t\n", $vr); printf(" RF_onres = %4.0f\t\n\n", $cnst20); printf(" taur(us) = %4.1f\t\n", $taur*1e6); printf(" p5(us) = %4.1f\t\n", $p5*1e6); printf("1*4*p5(us) = %4.1f\t", 1*4*$p5*1e6); printf("2*4*p5(us) = %4.1f\t", 2*4*$p5*1e6); printf("3*4*p5(us) = %4.1f\t", 3*4*$p5*1e6); printf("4*4*p5(us) = %4.1f\t\n\n", 4*4*$p5*1e6); printf(" ##########################################\n\n"); ########################################## # optimal LG settings: # note lgcalc.incl uses below: # $p5 = (294/360)/$cnst20 $taur = 1/$vr; #rotor period $p5 = 1/(4*$vr); $p5_start =$p5; #$rf20 = (294/360)/$p5; $rf20 = (1)/$p5; ########################################## # Print ########################################## printf(" Optimal LG settings: \n"); printf(" MAS_RATE = %4.0f\t\n", $vr); printf(" taur(us) = %4.1f\t\n\n", $taur*1e6); $p5= 1*$p5_start/1; $rf20 = (294/360)/$p5; $rf_lg = $rf20/sqrt(2); $p90 = 1/(4*$rf_lg); printf(" RF_onres = %4.0f\t\n", $rf20); printf(" RF_LG = %4.0f\t\n", $rf_lg); printf(" p5(us) = %4.3f\t\n", $p5*1e6); printf(" 4*p90(us) = %4.3f\t\n", 4*$p90*1e6); printf(" (p90(us)(calibration 90 wanted) = %4.3f\t\n", $p90*1e6); printf("1*4*p5(us) = %4.3f\t", 1*4*$p5*1e6); printf("2*4*p5(us) = %4.3f\t", 2*4*$p5*1e6); printf("3*4*p5(us) = %4.3f\t", 3*4*$p5*1e6); printf("4*4*p5(us) = %4.3f\t\n\n", 4*4*$p5*1e6); #now double RF Field $p5= 1*$p5_start/2; $rf20 = (294/360)/$p5; $rf_lg = $rf20/sqrt(2); $p90 = 1/(4*$rf_lg); printf(" RF_onres = %4.0f\t\n", $rf20); printf(" RF_LG = %4.0f\t\n", $rf_lg); printf(" p5(us) = %4.3f\t\n", $p5*1e6); printf(" 4*p90(us) = %4.3f\t\n", 4*$p90*1e6); printf(" (p90(us)(calibration 90 wanted) = %4.3f\t\n", $p90*1e6); printf("1*4*p5(us) = %4.3f\t", 1*4*$p5*1e6); printf("2*4*p5(us) = %4.3f\t", 2*4*$p5*1e6); printf("3*4*p5(us) = %4.3f\t", 3*4*$p5*1e6); printf("4*4*p5(us) = %4.3f\t\n\n", 4*4*$p5*1e6); #now triple RF Field $p5= 1*$p5_start/3; $rf20 = (294/360)/$p5; $rf_lg = $rf20/sqrt(2); $p90 = 1/(4*$rf_lg); printf(" RF_onres = %4.0f\t\n", $rf20); printf(" RF_LG = %4.0f\t\n", $rf_lg); printf(" p5(us) = %4.3f\t\n", $p5*1e6); printf(" 4*p90(us) = %4.3f\t\n", 4*$p90*1e6); printf(" (p90(us)(calibration 90 wanted) = %4.3f\t\n", $p90*1e6); printf("1*4*p5(us) = %4.3f\t", 1*4*$p5*1e6); printf("2*4*p5(us) = %4.3f\t", 2*4*$p5*1e6); printf("3*4*p5(us) = %4.3f\t", 3*4*$p5*1e6); printf("4*4*p5(us) = %4.3f\t\n\n", 4*4*$p5*1e6); #now quadruple RF Field $p5= 1*$p5_start/4; $rf20 = (294/360)/$p5; $rf_lg = $rf20/sqrt(2); $p90 = 1/(4*$rf_lg); printf(" RF_onres = %4.0f\t\n", $rf20); printf(" RF_LG = %4.0f\t\n", $rf_lg); printf(" p5(us) = %4.3f\t\n", $p5*1e6); printf(" 4*p90(us) = %4.3f\t\n", 4*$p90*1e6); printf(" (p90(us)(calibration 90 wanted) = %4.3f\t\n", $p90*1e6); printf("1*4*p5(us) = %4.3f\t", 1*4*$p5*1e6); printf("2*4*p5(us) = %4.3f\t", 2*4*$p5*1e6); printf("3*4*p5(us) = %4.3f\t", 3*4*$p5*1e6); printf("4*4*p5(us) = %4.3f\t\n\n", 4*4*$p5*1e6); printf(" ##########################################\n"); printf(" ##########################################\n"); printf(" ##########################################\n"); exit;