PERL   39
edroopy pl
Guest on 9th September 2023 11:31:18 AM


  1. #!/usr/bin/perl
  2. #
  3. #script to make EDROOPY decoupling sequence for bruker
  4. use Math::Trig ':pi';
  5. use Math::Trig ;
  6. use Math::Complex;
  7. use POSIX "fmod";
  8.  
  9. ################################ DEFINE INPUT PARAMS BELOW
  10. #
  11. $start=0; $end=93; #NUMBER of stops
  12. $tf =0.001; #pulse length arbitrary
  13. $w1max=-36.7; #edroopy for vr=20khz, v1=100khz
  14. $lobes=1;
  15. $tot=$end+1;
  16. $pulse = $tot*0.1;
  17. #
  18. #MAKE pcpd2; nothing to edit below here
  19. ###########################################
  20. my @fdat=(); $sum=0;
  21.  
  22. printf "\n";
  23. printf "; steps $tot \n"; #use this for my sims here..
  24. printf "; pcpd(ns) = 100\n"; #use this for my sims here..
  25. print "0.3u fq=cnst21\n";
  26. print "0.5u pl=pl12\n\n";
  27. print "1 ";
  28.  
  29. for($i = $start; $i <= $end; $i++){
  30.  
  31. $inc=$i/$end;
  32. $t= 0 + $tf*$inc;
  33. $u = $lobes*pi*((2*$t/$tf) - 1);
  34. $bf=$w1max*cos($u);
  35.  
  36. $fl = fmod($pht,pi2);
  37. $fl=abs($fl);
  38.  
  39. push @fdat, $bf;
  40. $sum=$sum +$bf;
  41. #printf "%4.0f\t%3.8f\t\n",$i, $bf; # use this to view shape
  42. if ($bf > 0){
  43. printf "pcpd:%3.2f\t\n",$bf, $fl; #use this for my sims here..
  44. }
  45. else{
  46. $bf = $bf+360;
  47. printf "pcpd:%3.2f\t\n",$bf, $fl; #use this for my sims here..
  48. }
  49. }
  50.  
  51. print "jump to 1\n\n";
  52. ###########################################
  53.  

Raw Paste

Login or Register to edit or fork this paste. It's free.