Erectile dysfunction can have a range of causes, both physical and psychological. Physical causes include: narrowing of the blood vessels going to the penis – commonly associated with high blood pressure (hypertension), high cholesterol or diabetes hormonal problems surgery or injury Psychological causes of ED include: anxiety depression relationship problems Sometimes erectile dysfunction only occurs in certain situations. For example, you may be able to get an erection during masturbation, or you may find that you sometimes wake up with an erection but you are unable to get an erection with your sexual partner. If this is the case, it is likely the underlying cause of erectile dysfunction is psychological (stress related). If you are unable to get an erection under any circumstances, it is likely that the underlying cause is physical. Erectile dysfunction can also be a side-effect of using certain medicines.