In many cases, diagnosing erectile dysfunction requires little more than a physical exam and a review of your symptoms. If your doctor suspects that an underlying health problem may be at play, however, he may request additional testing. Once you’ve determined the cause for your ED, you and your doctor can decide on a form of treatment – here are some of the options:
Erections are neurovascular events, meaning that nerves and blood vessels (arteries and veins) are involved in the process of an erection and all must work properly to develop a hard erection that lasts long enough. Erection begins with sexual stimulation. Sexual stimulation can be tactile (for example, by a partner touching the penis or by masturbation) or mental (for example, by having sexual fantasies, viewing porn). Sexual stimulation or sexual arousal causes the nerves going to the penis to release a chemical, nitric oxide. Nitric oxide increases the production of another chemical, cyclic GMP (cGMP), in the muscle of the corpora cavernosa. The cGMP causes the muscles of the corpora cavernosa to relax, and this allows more blood to flow into the penis. The incoming blood fills the corpora cavernosa, making the penis expand.
A semi-firm penis if correctly handled can give a somewhat pleasant orgasm. I really don't think there is such a thing as an unpleasant orgasm though. I have have ED for two years. It has been than long since I had sex with my wife in her vagina. There has been plenty of oral sex for her. The ED drugs do not work with me. I take injectable Testosterone, and that does not make a big difference. About twice a month I am able to masturbate. Hey I am glad to know it still works. Next week I am going to see urologist number 2. The first one was a jerk and basically wrote me off because of my age. Now I have read about the Viberect device and the NEW pudendal artery (to the penis). There is hope, but in the mean time I will masturbate as often as I can.
The nerves and endothelium of sinusoids and vessels in the penis produce and release transmitters and modulators that control the contractile state of corporal smooth muscles. Although the membrane receptors play an important role, downstream signaling pathways are also important. The RhoA–Rho kinase pathway is involved in the regulation of cavernosal smooth muscle contraction. 
In other cases, men who habitually use alcohol or other drugs may experience similar results. Alcohol is a depressant to the central nervous system. This means that a little bit might be able to lighten the mood, but too much can basically shut down all communication between the brain and the penis. When this happens, no amount of will or stimulation will result in an erection. Other drugs can also affect the body’s ability to achieve an erection, including heroin and MDMA, otherwise known as ecstasy.
Stress is another factor that can be a cause or effect of ED. If you're stressed at work, at home, and in your relationships, it's going to take a toll on your sexual function. Your mind is elsewhere, and relaxing when you finally make it between the sheets is a long shot. Now you’re stressed because you can’t get it up (talk about the ultimate catch-22), so you're stuck in this sad, frustrating cycle. “ED really affects the psyche of a guy, regardless of the etiology, Gittens says. “If you have a problem getting an erection one night, you’re probably going to be anxious and worried your partner might see you as less of a man the next time you try to get an erection.” There's a pill that will help with this, and it's not promoted on television with middle-aged men in sports cars. It's a damn chill pill.