ok first circuit on lt spice and it worked, it gave the 2.Vref output like it says how would i go about changing the lm317 with my switching circuit?
I think the circuit would be similar for the Simple Switcher but you'd likely get rid of the resistor between the output and the adjust pin (the feedback pin of the simple switcher.) The LM317 doesn't have a ground pin so its internal reference is relative to the output voltage. The simple switcher does have a ground pin so I'm guessing it's internal is relative to ground. Hence, no need for that resistor.
If you have a Simple Switcher then I'd first get it working with just a pot. Switchers with an adjustable output can be tricky. Especially with a wide output range. Be sure to put a decent size load on the output. Keep capacitance on the output the minimum required by the switcher's datasheet.
Once you have that working I'd replace the pot with the op amp and feedback network. The op amp doesn't have to be anything special. Any jellybean part should work. I used a TL081.
I'd start with larger values for the compensation cap and the resistor going to the feedback pin. Those (and the two 10k resistors) control the bandwidth of the feedback structure. You'll get less bandwidth with large values but you'll also be less likely to have oscillation.
The two 10k resistors control the gain. If you need a different output range then adjust these accordingly. Keep the total value of these to around 10k to 100k.
I came to the values for the LM317 circuit using a network analyzer. If you have one of those it will save you a lot of time. Otherwise you'll have to tweak the values and observe the output and watch for any instability. If you have a signal generator then you can feed a sine wave into the V
ref node to sweep through the entire range of output voltages. If you see any fuzziness or distortion (use an oscilloscope, obviously) then your compensation network needs some tweaking. Remember that you will need a negative power supply if you expect to get to voltages lower than the internal reference (1V21.)