The primary nerve fibers to the penis are from the dorsal nerve of the penis, a branch of the pudendal nerve. The cavernosal nerves are a part of the autonomic nervous system and incorporate both sympathetic and parasympathetic fibers. They travel posterolaterally along the prostate and enter the corpora cavernosa and corpus spongiosum to regulate blood flow during erection and detumescence. The dorsal somatic nerves are also branches of the pudendal nerves. They are primarily responsible for penile sensation. 
Erectile dysfunction is only one cause of sexual dysfunction. Other causes of sexual dysfunction include troubles with ejaculation, decreased libido, and troubles achieving an orgasm (climax). Some men may have premature ejaculation, which is a condition in which the entire process of arousal, erection, ejaculation, and climax occur very rapidly, often in just a few minutes or even seconds, leaving the partner unsatisfied. Premature ejaculation may accompany an erection problem such as ED but is generally treated differently. Troubles with erectile function may lead to decreased libido or interest in sex, however, many men with decreased libido have normal erectile dysfunction. Libido may be affected by psychologic factors, such as stress, anxiety, or depression but often is the result of a low testosterone (the male hormone) level.
There are myriad factors, both mental and physical, that may contribute to your erectile dysfunction symptoms. Some of the most common impotence causes include diabetes, hypertension, prostate problems, low testosterone and obesity, which can not only put a damper on your sexual enjoyment, but play a key role in your total male vitality, too. (Even medications that are often prescribed to control some of the aforementioned issues can be behind some of the frustrating symptoms of ED.) There are factors like depression, stress and anxiety that can leave you longing for your glory days, and the coping mechanisms like alcohol and tobacco that can make a roll in the sheets less satisfying for you and your partner. We’ll listen to you with a compassionate ear and thoughtfully consider what may be contributing to your ED symptoms, then draw up your perfect, personalized treatment.
Patients receiving penile prostheses should be instructed in the operation of the prosthesis before surgery and again in the postoperative period. The prosthesis usually is not activated until approximately 6 weeks after surgery, so as to allow the edema and pain to subside. The prosthesis is checked in the office before the patient begins to use it.
Research is mixed on the effectiveness of acupuncture as an erectile dysfunction cure, but one study published in November 2013 in the Journal of Alternative and Complementary Medicine found that acupuncture can be beneficial for men experiencing erectile dysfunction as a side effect of antidepressants, including selective serotonin reuptake inhibitors (SSRIs) and serotonin noradrenaline reuptake inhibitors (SNRIs).
Under normal circumstances, when a man is sexually stimulated, his brain sends a message down the spinal cord and into the nerves of the penis. The nerve endings in the penis release chemical messengers, called neurotransmitters, that signal the corpora cavernosa (the two spongy rods of tissue that span the length of the penis) to relax and fill with blood. As they expand, the corpora cavernosa close off other veins that would normally drain blood from the penis. As the penis becomes engorged with blood, it enlarges and stiffens, causing an erection. Problems with blood vessels, nerves, or tissues of the penis can interfere with an erection.
"Sexual relations are not only an important part of people's wellbeing. From a clinical point of view, the inability of some men to perform sexually can also be linked to a range of other health problems, many of which can be debilitating or potentially fatal," says Professor Gary Wittert, Head of the Discipline of Medicine at the University of Adelaide and Director of the University's Freemasons Foundation Centre for Men's Health.
It is normal for a man to have five to six erections during sleep, especially during rapid eye movement (REM). Their absence may indicate a problem with nerve function or blood supply in the penis. There are two methods for measuring changes in penile rigidity and circumference during nocturnal erection: snap gauge and strain gauge. A significant proportion of men who have no sexual dysfunction nonetheless do not have regular nocturnal erections.
The Massachusetts Male Aging Study (MMAS) documented an inverse correlation between ED risk and high-density lipoprotein (HDL) cholesterol levels but did not identify any effect from elevated total cholesterol levels.  Another study involving male subjects aged 45-54 years found a correlation with abnormal HDL cholesterol levels but also found a correlation with elevated total cholesterol levels. The MMAS included a preponderance of older men.
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. 
Tadalafil (Cialis) is the third oral medicine approved by the U.S. FDA for the treatment of erectile dysfunction. Like sildenafil (Viagra) and vardenafil (Levitra), tadalafil inhibits PDE5 (as described earlier). Unlike the other PDE 5 inhibitors, patients should take tadalafil once daily and is approved for the treatment of BPH (benign enlargement of the prostate).
Vacuum devices: Specially designed vacuum devices to produce erections have been used successfully for many years. They are safe and relatively inexpensive. They work by creating a vacuum around the penis that draws blood into the penis, engorging it, and expanding it. There are three components to the device, a plastic cylinder in which the penis is placed, a battery or hand operated pump that draws air out of the cylinder creating the vacuum, and an elastic band (constriction device) that is placed around the base of the penis, to maintain the erection after the cylinder is removed and during intercourse by preventing blood from flowing out of the penis back into the body.
There are so many potential reasons a man might develop erectile dysfunction (ED), it's nearly impossible to generalize the best ways to treat it. What works for one man may not work for another simply because they are having problems for different reasons. That said, it may encouraging to hear that there are a variety of options that may be considered, from psychological counseling to lifestyle changes, medications to treatments and devices.
A physical exam checks your total health. Examination focusing on your genitals (penis and testicles) is often done to check for ED. Based on your age and risk factors, the exam may also focus on your heart and blood system: heart, peripheral pulses and blood pressure. Based on your age and family history your doctor may do a rectal exam to check the prostate. These tests are not painful. Most patients do not need a lot of testing before starting treatment.