Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'NDsolve and Piecewise' topicStudent Support Forum > General > Archives > "NDsolve and Piecewise"

Next Comment >Help | Reply To Topic
Author Comment/Response
Francesco
03/02/13 1:16pm

Dear All,
I am having some problems trying to use the solution to NDsolve in the Piecewise function.

I am solving the following system of coupled ODEs (it looks horrible but it works):

s = NDSolve[{x'[z] ==
0.3513*(T[z]*10^(-4))^(-0.6166)/(1 + 0.6703*(T[z]*10^(-4))^(0.53))*(1 +z)^(-2.5)*(0.206*(1 + z)^3*x[z]^2 - 2.415*10^(21)*T[z]^(1.5)*Exp[-1.578*10^5/T[z]] (1 - x[z]))/(1 + 8*10^7*(10^(-4)*T[z])^(0.7)*Exp[-3.95*10^4/T[z]]) - 7.7* Exp[-(1.195/8.5)^2*(1 + z)^2]*(1 - x[z]),
(1 + z)*T'[z] == 2*T[z] -
0.022*(1 + z)^(2.5)*x[z] /(1.08 + x[z])*(2.728*(1 + z) - T[z]) -
5.23*10^6*0.1*(1 - (1 - x[z]^0.2663)^1.3163)*(1 + z)*1.348/8.5*
Exp[-(1.195/8.5)^2*(1 + z)^2],
T[1800] == 4914, x[1800] == 1}, {T, x} , {z, 7, 1800}]

As the system fails to integrate at small z, but I know x must equal 1, I am the trying to define:
xx[z_] := Piecewise[{{1, z < 10}, {x[z] /. s, z > 10}}]
Plot[xx[z], {z, 0, 30}]

But it does not plot anything... Any suggestions

URL: ,

Subject (listing for 'NDsolve and Piecewise')
Author Date Posted
NDsolve and Piecewise Francesco 03/02/13 1:16pm
Re: NDsolve and Piecewise yehuda 03/02/13 5:19pm
Re: NDsolve and Piecewise Bill Simpson 03/02/13 8:38pm
Re: NDsolve and Piecewise Peter Pein 03/03/13 02:23am
Next Comment >Help | Reply To Topic