How do I set the size of the image using psconvert

I am creating a map that is showing the solar terminators on a given day and time. The image gets created. However I can not control the size of the jpg. I want to make the final image 512x256. Looking at gmt’s man pages on the convert line I need A+S[width/height]. I am very new to gmt so some of this is difficult for me to understand.
gmt pscoast -Rd -JQ0/5.12 -W.1,0/100/0 -G0/100/0 -S177/224/230 --PROJ_LENGTH_UNIT=i -Dc -A5000 -K -Xc > $ps2
gmt pssolar -R -J -Td+d$d -G$c@50 -K -O >> $ps2
gmt pssolar -R -J -Tc+d$d -G$c@60 -K -O >> $ps2
gmt pssolar -R -J -Tn+d$d -G$c@70 -K -O >> $ps2
gmt pssolar -R -J -Ta+d$d -G$c@80 -O >> $ps2
gmt psconvert -A+s2c -Tj $ps2

You could try something like:

gmt pscoast -X10p -Y10p -Rd -JQ0/450p -W.1,0/100/0 -G0/100/0 -S177/224/230 -Dc -A5000 --PS_MEDIA=512x256 --PS_PAGE_ORIENTATION=portrait >
gmt psconvert -Tj -E72
identify test.jpg
test.jpg JPEG 512x256 512x256+0+0 8-bit sRGB 26916B 0.000u 0:00.000

And adapt the parameters to your case.

Thank you for the help. Your solution works. A few hours after the post I figured out a solution as well. Adjust the convert line of my original code to gmt psconvert -A+s4.33c -Tj $ps2;. I am very new to gmt and am learning on the fly so a lot of the documentation doesn’t make a lot of sense to me. Thank you again.