# Scaling the X axis in numerical solution

I Have numerically solved these two coupled equations, but I need to know how to scale the x-axis in the plot by a factor of (1/20)

pde1 = -y1''[x] - (2*y1'[x])/x + ((y1[x])^3 + y2[x])y1[x] == 0;
pde2 = y2''[x] + (2y2'[x])/x - (y1[x])^3 == 0;
sol = NDSolve[ {pde1, pde2, y1[20] == 0.001, y2[20] == -0.001,
y1'[0.001] == 0.001, y2'[0.001] == 0.001}, {y1, y2}, {x,0.001, 20}]


I have $$x=(1/20)\tilde{x}$$ I need to plot $$y1(\tilde{x})$$

• Do you mean something like this? p1 = Plot[Evaluate[y1[x] /. sol], {x, 0.001, 20}, PlotRange -> All]; p2 = Plot[Evaluate[y1[x] /. sol], {x, 0.001, 20}, PlotRange -> All, AspectRatio -> 20]; Grid[{{p1, p2}}] screen shot !Mathematica graphics or do you mean something else? May 14, 2023 at 7:43
• I mean in my equations I have $x=(1/20)\tilde{x}$ I need to plot $y1(\tilde{x})$ May 14, 2023 at 19:18

have x=(1/20)x~ I need to plot y1(x~)

Ok, so $$\hat{x} = 20 x$$, right? So why not plot $$y_1(20 x)$$? Like this (You need to also scale the range at same time)

pde1 = -y1''[x] - (2*y1'[x])/x + ((y1[x])^3 + y2[x]) y1[x] == 0;
pde2 = y2''[x] + (2 y2'[x])/x - (y1[x])^3 == 0;
sol = NDSolve[{pde1, pde2, y1[20] == 0.001, y2[20] == -0.001,
y1'[0.001] == 0.001, y2'[0.001] == 0.001}, {y1, y2}, {x, 0.001, 20}]


p1 = Plot[Evaluate[y1[x] /. sol], {x, 0.001, 20}, PlotRange -> All]

scale = 1/20;