op amplifier with both negative and positive feedback
This circuit produces a linear ramp output. The zener diode and R1 produce a constant voltage across R2 (since the op-amp output tracks the capacitor voltage as it increases). The output slope is \$+\frac{V_Z}{R_2 C_2}\$ (once the switch opens, before that it sits near 0V, depending on the op-amp and supplies). 

The output ramp will deviate from linearity when either the op-amp output saturates or the zener is no longer able to maintain regulation. The op-amp should have bipolar supplies for this to work well, or use a 'single supply' op-amp that has an output that can get close to the negative rail. 

For better results you can replace the zener with a shunt reference such as the LM4040. 

Edit: Here, in the below simulation, you can see the action- the output voltage vs. time is very linear for the first millisecond or so. The switch opens at t=0+, allowing the current to flow into the capacitor. 







simulate this circuit &ndash; Schematic created using CircuitLab