How can one plot Phase portrait on a torus or a cylinder?
Plot the phase portrait in the planar parameter space, say
$(u,v) \in [0,1] \times [0,1]$. Then use a parametrization of the surface
$(u,v) \mapsto (x,y,z)$ to map the 2D coordinates to 3D coordinates and change the head from Graphics to Graphics3D. Here is an example on StackExchange that takes advantage of StreamPlot:
If you have trouble with a particular differential equation, post it and the issues with it might be addressed. A parametrization
$(u,v) \mapsto (x,y,z)$ can sometimes distort things in a way that does not look good.
Very thank you for your reply but when I copy(Mathematica or Wolfram) this code, it does not work.
Please, could you help me?
Sure, I might be able to help. The code for both answers works for me. For the second answer, I had to copy the code for the functions prism and cyl from the link as directed in the answer. What code did you run? Did you get any error messages? Did the copied code have variable names that conflicted with any of your other code that you've run?
Very thank you, It is work no after I have used Wolfram language input. In the beginning, I have used Free form -input, it didn't work.
That is because I am a beginner to use Mathematica.
OH, I forgot to tell you, Also the last two code does not work.
You wrote, "It is work no after..": Did you mean, it is working now...? Because you later wrote, "the last two code does not work." So, it is not working? (If it is not working, then you will probably have to post the code you're running, because, as I said, it works for me when I paste it and hit shift-return.)
You may have a look at the CurvesGraphics package at http://www.dimi.uniud.it/gorni/Mma.