% Create an Optickle Virgo

function opt = optVirgo

  % nIn = 2;
  % fMod = 6264080;
  % gMod = 0.17;

  % some lengths
  lX = 3006.38;
  lY = 3005.53;
  
  lIX = 6.3807;
  lIY = 5.5328;

  lPR = 6.11625;

  % create model
  opt = Optickle;
  
  % add recycling mirror and BS
  %   BSa takes beams from recycling mirrors to input optics
  %   BSb takes beams from input optics to recycling mirrors
  [opt, snPR, nPR_HR, nPR_AR] = ...
      addOptic(opt, 'PR', 0.12, 100e-6, 1e-3, 20e-6, 40e-6, lPR, 0);

  [opt, snBSa, nBSa_HR, nBSa_AR] = ...
      addOptic(opt, 'BSa', 0.5, 100e-6, 1e-3, 20e-6, 40e-6, lPR, -1);

  [opt, snBSb, nBSb_HR, nBSb_AR] = ...
      addOptic(opt, 'BSb', 0.5, 100e-6, 1e-3, 20e-6, 40e-6, lIY, lIX);

  % add arm optics
  [opt, snIX, nIX_HR, nIX_AR] = ...
      addOptic(opt, 'IX', 0.12, 300e-6, 1e-3, 20e-6, 40e-6, lX, lIX);

  [opt, snIY, nIY_HR, nIY_AR] = ...
      addOptic(opt, 'IY', 0.12, 300e-6, 1e-3, 20e-6, 40e-6, lY, lIY);

  [opt, snEX, nEX_HR, nEX_AR] = ...
      addOptic(opt, 'EX', 50e-6, 300e-6, 1e-3, 20e-6, 40e-6, lX, -1);

  [opt, snEY, nEY_HR, nEY_AR] = ...
      addOptic(opt, 'EY', 50e-6, 300e-6, 1e-3, 20e-6, 40e-6, lY, -1);

  % add links
  opt = addLink(opt, snPR, 1, nBSa_HR);
  opt = addLink(opt, snBSb, 1, nPR_HR);

  opt = addLink(opt, snBSa, 1, nIY_AR);
  opt = addLink(opt, snIY, 2, nBSb_HR);

  opt = addLink(opt, snBSa, 2, nIX_AR);
  opt = addLink(opt, snIX, 2, nBSb_AR);

  opt = addLink(opt, snIX, 1, nEX_HR);
  opt = addLink(opt, snEX, 1, nIX_HR);

  opt = addLink(opt, snIY, 1, nEY_HR);
  opt = addLink(opt, snEY, 1, nIY_HR);
