I think all of the responses so far are good, but I would like to offer a slightly different perspective. It is entirely possible that what you are experiencing is predominately psychological, a result of burnout, overconsumption of porn, etc. Nevertheless, I think it needs to be maintained that there is such a thing as organic, physiological erectile dysfunction, and it is not necessarily a product of age or disease. Also, erectile dysfunction needs to be thought of as lying on a spectrum and not a binary. It\'s too simplistic to say that one either has ED or not, or that all manifestations will mean the same thing or point to the same underlying causes. The trouble is that almost no one who has some kind of ED will not also have, at the very least, a corresponding psychological issue. This does not mean, then, that the psychologically associated difficulties are the primary cause.
What many people do not take into consideration is that the size, appearance, and functioning of penises is largely(ha) determined genetically. People often use the plumbing metaphor to think of erectile health. It\'s a matter of tubes supplying blood, so as long as the tubes are clean and the blood is flowing, dicks are hard and all is well. What is overlooked is the health of erectile tissue itself. The healthy tissue of the cavernosa expands rapidly and pinches off an extremely intricate network of veins that carry blood out of the penis and back towards the
. If this tissue is in an any way compromised, ie is fibrotic, then the expansion and shunting process will be impaired. Now the condition of the erectile tissue and the venous system that filters blood out of the penis is mostly determined, as I mentioned before, at the genetic level. Saying this is not saying that, at the same time, lifestyle does not play a major role, and that your functioning can\'t be improved by certain healthy habits. This is to say, nevertheless, that it can actually be helpful to think of it the way we think of many other organic disorders: you can be genetically predisposed to certain degenerative processes that set in with a pace and severity that depend on the specific genetic endowment that makes up an individual. So some men can live their whole lives and never experience ED, and others are pretty much born with it in one stroke(ha again). Sometimes tissue degeneration sets in in a man\'s twenties, or thirties, or much later.
I\'m saying all of this to in some way corroborate what others have said here, and to provide a little background information on my interpretation (very loose, I\'m an artist and not a doctor or scientist) of what could be happening. Maybe you are genetically predisposed to losing some functioning around this time in your life. You are by no means alone in this; it doesn\'t necessarily mean that something else is wrong physically or psychologically, though it certainly could mean that. Not every man is hard all the time, whenever he wants, and just because he isn\'t, it doesn\'t mean that there is another issue. It often does mean that, but it needs to be pointed out that more location specific disorders are possible, though they might not be common.