public Oscillators(String positioning, int mode, int N, int lowMassId,
      String bc) {
    this.state = new double[2 * (N + 2) + 1]; // includes the two ends of the
                                              // chain
    this.bc = bc;
    this.lowMassId2 = lowMassId*2;

    if (positioning.equals("mode")) {
      int correction = 0;
      int offset = 0;

      if (this.bc.equals("periodic")) {
        correction = 1;
      } else if (this.bc.equals("free")) {
        correction = 2;
        offset = 1;
      }

      this.normalMode = new OscillatorsMode(mode, N - correction);
      if (this.bc.equals("free")) {
        normalMode.setPhase(Math.PI / 2);
      }
      for (int i = offset, n = getNum(); i < n; ++i) {
        // initial displacement
        state[2 * i] = normalMode.evaluate(i - offset);
      }
    } else if (positioning.equals("random")) {
      // initialize on random positions
      Random rand = new Random();
      for (int i = 2; i < getNum2() - 2; i += 2) {
        state[i] = rand.nextDouble() - 0.5;
      }
    } else if (positioning.equals("pulse")) {
      if (state.length < 12) {
        throw new RuntimeException(
            "Too few particles for positioning type 'pulse'. You need at least 5");
      }

      int offset = 76;
      state[offset + 2] = 0.2;
      state[offset + 4] = 0.6;
      state[offset + 6] = 1.0;
      state[offset + 8] = 0.6;
      state[offset + 10] = 0.2;
    }

    solver = new RK4(this);
  }