# How do I make 3D plot for T, G and P as a function of $r$?

I want to plot a 3D graph ('G' v/s 'P' v/s 'T') for folllowing value as 'T' in terms of r

T = 1/(4 Pi r) + 2 P r - 1/(4 Pi r^3),


'G' in terms of r

G = r/4 - (2 Pi P r^3))/3 + 3/(4 r).


and P in terms of r

P = T/r -1/(2 Pi r^2) + 2/(Pi r^4)


I want to plot for following range: {{G, 0.2, 1.8}, {P, 0, 0.004}, {T, 0, 0.06}}

• you can use P=T/r -1/(2 pi r^2) +2/(pi r^4) – Ahmed 1 Jan 19 at 20:03
• Please do not use the graphs-and-networks tag unless the question concerns graph-theoretical graphs. You can click a tag to read what it's for. Also: format your posts. There's formatting help on the right of the edit box. Your last post was formatted by a volunteer. You can use it as an example. – Szabolcs Jan 19 at 20:10
• Finally: you still didn't show what you have tried. Did you look at any tutorials on plotting with Mathematica? – Szabolcs Jan 19 at 20:10
• "ok, yes i am continously trying to plot" If you show what exactly you did, what your attempts so far were, then people can guide you to a solution. – Szabolcs Jan 19 at 21:09

Here is method for examining the relationship between P, T and G as functions of r. First we find the functions.

Clear[P, T, G]
{P[r_], T[r_], G[r_]} =
Solve[
{P == T/r - 1/(2 π r^2) + 2/(π r^4),
T == 1/(4 π r) + 2 P r - 1/(4 π r^3),
G == r/4 - (2 Pi P r^3)/3 + 3/(4 r)},
{P, T, G}][[1, All, 2]]


Then we make an interactive plot of the functions in the space {{P, 0, 0.004}, {T, 0, 0.06}}.

box =
Graphics3D[
{FaceForm[], EdgeForm[], Cuboid @@ Transpose[{{0, 0.004}, {0, 0.06}, {0.2, 1.8}}]},
Boxed -> False];
Manipulate[
Dynamic @
Show[
ParametricPlot3D[{P[r], T[r], G[r]}, {r, rmin, rmax},
AxesLabel -> (Style[#, 14, Bold] & /@ {"P", "T", "G"}),
BoxRatios -> 1],
box,
PlotRange -> All],
{rmin, .5, 15, .5, Appearance -> "Labeled"},
{rmax, 10, 50, 1, Appearance -> "Labeled"}]


Note: Although the above code give us reasonable control over the range or P and T, the range of G cannot be fixed because it is determined by the settings for rain and max.

ClearAll[T, P, G, t, p, g]

t = 1/(4 Pi r) + 2 P r - 1/(4 Pi r^3);
p = T/r - 1/(2 Pi r^2) + 2/(Pi r^4);
g = r/4 - (2 Pi P r^3)/3 + 3/(4 r);

func = {G, p, T} /. Solve[Eliminate[{T == t, P == p, G == g}, P], {G, T}, Reals][[1]];


{(23 + r^2)/(12 r),
2/(π r^4) - 1/(2 π r^2) + (-15 + 3 r^2)/( 4 π r^4),
(-15 + 3 r^2)/(4 π r^3)}

Quiet @ ParametricPlot3D[func, {r, 0, 10 Pi},
PlotRange -> {{0.2, 1.8}, {0, 0.004}, {0, 0.06}}, BoxRatios -> 1]