Re: Solving differential equations in Mathematica 7.0
- To: mathgroup at smc.vnet.net
- Subject: [mg108661] Re: Solving differential equations in Mathematica 7.0
- From: Wei-Li Tan <deathanubis at hotmail.com>
- Date: Fri, 26 Mar 2010 05:37:35 -0500 (EST)
- References: <hocm9d$shg$1@smc.vnet.net>
On 3=E6=9C=8824=E6=97=A5, =E4=B8=8B=E5=8D=885=E6=99=8233=E5=88=86, Wei-Li T= an <deathanu... at hotmail.com> wrote: > Hi,all: > Here is the code I want to solve the equation > > Eqn1 := f2*(D[z[x], {x, 1}])^2 + f1*(D[z[x], {x, 2}]) + P*(D[y[x], > {x, 2}]) + Psoil; > Eqn2 := z[x] - (D[y[x], {x, 2}]); > > sol = NDSolve[{Eqn1 == 0, Eqn2 == 0, y[0] == disp, y'[0] == 0, y[L] > == 0, y'[L] == 0}, {z, y}, {x, 0, L}, > MaxSteps -> Infinity, AccuracyGoal -> 10, StartingStepSize -> 0.001, MaxStepSize -> 0.005, > > MaxStepFraction -> 0.001] > > f1,f2 are the function of z[x]; Psoil is the function of > y[x];P,L,disp are constant. > > and theMathematicareturn me the message: > > NDSolve::ndsz: At x ==x1, step size is effectively zero; singularity > or stiff system suspected. > FindRoot::cvmit: Failed to converge to the requested accuracy or > precision within 100 iterations. > NDSolve::berr: There are significant errors {xi} in the boundary > value residuals.Returning the best solution found. > > {{z -> InterpolatingFunction[{{0.,25}}, <>], y -> > InterpolatingFunction[{{0.,25}}, <>]}} > > How should I do to debug the code and find the correct solution. > Any help on this matter will be greatly appreciated. > Thanks This is my code, when I use the smaller "disp"(like 0.001), the program can be successfully implemented, but when I put "disp" transfer large(like 0.02), the program will appear above error. d = 0.61; L = 25; EIe = 6.022*10^4; a = 10^-6; b = 3; Zy = 0.008; P = 1000; f1=EIe*(a-(a-1)*(((z[x]/Zy)^b)+1)^(-(b+1)/b)); f2=(EIe*(a-1)*(b+1)*((((z[x]/Zy)^b)+1)^(-2-(1/b))) *((z[x]/Zy)^b))/z[x]; r=17.5; Su = 40 ; J = 0.5; Pu = Min[(3 + r*x /Su + J* x/d)*Su*d, 9*Su*d]; Psoil = y[x]/(1/2956.5 + y[x]/Pu); disp=0.02; Eqn1 := f2*(D[z[x], {x, 1}])^2 + f1*(D[z[x], {x, 2}]) +P*(D[y[x],{x, 2}]) + Psoil; Eqn2 := z[x] - (D[y[x], {x, 2}]); sol = NDSolve[{Eqn1 == 0, Eqn2 == 0, y[0] == disp, y'[0] == = 0, y[L] == 0, y'[L] == 0}, {z, y}, {x, 0, L}, MaxSteps -> Infinity, AccuracyGoal -> 10, StartingStepSize -> 0.001, MaxStepSize -> 0.005,MaxStepFraction -> 0.001] Thank you for help.