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. 
Having erection trouble from time to time isn't necessarily a cause for concern. If erectile dysfunction is an ongoing issue, however, it can cause stress, affect your self-confidence and contribute to relationship problems. Problems getting or keeping an erection can also be a sign of an underlying health condition that needs treatment and a risk factor for heart disease.
Alprostadil should not be used in men with urethral stricture (scarring and narrowing of the tube that urine and the ejaculate pass through), balanitis (inflammation/infection of the glans [tip] of the penis, severe hypospadias (a condition where the opening of the urethra is not at the tip of the penis, rather on the underside of the penis), penile curvature (abnormal bend to the penis), and urethritis (inflammation/infection of the urethra).
Cavernosography measurement of the vascular pressure in the corpus cavernosum. Saline is infused under pressure into the corpus cavernosum with a butterfly needle, and the flow rate needed to maintain an erection indicates the degree of venous leakage. The leaking veins responsible may be visualized by infusing a mixture of saline and x-ray contrast medium and performing a cavernosogram. In Digital Subtraction Angiography (DSA), the images are acquired digitally.
Erectile dysfunction (previously called impotence) is the inability to get or maintain an erection that is sufficient to ensure satisfactory sex for both partners. This problem can cause significant distress for couples. Fortunately more and more men of all ages are seeking help, and treatment for ED has advanced rapidly. The enormous demand for “anti-impotence” drugs suggests that erection problems may be more common than was previously thought. Find out more about the causes and treatment of erectile dysfunction here.
Somatomotor penile innervation originates in Onuf’s nucleus in the S2-4 spinal segments. These nerves travel to the ischiocavernosus and bulbocavernosus muscles when activated lead to contraction necessary for the rigid-erection phase. Several animal studies show that stimulation of the somatomotor pathways may also be under sympathetic control, and adrenergic stimulation may lead to contraction of these muscles during ejaculation (13,14). Somatomotor spinal reflexes may also be initiated by genital stimulation. For instance, the well-known bulbocavernosus reflex is evidence this reflex exists; however the clinical significance of its absence in the neurological assessment of ED has not been substantiated (15).
Trauma to the pelvic blood vessels and nerves is another potential factor in the development of ED. Bicycle riding for long periods has been implicated, so some of the newer bicycle seats have been designed to soften pressure on the perineum (the soft area between the anus and the scrotum). Certainly, history of pelvic bone fracture, as well as previous pelvic surgery (orthopedic, vascular, colon-rectum, and prostate) may result in injury to the arteries or nerves that go to the penis.
Psychosexual counselling, or sex therapy, is an appropriate recommendation especially for men who are experiencing discord with their partner especially if the conflict is related to the man’s ED. Counselling usually consists of 5–20 sessions with counsellor. It is our recommendation that referral doctors treating men with ED make a referral to a psychotherapist or sex therapist who is certified by AASECT (American Association of Sexuality Educators, Counselors and Therapists) of certified sexuality educator.43
There are risks to prosthetic surgery and patients are counselled before the procedure. If there is a post-operative infection, the implant will likely be removed. The devices are reliable, but in the case of mechanical malfunction, the device or a part of the device will need to be replaced surgically. If a penile prosthesis is removed, other non-surgical treatments may no longer work.
Usually there will not be a specific treatment that will lead to the improvement of erectile dysfunction. However, there are treatments that will allow erections to happen and can be used to allow sexual activity to take place. There are three main types of treatments: non-invasive treatments such as tablet medicines and external devices (e.g. vacuum device); penile injections; or for men who have not had success with other treatments, surgery may be an option.
A vacuum erection device is a plastic tube that slips over the penis, making a seal with the skin of the body. A pump at the other end of the tube makes a low-pressure vacuum around the erectile tissue, which results in an erection. An elastic ring is then slipped onto the base of the penis. This holds the blood in the penis (and keeps it hard) for up to 30 minutes. With proper training, 75 out of 100 men can get a working erection using a vacuum erection device.