People could make educated guesses, myself I don't know enough to make any good ones, but the best thing to do would be to get labwork done and post it here to see if the more experienced members can help you determine the problem and possible actions.
One basic step in defining erectile problems is whether the problem is physiologic or psychologic and you can gain good information on this by whether or not you are achieving night time tumescence (med speak for a partial erection or chubby) since if you achieve good erections while sleeping yet fail to get an erection during sex the problem is not physical. You can do this by a variety of means often you will notice that upon waking in the morning or when you wake up at night to urinate you have an erection. Another way is to place a either a band with a slip gauge to measure tumescent girth or with a series of slightly larger rings that get broken to guage growth. They also have electronic guages that record both circumference and duration and number of events but these are not the kind of thing kept on the shelf at CVS.