-5

Parameters

gamma = 7.16*10^-12;
mu = 2.15*10^-3;
kappa = 28.55*10^-5;
rho = 1.80*10^3;

The system of the differential equations

 soln1 = 
   NDSolve[
     {(mu + kappa) u''[r] + u'[r]/r - 2 kappa w'[r] == 0, 
      gamma w''[r] + w'[r]/r + 2 kappa u'[r] + u[r]/r - 4 kappa w[r] == 0,
      p'[r] == rho u[r]^2 /2, 
      u[0] == 0, u[1] == 1, w[0] == 0, w[1] == 1, p[0] == 0}, 
     {u, w, p}, {r, 0, 1}];`

Plotting

u = u[r] /. soln1;
w = w[r] /. soln1;
p = p[r] /. soln1;
Plot[{u}, {r, 0, 1}, 
  LabelStyle -> 20, 
  Frame -> True, 
  FrameLabel -> {{" u", "  "}, {" r", " "}}, 
  PlotStyle -> Black]
m_goldberg
  • 107,779
  • 16
  • 103
  • 257

1 Answers1

0

You have two problems.

  1. Your system of ODE is ill posed and can not be solved.
  2. Your code for extracting the solutions for plotting is bad. The recursion errors you are getting come from trying to assign solutions to the variable names you used in the system.

Assuming you correct your equations and boundary values so that you actually get a solution, you can safely extract the interpolating functions representing the solution and plot them as follows:

{uF, wF, pF} = soln1[[1, All, 2]];
Plot[[{uF[r], wF[r], pF[r]}, {r, 0, 1}]
m_goldberg
  • 107,779
  • 16
  • 103
  • 257