-1

I am using the following code to find iteratively the functions $\Sigma(r)$, $h(r)$ and $T(r)$

ClearAll["Global`*"]
Md = 10^(-9); 
P = 10; 
R = 10^4; 
α = 10^(-2); 
ϵ = 10^(-4); 
γ = 10^(-2); 
ke = 0.02*(1 + 0.6625); 
k0 = 5*10^20; 
σ = 5.67/10^8; 
Rg = 8315; 
c = 3*10^8; 
G = 6.67/10^11; 
M = 2.8*10^30; 
Ωk[r_] := Sqrt[(G*M)/r^3]; 
μ = Md/(3*Pi); 
κ = ((27*ke)/(2*σ))*(Rg/μ); 
Co[r_] := 1; 
β[r_] := 0; 
Do[Σ[r_] := (μ^(3/5)*Ωk[ r]^(2/5))(κ^5^(-1)*α^(4/5)*Co[r]^5^(-1)); 
 h[r_] := (κ*α*Σ[r]* Co[r])/Ωk[r]^5; 
 T[r_] := (1/2)*Ωk[r]* h[r]^2*(μ/Rg)*(1/(1 + β[r])); 
 Kkr[r_] := (k0*(Σ[r]/h[r]))/T[r]^(7/2); 
 β[r_] := (μ/Rg)*((4*σ)/(3*c))*(T[r]^3/(Σ[r]/h[r])); 
 Co[r_] := (1 + β[r])^4*(1 + Kkr[r]/ke), {2}]

 Plot[Σ[r],{r,10^4, 10^10}]

 Plot[h[r],{r,10^4, 10^10}]

 Plot[T[r],{r,10^4, 10^10}]

The problem is that the last line Co[r_] := (1 + β[r])^4*(1 + Kkr[r]/ke) makes the kernel crash and I don't understand why.

I am using version 10.0.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
mattiav27
  • 6,677
  • 3
  • 28
  • 64
  • I can't reproduce the crash using Mathematica 10.0.2 on macOS 2. Always upgrade to the latest point release, meaning that you should be using 10.0.2 and not 10.0.0 or 10.0.1 (you didn't indicate this) 3. Your code literally does not do anything. Only SetDelayed is present in Do, so it does not even matter how many iterations there are, nothing will change. See https://mathematica.stackexchange.com/questions/8829/what-is-the-difference-between-set-and-setdelayed
  • – Szabolcs Jan 31 '19 at 10:59
  • @Szabolcs the code is supposed to plot the functions, I forgot to add these lines. – mattiav27 Jan 31 '19 at 11:01
  • @mattiav27 We can build an iterative process, but it's not clear what you want to calculate. – Alex Trounev Jan 31 '19 at 14:34
  • @AlexTrounev see my other question https://mathematica.stackexchange.com/q/190574/8822 – mattiav27 Jan 31 '19 at 14:49