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.
The inability to achieve or sustain a sufficiently firm penile erection (tumescence) to allow normal vaginal sexual intercourse. The great majority of cases are not caused by organic disease and most men experience occasional periods of impotence. It is often related to anxiety about performance and is usually readily corrected by simple counselling methods which prescribe sensual massage but forbid coitus. Organic impotence may be caused by DIABETES, MULTIPLE SCLEROSIS, spinal cord disorders and heart disease. Many cases can be helped by the drug SILDENAFIL (Viagra).
It appears that testosterone has NOS-independent pathways as well. In one study, castrated rats were implanted with testosterone pellets and then divided into a group that received an NOS inhibitor (L-nitro-L-arginine methyl ester [L-NAME]) and a control group that received no enzyme.  The castrated rats that were given testosterone pellets and L-NAME still had partial erections, a result suggesting the presence of a pathway independent of NOS activity.
If you have a neurological disorder or spinal cord injury and other erectile dysfunction treatments aren’t effective, two types of surgical implants could offer solutions to your ED. “An implantable pump can be used to manually create an erection by pumping fluid into cylinders placed inside the penis,” explains Feloney. “The other option is a malleable prosthesis that works like a gooseneck lamp to direct the penis into position for intercourse." Risks for these ED treatments include infection and mechanical breakdown.
A meta-analysis of 36 744 men with ED in 12 prospective cohort studies found that the presence of ED significantly increased the risk of CVD, CAD, stroke and all-cause mortality, and the presence of ED was an independent risk factor for CVD. Ponholzer et al found that men with moderate to severe ED had a 65% increased relative risk for developing symptomatic CAD compared with men who did not have ED.26
Sexual stimulation causes the release of neurotransmitters from cavernosal nerve endings and relaxation factors from endothelial cells lining the sinusoids. NOS produces NO from L-arginine, and this, in turn, produces other muscle-relaxing chemicals, such as cGMP and cyclic adenosine monophosphate (cAMP), which work via calcium channel and protein kinase mechanisms (see the image below). This results in the relaxation of smooth muscle in the arteries and arterioles that supply the erectile tissue, producing a dramatic increase in penile blood flow.
Nerve or spinal cord damage: Damage to the spinal cord and nerves in the pelvis can cause erectile dysfunction. Nerve damage can be due to disease, trauma, or surgical procedures. Examples include injury to the spinal cord from automobile accidents, injury to the pelvic nerves from prostate surgery for cancer (prostatectomy), and some surgeries for colorectal cancer, radiation to the prostate, surgery for benign prostatic enlargement, multiple sclerosis (a neurological disease with the potential to cause widespread damage to nerves), and long-term diabetes mellitus.
PD is a chronic neurodegenerative disease characterized by “motor” and “non-motor” symptoms that lead to progressive disability. Erectile and SD are “non-motor” symptoms and can occur in 50–69% of males with PD (39-42). Ejaculatory and orgasmic function are also impaired. PD affects the dopaminergic pathways leading to erection and arousal. Dopaminergic therapy for PD can improve ED, and sometimes therapy may lead to hypersexuality (43,44). A comparison of married men with PD to age matched controls with non-neurologic chronic disease such as arthritis did not show any discrepancy in ED rates (45). This suggests that ED in certain groups with PD may occur from disease related factors common in chronic illness, in general.
Injection therapy involves injecting a substance into the penis to enhance blood flow and cause an erection. The Food and Drug Administration (FDA) approved a drug called alprostadil (Caverject) for this purpose in July of 1995. Alprostadil relaxes smooth muscle tissue to enhance blood flow into the penis. It must be injected shortly before intercourse. Another, similar drug that is sometimes used is papaverine—not yet been approved by the FDA for this use. Either drug may sometimes cause painful erections or priapism (uncomfortable, prolonged erections) that must be treated with a shot of epinephrine.
In most healthy men, some of the drug will remain in the body for more than two days after a single dose of tadalafil. Metabolism (clearing of the drug from the body) of tadalafil can be slowed by liver disease, kidney disease, and concurrent use of certain medications (such as erythromycin, ketoconazole, and protease inhibitors). Slowed breakdown allows tadalafil to stay in the body longer and potentially increase the risk for side effects. Therefore, doctors have to lower the dose and frequency of tadalafil in the following examples:
Currently, placement of a penile prosthesis is the most common surgical procedure performed for erectile dysfunction. Penile prosthesis placement is typically reserved for men who have tried and failed (either from efficacy or tolerability) or have contraindications to other forms of therapy including PDE5 inhibitors, intraurethral alprostadil, and injection therapy.
Several medications can interfere with the chemical processing of PDE5i medications by the liver. These can include ketoconazole (an antifungal medication known by the brand name Nizoral), erythromycin (an antibiotic), and cimetidine (also known as Tagamet, for reducing stomach acid). A lower dose of PDE5i medications should be used if one is taking any of these medications.
Other hormone levels: Measurement of other hormones beside testosterone (luteinizing hormone [LH], prolactin level, and cortisol level) may provide clues to other underlying causes of testosterone deficiency and erectile problems, such as pituitary disease or adrenal gland abnormalities. Doctors may check thyroid levels in some individuals as both hypothyroidism (low thyroid function) and hyperthyroidism (overactive thyroid function) can contribute to erectile dysfunction.
Other treatment options such as penile self-injection therapy, external vacuum pumps and the medicated urethral system for erection are in rare occasions an effective long-term treatment. Only a very small percentage of men will continue with these treatments as evidenced by a very high drop out rate and a very low refill rate. These treatments require extensive planning which interferes with spontaneity. This may be the reason why the refill rate is so low and the drop out of treatment so high.
This is similar to magnetic resonance imaging. Magnetic resonance angiography uses magnetic fields and radio waves to provide detailed images of the blood vessels. Doctors may inject a "contrast agent" into the person's bloodstream that causes vascular tissues to stand out against other tissues. The contrast agent provides for enhanced information regarding blood supply and vascular anomalies.
Suppositories “were developed so men wouldn’t have to use needles,” Bivalacqua says. They contain the drug alprostadil (also known as prostaglandin E1) and are sold under the brand name Muse. If they are going to work, it takes about five to 10 minutes. However, Muse produces erections in only 30 to 40 percent of patients, usually those with mild ED, because some of the drug is absorbed systemically and diverted from its function of opening penile arteries to allow more blood to flow in. The out-of-pocket cost is around $20 to $30 per suppository.
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.
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. 
Having your current medication checked – if you are taking medication already, it could be that your erection problems are a side effect. Have a doctor check whether this is the cause of your problems and if it is, you might be able to switch medications and then find that your erectile dysfunction goes away completely – or at least improves. Medications that can cause erection problems include:
For best results, men with ED take these pills about an hour or two before having sex. The drugs require normal nerve function to the penis. PDE5 inhibitors improve on normal erectile responses helping blood flow into the penis. Use these drugs as directed. About 7 out of 10 men do well and have better erections. Response rates are lower for Diabetics and cancer patients.