Thanks for posting your query.
With the available described symptoms, there appears to possibility of heart arrhythmia
There appears to be least correlation between racing heart and gastric ulcer.
Heart Arrhythmia could be due to heart or due to hormonal
You should consult with internal medicine specialist/ cardiologist and should go for thorough check up.
You should go for electrocardiography
, electrophysiological studies of heart, 2 D echo.
If arrhythmia has been detected, then you have to take anti-arrhythmic medicines for control.
Sotalol also an anti-arrhythmic medicine and helps in control of racing heart rate
If all relevant investigations are normal, then you should consult with psychiatrist
There could also be possibility of panic attacks.
Dr. Mayank Bhargava