0
$\begingroup$

I have temperature T in terms of r as

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

and G in terms of r as

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

How can I plot G vs. T in Mathematica? Assume P = 1/(96π) or P = 0.01.

enter image description here

$\endgroup$
  • 5
    $\begingroup$ What have you tried so far and at which specific step did you get stuck? (Please edit the question and add this information.) $\endgroup$ – Szabolcs Jan 19 at 12:02
  • 1
    $\begingroup$ For P=1. Try: ContourPlot[ Evaluate@(Eliminate[{T == 1/(4*Pi*r) + 2*P*r^2, G == r/4 - 2 (Pi*P*r^3)/3}, r] /. P -> 1), {T, -1, 2}, {G, -1, 2}, FrameLabel -> Automatic, PlotPoints -> 50] $\endgroup$ – Mariusz Iwaniuk Jan 19 at 12:36
  • $\begingroup$ Can you please make it for given values. i need the same as above given in figure. $\endgroup$ – Ahmed 1 Jan 19 at 12:44
  • $\begingroup$ Szabolcs, kindly check now. $\endgroup$ – Ahmed 1 Jan 19 at 13:02
5
$\begingroup$

You want to use ParametricPlot and I recommend defining G and T as functions. Like so:

T[P_, r_] := 1/(4 π r) + 2 P r^2
G[P_, r_] := r/4 - 2 (π P r^3)/3
With[{p = 1./(96 π)},
  ParametricPlot[{T[p, r], G[p, r]}, {r, 0.00001, 2. π},
    AxesLabel -> (Style[#, 14, Bold] & /@ {"T", "G"}),
    AspectRatio -> 1]]

plot

$\endgroup$
  • $\begingroup$ How you give the value of {r, 0.00001, 2. π}? $\endgroup$ – Ahmed 1 Jan 19 at 16:18
  • $\begingroup$ @Ahmed1. There is a singularity at r = 0, so I offset the lower bound at little. The upper was chosen arbitrarily. $\endgroup$ – m_goldberg Jan 19 at 17:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.