Monitoring erections that occur during sleep (nocturnal penile tumescence) can help you and your doctor to understand if the erectile dysfunction is due to psychological or physical causes. The nocturnal penile tumescence test is a study to evaluate erections at night. Normally men have three to five erections per eight hours of sleep. The test can be performed at home or in a sleep lab. The most accurate way to perform the test involves a special device that is connected to two rings. The rings are placed around the penis, one at the tip of the penis and the other at the bottom (base) of the penis. The device records how many erections occur, how long they last, and how rigid they are. The test is limited in that it does not assess the ability to penetrate.
In the meantime, make sure he gets some rest and takes it easy. The more you two stress about it — and the more pressure he feels you are putting on him — the harder it will get for him to get hard, in all likelihood. So take a few days off. Relax, be patient, and help him find him some help if he needs it. In the meantime, here's a Cosmopolitan.com guide about exactly this topic from sex therapist Dr. Jane Greer.
Willful and capricious – erections are funny things. When you're a young man, they seem to pop up at the most inappropriate moments (and the only thing between you and embarrassment is a carefully placed notebook). As you get older, however, they go the other way, and fail to appear on demand no matter how much you try. The sad thing is, my patients often equate this with a loss of masculinity.
Certain types of blood pressure medications, antiulcer drugs, antihistamines, tranquilizers (especially before intercourse), antifungals (hetoconazole), antipsychotics, antianxiety drugs, and antidepressants, known as selective serotonin reuptake inhibitors (SSRIs, including Prozac and Paxil), can interfere with erectile function. Smoking, excessive alcohol consumption, and illicit drug use may also contribute. In rare cases, low levels of the male hormone testosterone may contribute to erectile failure. Finally, psychological factors, such as stress, guilt, or anxiety, may also play a role, even when the impotence is primarily due to organic causes.
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.
However, a review of a United Kingdom medical record database found no evidence that the use of 5-alpha reductase inhibitors independently increase the risk for ED. In 71,849 men with benign prostatic hyperplasia (BPH), the risk of ED was not increased with the use of finasteride or dutasteride only (odds ratio [OR] 0.94), or a 5-alpha reductase inhibitor plus an alpha blocker (OR 0.92) compared with an alpha blocker only. In addition, the risk of ED was not increase in 12 346 men prescribed finasteride 1 mg for alopecia, compared with unexposed men with alopecia (OR 0.95). The risk of ED did increase with longer duration of BPH, regardless of drug exposure. 
Surgery to repair arteries (penile arterial reconstructive surgery) can reduce impotence caused by obstructions that block the flow of blood to the penis. The best candidates for such surgery are young men with discrete blockage of an artery because of a physical injury to the pubic area or a fracture of the pelvis. The procedure is less successful in older men with widespread blockage of arteries.
While impotence may be the presenting symptom of vascular disease, in neurologic disease impotence generally occurs in the setting of an obvious nervous system disorder, typically in patients known to have spinal cord pathology or neuropathy. Impotent patients should be questioned about decreased genital sensation, which would suggest diabetic, alcoholic, or other forms of neuropathy; weakness, which may accompany multiple sclerosis or spinal cord tumors; and back pain, bowel, and bladder symptoms, which raise concern for cauda equina syndrome. A careful drug history is important in the evaluation of impotence. Drugs that cause impotence (Table 187.3) generally do so by interfering with neurotransmission.
By contrast, psychogenic impotence typically is abrupt in onset, often in relation to psychological trauma, and may wax and wane. Patients with psychogenic impotence may have total erectile failure with one partner but not another, or be impotent during sexual intercourse but not during self-stimulation. Normally occurring spontaneous erections in the morning suggest psychogenic rather than organic causes for impotence.
In fact, one common reason many younger men visit their doctor is to get erectile dysfunction medication. Often, men with erectile dysfunction suffer with diabetes or heart disease, or may be sedentary or obese, but they don’t realize the impact of these health conditions on sexual function. Along with erectile dysfunction treatment, the doctor may recommend managing the illness, being more physically active, or losing weight.
Whatever happens, remember there are still ways you can have fun and be intimate even if your partner can’t get an erection. Exchanging sexy texts, reading erotic literature, and indulging in sensual massage can all help to relax, inspire and increase intimacy. Of course, every couple is different and it may take a while to find out what works for you.
Vacuum devices for ED, also called pumps, offer an alternative to medication. The penis is placed inside a cylinder. A pump draws air out of the cylinder, creating a partial vacuum around the penis. This causes it to fill with blood, leading to an erection. An elastic band worn around the base of the penis maintains the erection during intercourse.