What is exactly psi and segZ function in "segment" function in R
You must attach the data frame curved_data before running the commands. Then, run your command like this:

seg_model &lt;- segmented(reg, seg.Z = ~X, psi = c(-35, 4, 30),
                       control = seg.control(display = TRUE))