Penile erection is managed by two mechanisms: the reflex erection, which is achieved by directly touching the penile shaft, and the psychogenic erection, which is achieved by erotic or emotional stimuli. The former uses the peripheral nerves and the lower parts of the spinal cord, whereas the latter uses the limbic system of the brain. In both cases, an intact neural system is required for a successful and complete erection. Stimulation of the penile shaft by the nervous system leads to the secretion of nitric oxide (NO), which causes the relaxation of smooth muscles of corpora cavernosa (the main erectile tissue of penis), and subsequently penile erection. Additionally, adequate levels of testosterone (produced by the testes) and an intact pituitary gland are required for the development of a healthy erectile system. As can be understood from the mechanisms of a normal erection, impotence may develop due to hormonal deficiency, disorders of the neural system, lack of adequate penile blood supply or psychological problems. Spinal cord injury causes sexual dysfunction including ED. Restriction of blood flow can arise from impaired endothelial function due to the usual causes associated with coronary artery disease, but can also be caused by prolonged exposure to bright light.
Physical examination should include the assessment of male secondary sex characteristics, femoral and lower extremity pulses, and a focused neurologic examination including perianal sensation, anal sphincter tone, and bulbocavernosus reflex. More extensive neurologic tests, including dorsal nerve conduction latencies, evoked potential measurements, and corpora cavernosal electromyography lack normative (control) data and appear at this time to be of limited clinical value. Examination of the genitalia includes evaluation of testis size and consistency, palpation of the shaft of the penis to determine the presence of Peyronie's plaques, and a digital rectal examination of the prostate with assessment of anal sphincter tone.
medicines called alpha-blockers such as Hytrin (terazosin HCl), Flomax (tamsulosin HCl), Cardura (doxazosin mesylate), Minipress (prazosin HCl), Uroxatral (alfuzosin HCl), Jalyn (dutasteride and tamsulosin HCl), or Rapaflo (silodosin). Alpha-blockers are sometimes prescribed for prostate problems or high blood pressure. In some patients, the use of Sildenafil with alpha-blockers can lead to a drop in blood pressure or to fainting
The drugs are worth trying, but don’t expect miracles. Everyone has heard of Viagra, but Cialis is actually more popular because it’s effective longer—24 to 36 hours instead of three to five. Erection drugs improve erections in around two-thirds of men. They don’t work for about one-third. When they work, they do not produce porn-star erections. Over time, many men need larger doses. But as dosage increases, side effects become more likely, notably, headache and nasal congestion. Finally, the drugs have no effect on arousal, so men may raise erections but don't feel particularly interested in sex. Many men feel disappointed with the drugs. Fewer than half refill their prescriptions.
Associated morbidity may include various other male sexual dysfunctions, such as premature (early) ejaculation and male hypoactive sexual desire disorder. The NHSLS found that 28.5% of men aged 18-59 years reported premature ejaculation, and 15.8% lacked sexual interest during the past year. An additional 17% reported anxiety about sexual performance, and 8.1% had a lack of pleasure in sex. 
Qaseem, A., Snow, V., Denberg, T. D., Casey, D. E., Forciea, M. A., Owens, D. K., & Shekelle, P. (2009). Hormonal testing and pharmacologic treatment of erectile dysfunction: A clinical practice guideline from the American College of Physicians. Annals of internal medicine, 151(9), 639-649. Retrieved from http://annals.org/aim/article/745155/hormonal-testing-pharmacologic-treatment-erectile-dysfunction-clinical-practice-guideline-from