Thanks for using "Ask The Doctor" for posting your query.
If its occasional and not a regular erectile dysfunction then its unlikely that there is any physical problem. Your penis should be alright. Occasional erectile dysfunction has psychological reasons and it has something to do with the relationship issues with your partner and your state of mind. This will require a detailed psychological evaluation of your relationship with your partner.
Do meet your doctor and get a referral to a clinical psychologist.
Hope this helps,
Wish you a good health.
These Q&A’s are for educational purposes and should not be relied upon as a substitute for medical advice you may receive from your physician. If you have a medical emergency, please call 911. These answers do not constitute or initiate a patient/doctor relationship.