I have found them to be fairly outgoing when kept by themselves, and on here people have said a 40 breeder is acceptable for a jack dempsey and this tank is fairly close to the size of a 40 breeder, so I think a jack dempsey will be fine in that tankThe 31x18x18 tank would only suffice as a growout tank for a JD. I consider a standard 75 an acceptable enclosure for a full grown JD.
moreover, JD are not desirable as a solo "wet pet" species ime. They are reclusive and nervous when kept on their own. They seem to exhibit much more character and personality when surrounded by lots of dithers or other smaller cichlids.