Hier mal ein simpler P-Regler. Regelungstechnik ist allerdings schon sehr lange her, darum keine Ahnung, ob das zu 100% richtig ist

[CODE lang="java" title="P-Regler"]public class P_Regler implements Regler {
private double kp; // Proportionalbeiwert
private double ap; // Arbeitspunkt
public P_Regler(double kp, double ap) {
this.kp = kp;
this.ap = ap;
}
public void setKp(double kp) {
this.kp = kp;
}
public void setAp(double ap) {
this.ap = ap;
}
/**
* @param w Sollwert
* @param x Istwert
* @return Stellwert
*/
@Override
public double getY(double w, double x) {
return Math.min(100, Math.max(0, ap + (w - x) * kp));
}
}[/CODE]