Giulianot

25 Reputation

2 Badges

9 years, 1 days

MaplePrimes Activity


These are replies submitted by Giulianot

@vv it's going to work for sure. but i was waiting for maple to do it directly without needing to list a sequence and stuff like that, you know...and it seems strange to me that it worked for single integrals, but not for double ones. also expression even return an answer to me when im asking for an specific time, but plotting doesn't work.

@vv isn't there a way to do it directly with the expressions? I have done this before using simple (single) integration....it worked perfectly. Now i'm trying with double ones, i get nothing. Maybe a maple's bug?

@Kitonum this is not an space curve...the three x's are three different displacements, the only variable for each one there is t2. I have manually set t2 for the first expression to 1/3 sec and it gave me a solution. However, if try to plot the same for t2 from 0 to 1/3, doesn't return nothing. So i think it should be a way to plot double or triple integrals...

@tomleslie i could solve the problem at the end. i found another mistake: it was -4<=(4000 `Q`)/(Pi `D`^(2))<=4, a conversion mistake. SolveEquation command is just amazing, i downloaded the Direct search package from somewhere, and just found how to work with it. it looks pretty superior to fsolve, i think maple should update the fsolve command using this method (i have no idea which, either how it works). at the end i just assumed each one of D's and solved a 10x10 system for the Q's. it worked perfectly well. i could bet taking -4<=(4000 `Q`)/(Pi `D`^(2))<=4 as restrictions on SolveEquation had solved the matter too.aceitoso.mw

@Carl Love sorry about that, im just a "noob" using maple. In fact, i have not coursed any class about it, and im not a programmer either. Just a guy who thinks maple is awesome and learning by myself... so that's why i did it. But im going to try to remove output next time before posting, thanks.

@tomleslie last equations are not equations itself, they are rather restrictions, so i need velocity to be between 0 and 4. im not sure if there is a way to solve the problem with ecuations and inequalities on it, working with -4<= 4 Qi/pi Di^2 <=4. i uploaded a new file and wrote the inequalities or restrictions in the fsolve command, 10 equations and 10 inequalities... i also modified the Re numbers with an absolute value, although all solutions got before were positive, maybe there is a solution with a negative Q and maple cant find it because of the Re numbers being negative... thanks for your help aceitoso.mw
 

nu := 6.1795*10^(-5)

0.6179500000e-4

(1)

varepsilon := 0.46e-1

0.46e-1

(2)

L__1 := 10.

10.

(3)

L__2 := 15.

15.

(4)

L__3 := 10.

10.

(5)

L__4 := 5*sqrt(2.)

7.071067810

(6)

L__5 := 6.

6.

(7)

L__6 := 6.

6.

(8)

L__7 := 20*sqrt(3.)*(1/3)

11.54700539

(9)

L__8 := 15.

15.

(10)

L__9 := 15.

15.

(11)

L__10 := 20.

20.

(12)

Re1 := 4*abs(Q__1)/(Pi*D__1*nu)

20604.24864*abs(Q__1)/D__1

(13)

Re2 := 4*abs(Q__2)/(Pi*D__2*nu)

20604.24864*abs(Q__2)/D__2

(14)

Re3 := 4*abs(Q__3)/(Pi*D__3*nu)

20604.24864*abs(Q__3)/D__3

(15)

Re4 := 4*abs(Q__4)/(Pi*D__4*nu)

20604.24864*abs(Q__4)/D__4

(16)

Re5 := 4*abs(Q__5)/(Pi*D__5*nu)

20604.24864*abs(Q__5)/D__5

(17)

Re6 := 4*abs(Q__6)/(Pi*D__6*nu)

20604.24864*abs(Q__6)/D__6

(18)

Re7 := 4*abs(Q__7)/(Pi*D__7*nu)

20604.24864*abs(Q__7)/D__7

(19)

Re8 := 4*abs(Q__8)/(Pi*D__8*nu)

20604.24864*abs(Q__8)/D__8

(20)

Re9 := 4*abs(Q__9)/(Pi*D__9*nu)

20604.24864*abs(Q__9)/D__9

(21)

Re10 := 4*abs(Q__10)/(Pi*D__10*nu)

20604.24864*abs(Q__10)/D__10

(22)

A__1 := (2.457*ln(1/((7/Re1)^.9+.27*varepsilon/D__1)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__1/abs(Q__1))^.9+0.1242e-1/D__1))^16

(23)

A__2 := (2.457*ln(1/((7/Re2)^.9+.27*varepsilon/D__2)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__2/abs(Q__2))^.9+0.1242e-1/D__2))^16

(24)

A__3 := (2.457*ln(1/((7/Re3)^.9+.27*varepsilon/D__3)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__3/abs(Q__3))^.9+0.1242e-1/D__3))^16

(25)

A__4 := (2.457*ln(1/((7/Re4)^.9+.27*varepsilon/D__4)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__4/abs(Q__4))^.9+0.1242e-1/D__4))^16

(26)

A__5 := (2.457*ln(1/((7/Re5)^.9+.27*varepsilon/D__5)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__5/abs(Q__5))^.9+0.1242e-1/D__5))^16

(27)

A__6 := (2.457*ln(1/((7/Re6)^.9+.27*varepsilon/D__6)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__6/abs(Q__6))^.9+0.1242e-1/D__6))^16

(28)

A__7 := (2.457*ln(1/((7/Re7)^.9+.27*varepsilon/D__7)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__7/abs(Q__7))^.9+0.1242e-1/D__7))^16

(29)

A__8 := (2.457*ln(1/((7/Re8)^.9+.27*varepsilon/D__8)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__8/abs(Q__8))^.9+0.1242e-1/D__8))^16

(30)

A__9 := (2.457*ln(1/((7/Re9)^.9+.27*varepsilon/D__9)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__9/abs(Q__9))^.9+0.1242e-1/D__9))^16

(31)

A__10 := (2.457*ln(1/((7/Re10)^.9+.27*varepsilon/D__10)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__10/abs(Q__10))^.9+0.1242e-1/D__10))^16

(32)

B__1 := (37530/Re1)^16

14680.75929*D__1^16/abs(Q__1)^16

(33)

B__2 := (37530/Re2)^16

14680.75929*D__2^16/abs(Q__2)^16

(34)

B__3 := (37530/Re3)^16

14680.75929*D__3^16/abs(Q__3)^16

(35)

B__4 := (37530/Re4)^16

14680.75929*D__4^16/abs(Q__4)^16

(36)

B__5 := (37530/Re5)^16

14680.75929*D__5^16/abs(Q__5)^16

(37)

B__6 := (37530/Re6)^16

14680.75929*D__6^16/abs(Q__6)^16

(38)

B__7 := (37530/Re7)^16

14680.75929*D__7^16/abs(Q__7)^16

(39)

B__8 := (37530/Re8)^16

14680.75929*D__8^16/abs(Q__8)^16

(40)

B__9 := (37530/Re9)^16

14680.75929*D__9^16/abs(Q__9)^16

(41)

B__10 := (37530/Re10)^16

14680.75929*D__10^16/abs(Q__10)^16

(42)

f__1 := 8*((8/Re1)^12+1/(A__1+B__1)^1.5)^(1/12)

8*(0.1173811769e-40*D__1^12/abs(Q__1)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__1/abs(Q__1))^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/abs(Q__1)^16)^1.5)^(1/12)

(43)

f__2 := 8*((8/Re2)^12+1/(A__2+B__2)^1.5)^(1/12)

8*(0.1173811769e-40*D__2^12/abs(Q__2)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__2/abs(Q__2))^.9+0.1242e-1/D__2))^16+14680.75929*D__2^16/abs(Q__2)^16)^1.5)^(1/12)

(44)

f__3 := 8*((8/Re3)^12+1/(A__3+B__3)^1.5)^(1/12)

8*(0.1173811769e-40*D__3^12/abs(Q__3)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__3/abs(Q__3))^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/abs(Q__3)^16)^1.5)^(1/12)

(45)

f__4 := 8*((8/Re4)^12+1/(A__4+B__4)^1.5)^(1/12)

8*(0.1173811769e-40*D__4^12/abs(Q__4)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__4/abs(Q__4))^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/abs(Q__4)^16)^1.5)^(1/12)

(46)

f__5 := 8*((8/Re5)^12+1/(A__5+B__5)^1.5)^(1/12)

8*(0.1173811769e-40*D__5^12/abs(Q__5)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__5/abs(Q__5))^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/abs(Q__5)^16)^1.5)^(1/12)

(47)

f__6 := 8*((8/Re6)^12+1/(A__6+B__6)^1.5)^(1/12)

8*(0.1173811769e-40*D__6^12/abs(Q__6)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__6/abs(Q__6))^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/abs(Q__6)^16)^1.5)^(1/12)

(48)

f__7 := 8*((8/Re7)^12+1/(A__7+B__7)^1.5)^(1/12)

8*(0.1173811769e-40*D__7^12/abs(Q__7)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__7/abs(Q__7))^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/abs(Q__7)^16)^1.5)^(1/12)

(49)

f__8 := 8*((8/Re8)^12+1/(A__8+B__8)^1.5)^(1/12)

8*(0.1173811769e-40*D__8^12/abs(Q__8)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__8/abs(Q__8))^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/abs(Q__8)^16)^1.5)^(1/12)

(50)

f__9 := 8*((8/Re9)^12+1/(A__9+B__9)^1.5)^(1/12)

8*(0.1173811769e-40*D__9^12/abs(Q__9)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__9/abs(Q__9))^.9+0.1242e-1/D__9))^16+14680.75929*D__9^16/abs(Q__9)^16)^1.5)^(1/12)

(51)

f__10 := 8*((8/Re10)^12+1/(A__10+B__10)^1.5)^(1/12)

8*(0.1173811769e-40*D__10^12/abs(Q__10)^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__10/abs(Q__10))^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/abs(Q__10)^16)^1.5)^(1/12)

(52)

H__1 := piecewise(Q__1 > 0, 8000*10^6*f__1*L__1*Q__1^2/((9.8*(Pi^2))*D__1^5), -8000*10^6*f__1*L__1*Q__1^2/((9.8*(Pi^2))*D__1^5))

piecewise(0 < `#msub(mi("Q"),mi("1"))`, 6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^12/abs(`#msub(mi("Q"),mi("1"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("1"))`/abs(`#msub(mi("Q"),mi("1"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("1"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^16/abs(`#msub(mi("Q"),mi("1"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("1"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("1"))`^5, -6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^12/abs(`#msub(mi("Q"),mi("1"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("1"))`/abs(`#msub(mi("Q"),mi("1"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("1"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^16/abs(`#msub(mi("Q"),mi("1"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("1"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("1"))`^5)

(53)

H__2 := piecewise(Q__2 > 0, 8000*10^6*f__2*L__2*Q__2^2/((9.8*(Pi^2))*D__2^5), -8000*10^6*f__2*L__2*Q__2^2/((9.8*(Pi^2))*D__2^5))

piecewise(0 < `#msub(mi("Q"),mi("2"))`, 9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("2"))`^12/abs(`#msub(mi("Q"),mi("2"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("2"))`/abs(`#msub(mi("Q"),mi("2"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("2"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("2"))`^16/abs(`#msub(mi("Q"),mi("2"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("2"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("2"))`^5, -9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("2"))`^12/abs(`#msub(mi("Q"),mi("2"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("2"))`/abs(`#msub(mi("Q"),mi("2"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("2"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("2"))`^16/abs(`#msub(mi("Q"),mi("2"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("2"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("2"))`^5)

(54)

H__3 := piecewise(Q__3 > 0, 8000*10^6*f__3*L__3*Q__3^2/((9.8*(Pi^2))*D__3^5), -8000*10^6*f__3*L__3*Q__3^2/((9.8*(Pi^2))*D__3^5))

piecewise(0 < `#msub(mi("Q"),mi("3"))`, 6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^12/abs(`#msub(mi("Q"),mi("3"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("3"))`/abs(`#msub(mi("Q"),mi("3"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("3"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^16/abs(`#msub(mi("Q"),mi("3"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("3"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("3"))`^5, -6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^12/abs(`#msub(mi("Q"),mi("3"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("3"))`/abs(`#msub(mi("Q"),mi("3"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("3"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^16/abs(`#msub(mi("Q"),mi("3"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("3"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("3"))`^5)

(55)

H__4 := piecewise(Q__4 > 0, 8000*10^6*f__4*L__4*Q__4^2/((9.8*(Pi^2))*D__4^5), -8000*10^6*f__4*L__4*Q__4^2/((9.8*(Pi^2))*D__4^5))

piecewise(0 < `#msub(mi("Q"),mi("4"))`, 4.678850351*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^12/abs(`#msub(mi("Q"),mi("4"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("4"))`/abs(`#msub(mi("Q"),mi("4"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("4"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^16/abs(`#msub(mi("Q"),mi("4"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("4"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("4"))`^5, -4.678850351*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^12/abs(`#msub(mi("Q"),mi("4"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("4"))`/abs(`#msub(mi("Q"),mi("4"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("4"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^16/abs(`#msub(mi("Q"),mi("4"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("4"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("4"))`^5)

(56)

H__5 := piecewise(Q__5 > 0, 8000*10^6*f__5*L__5*Q__5^2/((9.8*(Pi^2))*D__5^5), -8000*10^6*f__5*L__5*Q__5^2/((9.8*(Pi^2))*D__5^5))

piecewise(0 < `#msub(mi("Q"),mi("5"))`, 3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^12/abs(`#msub(mi("Q"),mi("5"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("5"))`/abs(`#msub(mi("Q"),mi("5"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("5"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^16/abs(`#msub(mi("Q"),mi("5"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("5"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("5"))`^5, -3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^12/abs(`#msub(mi("Q"),mi("5"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("5"))`/abs(`#msub(mi("Q"),mi("5"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("5"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^16/abs(`#msub(mi("Q"),mi("5"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("5"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("5"))`^5)

(57)

H__6 := piecewise(Q__6 > 0, 8000*10^6*f__6*L__6*Q__6^2/((9.8*(Pi^2))*D__6^5), -8000*10^6*f__6*L__6*Q__6^2/((9.8*(Pi^2))*D__6^5))

piecewise(0 < `#msub(mi("Q"),mi("6"))`, 3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^12/abs(`#msub(mi("Q"),mi("6"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("6"))`/abs(`#msub(mi("Q"),mi("6"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("6"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^16/abs(`#msub(mi("Q"),mi("6"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("6"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("6"))`^5, -3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^12/abs(`#msub(mi("Q"),mi("6"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("6"))`/abs(`#msub(mi("Q"),mi("6"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("6"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^16/abs(`#msub(mi("Q"),mi("6"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("6"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("6"))`^5)

(58)

H__7 := piecewise(Q__7 > 0, 8000*10^6*f__7*L__7*Q__7^2/((9.8*(Pi^2))*D__7^5), -8000*10^6*f__7*L__7*Q__7^2/((9.8*(Pi^2))*D__7^5))

piecewise(0 < `#msub(mi("Q"),mi("7"))`, 7.640530634*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^12/abs(`#msub(mi("Q"),mi("7"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("7"))`/abs(`#msub(mi("Q"),mi("7"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("7"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^16/abs(`#msub(mi("Q"),mi("7"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("7"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("7"))`^5, -7.640530634*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^12/abs(`#msub(mi("Q"),mi("7"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("7"))`/abs(`#msub(mi("Q"),mi("7"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("7"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^16/abs(`#msub(mi("Q"),mi("7"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("7"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("7"))`^5)

(59)

H__8 := piecewise(Q__8 > 0, 8000*10^6*f__8*L__8*Q__8^2/((9.8*(Pi^2))*D__8^5), -8000*10^6*f__8*L__8*Q__8^2/((9.8*(Pi^2))*D__8^5))

piecewise(0 < `#msub(mi("Q"),mi("8"))`, 9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^12/abs(`#msub(mi("Q"),mi("8"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("8"))`/abs(`#msub(mi("Q"),mi("8"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("8"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^16/abs(`#msub(mi("Q"),mi("8"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("8"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("8"))`^5, -9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^12/abs(`#msub(mi("Q"),mi("8"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("8"))`/abs(`#msub(mi("Q"),mi("8"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("8"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^16/abs(`#msub(mi("Q"),mi("8"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("8"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("8"))`^5)

(60)

H__9 := piecewise(Q__9 > 0, 8000*10^6*f__9*L__9*Q__9^2/((9.8*(Pi^2))*D__9^5), -8000*10^6*f__9*L__9*Q__9^2/((9.8*(Pi^2))*D__9^5))

piecewise(0 < `#msub(mi("Q"),mi("9"))`, 9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("9"))`^12/abs(`#msub(mi("Q"),mi("9"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("9"))`/abs(`#msub(mi("Q"),mi("9"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("9"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("9"))`^16/abs(`#msub(mi("Q"),mi("9"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("9"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("9"))`^5, -9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("9"))`^12/abs(`#msub(mi("Q"),mi("9"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("9"))`/abs(`#msub(mi("Q"),mi("9"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("9"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("9"))`^16/abs(`#msub(mi("Q"),mi("9"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("9"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("9"))`^5)

(61)

H__10 := piecewise(Q__10 > 0, 8000*10^6*f__10*L__10*Q__10^2/((9.8*(Pi^2))*D__10^5), -8000*10^6*f__10*L__10*Q__10^2/((9.8*(Pi^2))*D__10^5))

piecewise(0 < `#msub(mi("Q"),mi("10"))`, 1.323378725*10^10*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^12/abs(`#msub(mi("Q"),mi("10"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("10"))`/abs(`#msub(mi("Q"),mi("10"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("10"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^16/abs(`#msub(mi("Q"),mi("10"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("10"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("10"))`^5, -1.323378725*10^10*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^12/abs(`#msub(mi("Q"),mi("10"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("10"))`/abs(`#msub(mi("Q"),mi("10"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("10"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^16/abs(`#msub(mi("Q"),mi("10"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("10"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("10"))`^5)

(62)

NULL

fsolve({Q__1 = Q__4, Q__3 = Q__7, H__1+H__4 = H__5+H__8, H__3+H__7 = H__6+H__10, Q__1+Q__5 = Q__2, Q__4+Q__8 = 980*(1/60), Q__5+Q__9 = Q__8+17, Q__7+Q__10 = 950*(1/60), Q__2+Q__3+Q__6 = 4000*(1/60), Q__9+Q__10+17.5 = Q__6}, restrictions[-4 <= 4*Q__1/(Pi*D__1^2) and 4*Q__1/(Pi*D__1^2) <= 4, -4 <= 4*Q__2/(Pi*D__2^2) and 4*Q__2/(Pi*D__2^2) <= 4, -4 <= 4*Q__3/(Pi*D__3^2) and 4*Q__3/(Pi*D__3^2) <= 4, -4 <= 4*Q__4/(Pi*D__4^2) and 4*Q__4/(Pi*D__4^2) <= 4, -4 <= 4*Q__5/(Pi*D__5^2) and 4*Q__5/(Pi*D__5^2) <= 4, -4 <= 4*Q__6/(Pi*D__6^2) and 4*Q__6/(Pi*D__6^2) <= 4, -4 <= 4*Q__7/(Pi*D__7^2) and 4*Q__7/(Pi*D__7^2) <= 4, -4 <= 4*Q__8/(Pi*D__8^2) and 4*Q__8/(Pi*D__8^2) <= 4, -4 <= 4*Q__9/(Pi*D__9^2) and 4*Q__9/(Pi*D__9^2) <= 4, -4 <= 4*Q__10/(Pi*D__10^2) and 4*Q__10/(Pi*D__10^2) <= 4], {D__1 = 100, D__10 = 100, D__2 = 100, D__3 = 100, D__4 = 100, D__5 = 100, D__6 = 100, D__7 = 100, D__8 = 100, D__9 = 100, Q__1 = 20, Q__10 = 5, Q__2 = 40, Q__3 = 20, Q__4 = 20, Q__5 = 20, Q__6 = 20, Q__7 = 20, Q__8 = 5, Q__9 = 5})

fsolve({`#msub(mi("Q"),mi("1"))` = `#msub(mi("Q"),mi("4"))`, `#msub(mi("Q"),mi("3"))` = `#msub(mi("Q"),mi("7"))`, 4*abs(`#msub(mi("Q"),mi("1"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("10"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("2"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("2"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("3"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("4"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("5"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("6"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("7"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("8"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^2) = 3.5, 4*abs(`#msub(mi("Q"),mi("9"))`)/(Pi*`#msub(mi("D",fontstyle = "normal"),mi("9"))`^2) = 3.5, `#msub(mi("Q"),mi("1"))`+`#msub(mi("Q"),mi("5"))` = `#msub(mi("Q"),mi("2"))`, `#msub(mi("Q"),mi("4"))`+`#msub(mi("Q"),mi("8"))` = 49/3, `#msub(mi("Q"),mi("5"))`+`#msub(mi("Q"),mi("9"))` = `#msub(mi("Q"),mi("8"))`+17, `#msub(mi("Q"),mi("7"))`+`#msub(mi("Q"),mi("10"))` = 95/6, piecewise(0 < `#msub(mi("Q"),mi("1"))`, 6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^12/abs(`#msub(mi("Q"),mi("1"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("1"))`/abs(`#msub(mi("Q"),mi("1"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("1"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^16/abs(`#msub(mi("Q"),mi("1"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("1"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("1"))`^5, -6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^12/abs(`#msub(mi("Q"),mi("1"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("1"))`/abs(`#msub(mi("Q"),mi("1"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("1"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("1"))`^16/abs(`#msub(mi("Q"),mi("1"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("1"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("1"))`^5)+piecewise(0 < `#msub(mi("Q"),mi("4"))`, 4.678850351*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^12/abs(`#msub(mi("Q"),mi("4"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("4"))`/abs(`#msub(mi("Q"),mi("4"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("4"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^16/abs(`#msub(mi("Q"),mi("4"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("4"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("4"))`^5, -4.678850351*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^12/abs(`#msub(mi("Q"),mi("4"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("4"))`/abs(`#msub(mi("Q"),mi("4"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("4"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("4"))`^16/abs(`#msub(mi("Q"),mi("4"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("4"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("4"))`^5) = piecewise(0 < `#msub(mi("Q"),mi("5"))`, 3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^12/abs(`#msub(mi("Q"),mi("5"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("5"))`/abs(`#msub(mi("Q"),mi("5"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("5"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^16/abs(`#msub(mi("Q"),mi("5"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("5"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("5"))`^5, -3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^12/abs(`#msub(mi("Q"),mi("5"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("5"))`/abs(`#msub(mi("Q"),mi("5"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("5"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("5"))`^16/abs(`#msub(mi("Q"),mi("5"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("5"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("5"))`^5)+piecewise(0 < `#msub(mi("Q"),mi("8"))`, 9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^12/abs(`#msub(mi("Q"),mi("8"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("8"))`/abs(`#msub(mi("Q"),mi("8"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("8"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^16/abs(`#msub(mi("Q"),mi("8"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("8"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("8"))`^5, -9.925340436*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^12/abs(`#msub(mi("Q"),mi("8"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("8"))`/abs(`#msub(mi("Q"),mi("8"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("8"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("8"))`^16/abs(`#msub(mi("Q"),mi("8"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("8"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("8"))`^5), piecewise(0 < `#msub(mi("Q"),mi("3"))`, 6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^12/abs(`#msub(mi("Q"),mi("3"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("3"))`/abs(`#msub(mi("Q"),mi("3"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("3"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^16/abs(`#msub(mi("Q"),mi("3"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("3"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("3"))`^5, -6.616893624*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^12/abs(`#msub(mi("Q"),mi("3"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("3"))`/abs(`#msub(mi("Q"),mi("3"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("3"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("3"))`^16/abs(`#msub(mi("Q"),mi("3"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("3"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("3"))`^5)+piecewise(0 < `#msub(mi("Q"),mi("7"))`, 7.640530634*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^12/abs(`#msub(mi("Q"),mi("7"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("7"))`/abs(`#msub(mi("Q"),mi("7"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("7"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^16/abs(`#msub(mi("Q"),mi("7"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("7"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("7"))`^5, -7.640530634*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^12/abs(`#msub(mi("Q"),mi("7"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("7"))`/abs(`#msub(mi("Q"),mi("7"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("7"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("7"))`^16/abs(`#msub(mi("Q"),mi("7"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("7"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("7"))`^5) = piecewise(0 < `#msub(mi("Q"),mi("6"))`, 3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^12/abs(`#msub(mi("Q"),mi("6"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("6"))`/abs(`#msub(mi("Q"),mi("6"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("6"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^16/abs(`#msub(mi("Q"),mi("6"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("6"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("6"))`^5, -3.970136174*10^9*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^12/abs(`#msub(mi("Q"),mi("6"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("6"))`/abs(`#msub(mi("Q"),mi("6"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("6"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("6"))`^16/abs(`#msub(mi("Q"),mi("6"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("6"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("6"))`^5)+piecewise(0 < `#msub(mi("Q"),mi("10"))`, 1.323378725*10^10*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^12/abs(`#msub(mi("Q"),mi("10"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("10"))`/abs(`#msub(mi("Q"),mi("10"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("10"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^16/abs(`#msub(mi("Q"),mi("10"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("10"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("10"))`^5, -1.323378725*10^10*(1.173811769*10^(-41)*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^12/abs(`#msub(mi("Q"),mi("10"))`)^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(`#msub(mi("D",fontstyle = "normal"),mi("10"))`/abs(`#msub(mi("Q"),mi("10"))`))^.9+0.1242e-1/`#msub(mi("D",fontstyle = "normal"),mi("10"))`))^16+14680.75929*`#msub(mi("D",fontstyle = "normal"),mi("10"))`^16/abs(`#msub(mi("Q"),mi("10"))`)^16)^1.5)^(1/12)*`#msub(mi("Q"),mi("10"))`^2/`#msub(mi("D",fontstyle = "normal"),mi("10"))`^5), `#msub(mi("Q"),mi("2"))`+`#msub(mi("Q"),mi("3"))`+`#msub(mi("Q"),mi("6"))` = 200/3, `#msub(mi("Q"),mi("9"))`+`#msub(mi("Q"),mi("10"))`+17.5 = `#msub(mi("Q"),mi("6"))`}, {`#msub(mi("Q"),mi("1"))` = 20, `#msub(mi("Q"),mi("10"))` = 5, `#msub(mi("Q"),mi("2"))` = 40, `#msub(mi("Q"),mi("3"))` = 20, `#msub(mi("Q"),mi("4"))` = 20, `#msub(mi("Q"),mi("5"))` = 20, `#msub(mi("Q"),mi("6"))` = 20, `#msub(mi("Q"),mi("7"))` = 20, `#msub(mi("Q"),mi("8"))` = 5, `#msub(mi("Q"),mi("9"))` = 5, `#msub(mi("D",fontstyle = "normal"),mi("1"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("10"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("2"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("3"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("4"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("5"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("6"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("7"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("8"))` = 100, `#msub(mi("D",fontstyle = "normal"),mi("9"))` = 100})

(63)

NULL


 

Download aceitoso.mw

 

 

@tomleslie i fail to put absolute value on last 10 equations, so i builded the system in such a way that a negative Q indicates wrong direction choice, so i coud have supposed any of this Qs wrongly. could you please show me wich command are you using to solve something like this in your answer please? i feel fsolve sometimes requires very close initial values to find a solution, and sometimes it just can't... i have uploaded the corrected file on this reply... thanks for your help aceitoso.mw
 

nu := 6.1795*10^(-5)

0.6179500000e-4

(1)

epsilon := 0.46e-1

0.46e-1

(2)

L__1 := 10.

10.

(3)

L__2 := 15.

15.

(4)

L__3 := 10.

10.

(5)

L__4 := 5*sqrt(2.)

7.071067810

(6)

L__5 := 6.

6.

(7)

L__6 := 6.

6.

(8)

L__7 := 20*sqrt(3.)*(1/3)

11.54700539

(9)

L__8 := 15.

15.

(10)

L__9 := 15.

15.

(11)

L__10 := 20.

20.

(12)

Re1 := 4*Q__1/(Pi*D__1*nu)

20604.24864*Q__1/D__1

(13)

Re2 := 4*Q__2/(Pi*D__2*nu)

20604.24864*Q__2/D__2

(14)

Re3 := 4*Q__3/(Pi*D__3*nu)

20604.24864*Q__3/D__3

(15)

Re4 := 4*Q__4/(Pi*D__4*nu)

20604.24864*Q__4/D__4

(16)

Re5 := 4*Q__5/(Pi*D__5*nu)

20604.24864*Q__5/D__5

(17)

Re6 := 4*Q__6/(Pi*D__6*nu)

20604.24864*Q__6/D__6

(18)

Re7 := 4*Q__7/(Pi*D__7*nu)

20604.24864*Q__7/D__7

(19)

Re8 := 4*Q__8/(Pi*D__8*nu)

20604.24864*Q__8/D__8

(20)

Re9 := 4*Q__9/(Pi*D__9*nu)

20604.24864*Q__9/D__9

(21)

Re10 := 4*Q__10/(Pi*D__10*nu)

20604.24864*Q__10/D__10

(22)

A__1 := (2.457*ln(1/((7/Re1)^.9+.27*epsilon/D__1)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16

(23)

A__2 := (2.457*ln(1/((7/Re2)^.9+.27*epsilon/D__2)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__2/Q__2)^.9+0.1242e-1/D__2))^16

(24)

A__3 := (2.457*ln(1/((7/Re3)^.9+.27*epsilon/D__3)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16

(25)

A__4 := (2.457*ln(1/((7/Re4)^.9+.27*epsilon/D__4)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16

(26)

A__5 := (2.457*ln(1/((7/Re5)^.9+.27*epsilon/D__5)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16

(27)

A__6 := (2.457*ln(1/((7/Re6)^.9+.27*epsilon/D__6)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16

(28)

A__7 := (2.457*ln(1/((7/Re7)^.9+.27*epsilon/D__7)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16

(29)

A__8 := (2.457*ln(1/((7/Re8)^.9+.27*epsilon/D__8)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16

(30)

A__9 := (2.457*ln(1/((7/Re9)^.9+.27*epsilon/D__9)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__9/Q__9)^.9+0.1242e-1/D__9))^16

(31)

A__10 := (2.457*ln(1/((7/Re10)^.9+.27*epsilon/D__10)))^16

1763934.700*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16

(32)

B__1 := (37530/Re1)^16

14680.75929*D__1^16/Q__1^16

(33)

B__2 := (37530/Re2)^16

14680.75929*D__2^16/Q__2^16

(34)

B__3 := (37530/Re3)^16

14680.75929*D__3^16/Q__3^16

(35)

B__4 := (37530/Re4)^16

14680.75929*D__4^16/Q__4^16

(36)

B__5 := (37530/Re5)^16

14680.75929*D__5^16/Q__5^16

(37)

B__6 := (37530/Re6)^16

14680.75929*D__6^16/Q__6^16

(38)

B__7 := (37530/Re7)^16

14680.75929*D__7^16/Q__7^16

(39)

B__8 := (37530/Re8)^16

14680.75929*D__8^16/Q__8^16

(40)

B__9 := (37530/Re9)^16

14680.75929*D__9^16/Q__9^16

(41)

B__10 := (37530/Re10)^16

14680.75929*D__10^16/Q__10^16

(42)

f__1 := 8*((8/Re1)^12+1/(A__1+B__1)^1.5)^(1/12)

8*(0.1173811769e-40*D__1^12/Q__1^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/Q__1^16)^1.5)^(1/12)

(43)

f__2 := 8*((8/Re2)^12+1/(A__2+B__2)^1.5)^(1/12)

8*(0.1173811769e-40*D__2^12/Q__2^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__2/Q__2)^.9+0.1242e-1/D__2))^16+14680.75929*D__2^16/Q__2^16)^1.5)^(1/12)

(44)

f__3 := 8*((8/Re3)^12+1/(A__3+B__3)^1.5)^(1/12)

8*(0.1173811769e-40*D__3^12/Q__3^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/Q__3^16)^1.5)^(1/12)

(45)

f__4 := 8*((8/Re4)^12+1/(A__4+B__4)^1.5)^(1/12)

8*(0.1173811769e-40*D__4^12/Q__4^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/Q__4^16)^1.5)^(1/12)

(46)

f__5 := 8*((8/Re5)^12+1/(A__5+B__5)^1.5)^(1/12)

8*(0.1173811769e-40*D__5^12/Q__5^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/Q__5^16)^1.5)^(1/12)

(47)

f__6 := 8*((8/Re6)^12+1/(A__6+B__6)^1.5)^(1/12)

8*(0.1173811769e-40*D__6^12/Q__6^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/Q__6^16)^1.5)^(1/12)

(48)

f__7 := 8*((8/Re7)^12+1/(A__7+B__7)^1.5)^(1/12)

8*(0.1173811769e-40*D__7^12/Q__7^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/Q__7^16)^1.5)^(1/12)

(49)

f__8 := 8*((8/Re8)^12+1/(A__8+B__8)^1.5)^(1/12)

8*(0.1173811769e-40*D__8^12/Q__8^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/Q__8^16)^1.5)^(1/12)

(50)

f__9 := 8*((8/Re9)^12+1/(A__9+B__9)^1.5)^(1/12)

8*(0.1173811769e-40*D__9^12/Q__9^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__9/Q__9)^.9+0.1242e-1/D__9))^16+14680.75929*D__9^16/Q__9^16)^1.5)^(1/12)

(51)

f__10 := 8*((8/Re10)^12+1/(A__10+B__10)^1.5)^(1/12)

8*(0.1173811769e-40*D__10^12/Q__10^12+1/(1763934.700*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/Q__10^16)^1.5)^(1/12)

(52)

H__1 := piecewise(Q__1 > 0, 8000*10^6*f__1*L__1*Q__1^2/(9.8*Pi^2*D__1^5), -8000*10^6*f__1*L__1*Q__1^2/(9.8*Pi^2*D__1^5))

piecewise(0 < Q__1, 6.616893624*10^9*(1.173811769*10^(-41)*D__1^12/Q__1^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/Q__1^16)^1.5)^(1/12)*Q__1^2/D__1^5, -6.616893624*10^9*(1.173811769*10^(-41)*D__1^12/Q__1^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/Q__1^16)^1.5)^(1/12)*Q__1^2/D__1^5)

(53)

H__2 := piecewise(Q__2 > 0, 8000*10^6*f__2*L__2*Q__2^2/(9.8*Pi^2*D__2^5), -8000*10^6*f__2*L__2*Q__2^2/(9.8*Pi^2*D__2^5))

piecewise(0 < Q__2, 9.925340436*10^9*(1.173811769*10^(-41)*D__2^12/Q__2^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__2/Q__2)^.9+0.1242e-1/D__2))^16+14680.75929*D__2^16/Q__2^16)^1.5)^(1/12)*Q__2^2/D__2^5, -9.925340436*10^9*(1.173811769*10^(-41)*D__2^12/Q__2^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__2/Q__2)^.9+0.1242e-1/D__2))^16+14680.75929*D__2^16/Q__2^16)^1.5)^(1/12)*Q__2^2/D__2^5)

(54)

H__3 := piecewise(Q__3 > 0, 8000*10^6*f__3*L__3*Q__3^2/(9.8*Pi^2*D__3^5), -8000*10^6*f__3*L__3*Q__3^2/(9.8*Pi^2*D__3^5))

piecewise(0 < Q__3, 6.616893624*10^9*(1.173811769*10^(-41)*D__3^12/Q__3^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/Q__3^16)^1.5)^(1/12)*Q__3^2/D__3^5, -6.616893624*10^9*(1.173811769*10^(-41)*D__3^12/Q__3^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/Q__3^16)^1.5)^(1/12)*Q__3^2/D__3^5)

(55)

H__4 := piecewise(Q__4 > 0, 8000*10^6*f__4*L__4*Q__4^2/(9.8*Pi^2*D__4^5), -8000*10^6*f__4*L__4*Q__4^2/(9.8*Pi^2*D__4^5))

piecewise(0 < Q__4, 4.678850351*10^9*(1.173811769*10^(-41)*D__4^12/Q__4^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/Q__4^16)^1.5)^(1/12)*Q__4^2/D__4^5, -4.678850351*10^9*(1.173811769*10^(-41)*D__4^12/Q__4^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/Q__4^16)^1.5)^(1/12)*Q__4^2/D__4^5)

(56)

H__5 := piecewise(Q__5 > 0, 8000*10^6*f__5*L__5*Q__5^2/(9.8*Pi^2*D__5^5), -8000*10^6*f__5*L__5*Q__5^2/(9.8*Pi^2*D__5^5))

piecewise(0 < Q__5, 3.970136174*10^9*(1.173811769*10^(-41)*D__5^12/Q__5^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/Q__5^16)^1.5)^(1/12)*Q__5^2/D__5^5, -3.970136174*10^9*(1.173811769*10^(-41)*D__5^12/Q__5^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/Q__5^16)^1.5)^(1/12)*Q__5^2/D__5^5)

(57)

H__6 := piecewise(Q__6 > 0, 8000*10^6*f__6*L__6*Q__6^2/(9.8*Pi^2*D__6^5), -8000*10^6*f__6*L__6*Q__6^2/(9.8*Pi^2*D__6^5))

piecewise(0 < Q__6, 3.970136174*10^9*(1.173811769*10^(-41)*D__6^12/Q__6^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/Q__6^16)^1.5)^(1/12)*Q__6^2/D__6^5, -3.970136174*10^9*(1.173811769*10^(-41)*D__6^12/Q__6^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/Q__6^16)^1.5)^(1/12)*Q__6^2/D__6^5)

(58)

H__7 := piecewise(Q__7 > 0, 8000*10^6*f__7*L__7*Q__7^2/(9.8*Pi^2*D__7^5), -8000*10^6*f__7*L__7*Q__7^2/(9.8*Pi^2*D__7^5))

piecewise(0 < Q__7, 7.640530634*10^9*(1.173811769*10^(-41)*D__7^12/Q__7^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/Q__7^16)^1.5)^(1/12)*Q__7^2/D__7^5, -7.640530634*10^9*(1.173811769*10^(-41)*D__7^12/Q__7^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/Q__7^16)^1.5)^(1/12)*Q__7^2/D__7^5)

(59)

H__8 := piecewise(Q__8 > 0, 8000*10^6*f__8*L__8*Q__8^2/(9.8*Pi^2*D__8^5), -8000*10^6*f__8*L__8*Q__8^2/(9.8*Pi^2*D__8^5))

piecewise(0 < Q__8, 9.925340436*10^9*(1.173811769*10^(-41)*D__8^12/Q__8^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/Q__8^16)^1.5)^(1/12)*Q__8^2/D__8^5, -9.925340436*10^9*(1.173811769*10^(-41)*D__8^12/Q__8^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/Q__8^16)^1.5)^(1/12)*Q__8^2/D__8^5)

(60)

H__9 := piecewise(Q__9 > 0, 8000*10^6*f__9*L__9*Q__9^2/(9.8*Pi^2*D__9^5), -8000*10^6*f__9*L__9*Q__9^2/(9.8*Pi^2*D__9^5))

piecewise(0 < Q__9, 9.925340436*10^9*(1.173811769*10^(-41)*D__9^12/Q__9^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__9/Q__9)^.9+0.1242e-1/D__9))^16+14680.75929*D__9^16/Q__9^16)^1.5)^(1/12)*Q__9^2/D__9^5, -9.925340436*10^9*(1.173811769*10^(-41)*D__9^12/Q__9^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__9/Q__9)^.9+0.1242e-1/D__9))^16+14680.75929*D__9^16/Q__9^16)^1.5)^(1/12)*Q__9^2/D__9^5)

(61)

H__10 := piecewise(Q__10 > 0, 8000*10^6*f__10*L__10*Q__10^2/(9.8*Pi^2*D__10^5), -8000*10^6*f__10*L__10*Q__10^2/(9.8*Pi^2*D__10^5))

piecewise(0 < Q__10, 1.323378725*10^10*(1.173811769*10^(-41)*D__10^12/Q__10^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/Q__10^16)^1.5)^(1/12)*Q__10^2/D__10^5, -1.323378725*10^10*(1.173811769*10^(-41)*D__10^12/Q__10^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/Q__10^16)^1.5)^(1/12)*Q__10^2/D__10^5)

(62)

``

fsolve({Q__1 = Q__4, Q__3 = Q__7, 4*abs(Q__1)/(Pi*D__1^2) = 3.5, 4*abs(Q__10)/(Pi*D__10^2) = 3.5, 4*abs(Q__2)/(Pi*D__2^2) = 3.5, 4*abs(Q__3)/(Pi*D__3^2) = 3.5, 4*abs(Q__4)/(Pi*D__4^2) = 3.5, 4*abs(Q__5)/(Pi*D__5^2) = 3.5, 4*abs(Q__6)/(Pi*D__6^2) = 3.5, 4*abs(Q__7)/(Pi*D__7^2) = 3.5, 4*abs(Q__8)/(Pi*D__8^2) = 3.5, 4*abs(Q__9)/(Pi*D__9^2) = 3.5, H__1+H__4 = H__5+H__8, H__3+H__7 = H__6+H__10, Q__1+Q__5 = Q__2, Q__4+Q__8 = 980*(1/60), Q__5+Q__9 = Q__8+17, Q__7+Q__10 = 950*(1/60), Q__2+Q__3+Q__6 = 4000*(1/60), Q__9+Q__10+17.5 = Q__6}, {D__1 = 100, D__10 = 100, D__2 = 100, D__3 = 100, D__4 = 100, D__5 = 100, D__6 = 100, D__7 = 100, D__8 = 100, D__9 = 100, Q__1 = 20, Q__10 = 5, Q__2 = 40, Q__3 = 20, Q__4 = 20, Q__5 = 20, Q__6 = 20, Q__7 = 20, Q__8 = 5, Q__9 = 5})

fsolve({Q__1 = Q__4, Q__3 = Q__7, 4*Q__1/(Pi*D__1^2) = 3.5, 4*Q__10/(Pi*D__10^2) = 3.5, 4*Q__2/(Pi*D__2^2) = 3.5, 4*Q__3/(Pi*D__3^2) = 3.5, 4*Q__4/(Pi*D__4^2) = 3.5, 4*Q__5/(Pi*D__5^2) = 3.5, 4*Q__6/(Pi*D__6^2) = 3.5, 4*Q__7/(Pi*D__7^2) = 3.5, 4*Q__8/(Pi*D__8^2) = 3.5, 4*Q__9/(Pi*D__9^2) = 3.5, Q__1+Q__5 = Q__2, Q__4+Q__8 = 49/3, Q__5+Q__9 = Q__8+17, Q__7+Q__10 = 95/6, piecewise(0 < Q__1, 6.616893624*10^9*(1.173811769*10^(-41)*D__1^12/Q__1^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/Q__1^16)^1.5)^(1/12)*Q__1^2/D__1^5, -6.616893624*10^9*(1.173811769*10^(-41)*D__1^12/Q__1^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__1/Q__1)^.9+0.1242e-1/D__1))^16+14680.75929*D__1^16/Q__1^16)^1.5)^(1/12)*Q__1^2/D__1^5)+piecewise(0 < Q__4, 4.678850351*10^9*(1.173811769*10^(-41)*D__4^12/Q__4^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/Q__4^16)^1.5)^(1/12)*Q__4^2/D__4^5, -4.678850351*10^9*(1.173811769*10^(-41)*D__4^12/Q__4^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__4/Q__4)^.9+0.1242e-1/D__4))^16+14680.75929*D__4^16/Q__4^16)^1.5)^(1/12)*Q__4^2/D__4^5) = piecewise(0 < Q__5, 3.970136174*10^9*(1.173811769*10^(-41)*D__5^12/Q__5^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/Q__5^16)^1.5)^(1/12)*Q__5^2/D__5^5, -3.970136174*10^9*(1.173811769*10^(-41)*D__5^12/Q__5^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__5/Q__5)^.9+0.1242e-1/D__5))^16+14680.75929*D__5^16/Q__5^16)^1.5)^(1/12)*Q__5^2/D__5^5)+piecewise(0 < Q__8, 9.925340436*10^9*(1.173811769*10^(-41)*D__8^12/Q__8^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/Q__8^16)^1.5)^(1/12)*Q__8^2/D__8^5, -9.925340436*10^9*(1.173811769*10^(-41)*D__8^12/Q__8^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__8/Q__8)^.9+0.1242e-1/D__8))^16+14680.75929*D__8^16/Q__8^16)^1.5)^(1/12)*Q__8^2/D__8^5), piecewise(0 < Q__3, 6.616893624*10^9*(1.173811769*10^(-41)*D__3^12/Q__3^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/Q__3^16)^1.5)^(1/12)*Q__3^2/D__3^5, -6.616893624*10^9*(1.173811769*10^(-41)*D__3^12/Q__3^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__3/Q__3)^.9+0.1242e-1/D__3))^16+14680.75929*D__3^16/Q__3^16)^1.5)^(1/12)*Q__3^2/D__3^5)+piecewise(0 < Q__7, 7.640530634*10^9*(1.173811769*10^(-41)*D__7^12/Q__7^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/Q__7^16)^1.5)^(1/12)*Q__7^2/D__7^5, -7.640530634*10^9*(1.173811769*10^(-41)*D__7^12/Q__7^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__7/Q__7)^.9+0.1242e-1/D__7))^16+14680.75929*D__7^16/Q__7^16)^1.5)^(1/12)*Q__7^2/D__7^5) = piecewise(0 < Q__6, 3.970136174*10^9*(1.173811769*10^(-41)*D__6^12/Q__6^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/Q__6^16)^1.5)^(1/12)*Q__6^2/D__6^5, -3.970136174*10^9*(1.173811769*10^(-41)*D__6^12/Q__6^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__6/Q__6)^.9+0.1242e-1/D__6))^16+14680.75929*D__6^16/Q__6^16)^1.5)^(1/12)*Q__6^2/D__6^5)+piecewise(0 < Q__10, 1.323378725*10^10*(1.173811769*10^(-41)*D__10^12/Q__10^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/Q__10^16)^1.5)^(1/12)*Q__10^2/D__10^5, -1.323378725*10^10*(1.173811769*10^(-41)*D__10^12/Q__10^12+1/(1.763934700*10^6*ln(1/(0.7551394026e-3*(D__10/Q__10)^.9+0.1242e-1/D__10))^16+14680.75929*D__10^16/Q__10^16)^1.5)^(1/12)*Q__10^2/D__10^5), Q__2+Q__3+Q__6 = 200/3, Q__9+Q__10+17.5 = Q__6}, {D__1 = 30, D__10 = 30, D__2 = 30, D__3 = 30, D__4 = 30, D__5 = 30, D__6 = 30, D__7 = 30, D__8 = 30, D__9 = 30, Q__1 = 20, Q__10 = 5, Q__2 = 40, Q__3 = 20, Q__4 = 20, Q__5 = 20, Q__6 = 20, Q__7 = 20, Q__8 = 5, Q__9 = 5})

(63)

``


 

Download aceitoso.mw

 

@vv i would like to know that, i have no idea what an rhs is...

only think i know is how to extract the results from the list procedure i got. and there is not a second derivative for y(x) in that. it could be very usefull to know something like that..

thanks..

@ it looks like all you have to do is letting your system expressed like da/dt = "something", db/dt = "something",.... putting enough initial conditions, and if expression is not a big amount of polynomius, it could easily solve. It's not like that? 

@ 
 

sol := dsolve({Q(0) = 0, T__1(0) = 80, T__1s(0) = 60.36410198, T__2(0) = 38.2, diff(Q(t), t) = (240*0.1375e-1)*(T__1s(t)-T__2s(t))/(0.1e-2), diff(Q(t), t) = -5761.250*(diff(T__1(t), t)), diff(Q(t), t) = 5761.250*(diff(T__2(t), t)), diff(Q(t), t) = (0.1375e-1*47.6035070726347)*(T__1(t)-T__1s(t))*(T__1(t)+T__1s(t))^.438263122318020*((T__1(t)-T__1s(t))^.327228811371115), diff(Q(t), t) = (0.1375e-1*47.6035072491656)*(T__2s(t)-T__2(t))*(T__2(t)+T__2s(t))^.438263121701134*((T__2s(t)-T__2(t))^.327228811154163)}, numeric, output = listprocedure)

[t = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[1] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 1, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 1, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[1] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("t"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][1])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[1] catch: error  end try end proc, Q(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 2, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 2, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[2] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("Q(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][2])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc, T__1(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc, T__1s(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[4] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 4, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 4, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[4] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1s(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][4])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[4] catch: error  end try end proc, T__2(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[5] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 5, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 5, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[5] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__2(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][5])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[5] catch: error  end try end proc, T__2s(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[6] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 6, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 6, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[6] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__2s(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][6])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[6] catch: error  end try end proc]

(1)

subs({T__1(t) = 80, T__1s(t) = T__1s, T__2(t) = 38.2, T__2s(t) = T__2s, diff(Q(t), t) = H}, {diff(Q(t), t) = (240*0.1375e-1)*(T__1s(t)-T__2s(t))/(0.1e-2), diff(Q(t), t) = (0.1375e-1*47.6035070726347)*(T__1(t)-T__1s(t))*(T__1(t)+T__1s(t))^.438263122318020*((T__1(t)-T__1s(t))^.327228811371115), diff(Q(t), t) = (0.1375e-1*47.6035072491656)*(T__2s(t)-T__2(t))*(T__2(t)+T__2s(t))^.438263121701134*((T__2s(t)-T__2(t))^.327228811154163)})

{H = .6545482222*(80-T__1s)^1.327228811*(80+T__1s)^.438263122318020, H = .6545482247*(T__2s-38.2)^1.327228811*(38.2+T__2s)^.438263121701134, H = 3300.000000*T__1s-3300.000000*T__2s}

(2)

fsolve({H = .6545482222*(80-T__1s)^1.327228811*(80+T__1s)^.438263122318020, H = .6545482247*(T__2s-38.2)^1.327228811*(38.2+T__2s)^.438263121701134, H = 3300.000000*T__1s-3300.000000*T__2s}, {H, T__1s = 60, T__2s = 60})

{H = 297.2891248, T__1s = 60.36410198, T__2s = 60.27401436}

(3)

T1data := eval(T__1(t), sol)

proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 1, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.8489477642233992e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = 60.27401436643667}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = -0.1899709750053425e38, (1, 3) = 0.345674532479136e38, (1, 4) = -0.14870547521595658e38, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = 80.0, (3) = 60.36410198, (4) = 38.2, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 297.2891247589918, (2) = -0.51601497029115526e-1, (3) = -0.616001864388285e-2, (4) = 0.51601497029115526e-1}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, Array(1..4, {(1) = 0.8439061577440557e29, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), [-588062486530035000000000000000000000*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+13875726714219859.85226*(-25945233439.70460705138*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+130806665494026.6114889*T__1s(t)-130806665494026.6114889*T__2(t))^1.327228811000000000000*(107.9972837698265068957*T__2(t)-0.2142103942241480427000e-1*(T__1(t)-T__1s(t))^1.327228811000000000000*(T__1(t)+T__1s(t))^.4382631223180200000000+107.9972837698265068957*T__1s(t))^.4382631217011340000000]]), ( 17 ) = ([proc (N, X, Y, YP) local T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12; T1 := Y[2]-Y[3]; if T1 < 0 then YP[1] := undefined; return 0 end if; T2 := T1^1.327228811000000000000; T3 := Y[2]+Y[3]; if T3 < 0 then YP[1] := undefined; return 0 end if; T4 := T3^.4382631223180200000000; T5 := T2*T4; Y[5] := -(3272741111/16500000000000)*T5+Y[3]; if N < 1 then return 0 end if; YP[1] := (3272741111/5000000000)*T5; YP[2] := -(3272741111/28806250000000)*T5; if T1 < 0 then YP[1] := undefined; return 0 end if; T1 := T1^.3272288110000000000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T6 := T1*T3^.8765262446360400000000; if T3 < 0 then YP[1] := undefined; return 0 end if; T7 := T2/T3^.1234737553639600000000; T8 := Y[3]-Y[4]; if 266364897564641.1366943*T8-52832930350.73362594068*T5 < 0 then YP[1] := undefined; return 0 end if; T9 := (266364897564641.1366943*T8-52832930350.73362594068*T5)^.3272288110000000000000; T10 := Y[3]+Y[4]; if 11663.41330166043184487*T10-2.313414073147172112771*T5 < 0 then YP[1] := undefined; return 0 end if; T11 := (11663.41330166043184487*T10-2.313414073147172112771*T5)^.4382631217011340000000; T12 := T3^.4382631223180200000000; if 3142402890.296817664688*T8-623289.1591757344341637*T5 < 0 then YP[1] := undefined; return 0 end if; T8 := (3142402890.296817664688*T8-623289.1591757344341637*T5)^1.327228811000000000000; if 518.2868701452332372179*T10-.1028011361948983852198*T5 < 0 then YP[1] := undefined; return 0 end if; T10 := 1/(518.2868701452332372179*T10-.1028011361948983852198*T5)^.5617368782988660000000; T1 := T1*T4; if T3 < 0 then YP[1] := undefined; return 0 end if; T3 := T2/T3^.5617368776819800000000; T1 := 1009968513768913514845087479708632812500000000000000000000000000000000000000000000000000000000000*T1-333500863316667566156979138400614321093750000000000000000000000000000000000000000000000000000000*T3-5403818747718458254575000000000000*(621980632516442206160900*T10*T8+71183890194442834010340000000*T11*T9)*(-825000000000000000000000000-217183814673167451050000*T1+71716086892270283506011*T3); T1 := 1/T1; YP[3] := -3272741111*T2*(13353520169000210549720000000000000000000000000000*T9*T11*(-825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+116678519512610468180000000000000000000000000*T8*T10*(825000000000000000000000000*T12+217183814673167451050000*T6+71716086892270283506011*T7)+35060742504453495850556302181250000000000000000000000000000000000000000000000000000*T6+11577378635423478104820278182707375000000000000000000000000000000000000000000000000*T7)*T1; YP[4] := (3272741111/28806250000000)*T5; 0 end proc, -1, proc (X, Y, R) local T1; if Y[2]+Y[3] < 0 then R[1] := undefined; return 0 end if; if Y[2]-Y[3] < 0 then R[1] := undefined; return 0 end if; T1 := (Y[2]-Y[3])^1.327228811000000000000*(Y[2]+Y[3])^.4382631223180200000000; if -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4] < 0 then R[1] := undefined; return 0 end if; if -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4] < 0 then R[1] := undefined; return 0 end if; R[1] := -588062486530035000000000000000000000*T1+13875726714219859.85226*(-25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4])^1.327228811000000000000*(-0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4])^.4382631217011340000000; 0 end proc, proc (X, Y, J) local T1, T2, T3, T4, T5, T6; J[1 .. 1, 1 .. 4] := 0; T1 := Y[2]-Y[3]; T2 := Y[2]+Y[3]; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T2^.4382631223180200000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T4 := T1^.327228811000000000000*T3; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := T1^1.327228811000000000000; if T2 < 0 then J[1, 1] := undefined; return 0 end if; T2 := T1/T2^.5617368776819800000000; T1 := T1*T3; T3 := -25945233439.70460705138*T1+130806665494026.6114889*Y[3]-130806665494026.6114889*Y[4]; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T5 := T3^.327228811000000000000; T1 := -0.2142103942241480427000e-1*T1+107.9972837698265068957*Y[3]+107.9972837698265068957*Y[4]; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T6 := T1^.4382631217011340000000; if T3 < 0 then J[1, 1] := undefined; return 0 end if; T3 := T3^1.327228811000000000000; if T1 < 0 then J[1, 1] := undefined; return 0 end if; T1 := 1/T1^.5617368782988660000000; J[1, 2] := -780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(-34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(-0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 3] := 780493474790961868838400000000000000*T4-257726101464751717835600000000000000*T2+18416264268674961.38430*T5*T6*(130806665494026.6114889+34435261329.29658580803*T4-11370839016.55484298262*T2)+6081219305645814.633082*T3*T1*(107.9972837698265068957+0.2843062068299572742007e-1*T4-0.9388051620564907855505e-2*T2); J[1, 4] := -2408970119842160300622000000000*T5*T6+656755167018378356.4265*T1*T3; 0 end proc, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = 80., (4) = 60.36410198, (5) = 38.2}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209326726, (2) = 18446744074209327078, (3) = 18446744074209328134, (4) = 18446744074209328398, (5) = 18446744074209328662, (6) = 18446744074209328926}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc

(4)

 

 

sola := dsolve({Q(0) = 0, Q(t) = (1.375*4190)*(80-T__1(t)), Q(t) = (1.375*4190)*(T__2(t)-38.2), diff(Q(t), t) = (825.2*0.1375e-1)*(T__2s(t)-T__2(t)), diff(Q(t), t) = (885.56*0.1375e-1)*(T__1(t)-T__1s(t)), diff(Q(t), t) = (250*0.1375e-1)*(T__1s(t)-T__2s(t))/(0.1e-2)}, numeric, output = listprocedure)

[t = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[1] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 1, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 1, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[1] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("t"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][1])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[1] catch: error  end try end proc, Q(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 2, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 2, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[2] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("Q(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][2])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc, T__1(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc, T__1s(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[4] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 4, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 4, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[4] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1s(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][4])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[4] catch: error  end try end proc, T__2(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[5] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 5, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 5, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[5] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__2(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][5])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[5] catch: error  end try end proc, T__2s(t) = proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[6] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 6, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 6, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[6] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__2s(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][6])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[6] catch: error  end try end proc]

(5)

T1adata := eval(T__1(t), sola)

proc (t) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](t) else _xout := evalf(t) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..53, {(1) = 5, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10297559340153226e-4, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..5, {(1) = .0, (2) = 80.0, (3) = 59.87179725549987, (4) = 38.2, (5) = 59.800498330610196}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..5, {(1) = .0, (2) = undefined, (3) = undefined, (4) = undefined, (5) = undefined}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 245.09005430826858}, datatype = float[8], order = C_order)]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) Y[2] := -(4/23045)*Y[1]+80; Y[3] := 145740460960/2434208887-(3955191028/617059781810065)*Y[1]; Y[4] := (4/23045)*Y[1]+191/5; Y[5] := 727834522417/12171044435-(3589808972/617059781810065)*Y[1]; if N < 1 then return 0 end if; YP[1] := 108472797875/442583434-(22836378500/11219268760183)*Y[1]; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 20 ) = ([]), ( 21 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 0., (2) = 0., (3) = Float(undefined), (4) = Float(undefined), (5) = Float(undefined)}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 10 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 10 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 10 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-10, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..6, {(1) = 18446744074209329678, (2) = 18446744074209329854, (3) = 18446744074209330030, (4) = 18446744074209330206, (5) = 18446744074209330382, (6) = 18446744074209330558}), (3) = [t, Q(t), T__1(t), T__1s(t), T__2(t), T__2s(t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(t, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := `tools/gensym`("T__1(t)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc

(6)

plot({T1adata, T1data}, 0 .. 4000)

 

``

only thing i did was differentiate my two last ecuations, and then i needed to insert two more initial conditions for T1 and T2. like you said before, system ask for T1s because there is another solution, if i'm not bad with T1s= - 60.364...

that was all i required, although the system continue identifying it like a DAE, but now i got a solution.  
 

Download solucion_ecuation_1.mw

@Carl Love 
 

dsolve({Q(0) = 0, Q(t) = (1.375*4190)*(80-T__1(t)), Q(t) = (1.375*4190)*(T__2(t)-38.2), diff(Q(t), t) = (240*0.1375e-1)*(T__1s(t)-T__2s(t))/(0.1e-2), diff(Q(t), t) = (0.1375e-1*(T__1(t)-T__1s(t)))*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949)*(.825+.387*(((-(9.8*.11^3*4190)*(4.216485*10^(-2)-7.097451*10^(-3)*(T__1(t)+T__1s(t))+2.63217825*10^(-5)*(T__1(t)+T__1s(t))^2-4.9518879*10^(-8)*(T__1(t)+T__1s(t))^3)/(999.9399+2.1082425*10^(-2)*(T__1(t)+T__1s(t))-1.77436275*10^(-3)*(T__1(t)+T__1s(t))^2+.438696375*10^(-5)*(T__1(t)+T__1s(t))^3-.6189861563*10^(-8)*(T__1(t)+T__1s(t))^4))*((999.9399+2.1082425*10^(-2)*(T__1(t)+T__1s(t))-1.77436275*10^(-3)*(T__1(t)+T__1s(t))^2+.438696375*10^(-5)*(T__1(t)+T__1s(t))^3-.6189861563*10^(-8)*(T__1(t)+T__1s(t))^4)^2))*(T__1(t)-T__1s(t))/((0.178910466924394e-2-0.593656020810955e-4*(T__1(t)+T__1s(t))+0.130419399687942e-5*(T__1(t)+T__1s(t))^2-1.79236416162215*10^(-8)*(T__1(t)+T__1s(t))^3+1.33479173942873*10^(-10)*(T__1(t)+T__1s(t))^4-4.03880841196434*10^(-13)*(T__1(t)+T__1s(t))^5)*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949)))^(1/6)/(1+((.492*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949))/(4190*(0.178910466924394e-2-0.593656020810955e-4*(T__1(t)+T__1s(t))+0.130419399687942e-5*(T__1(t)+T__1s(t))^2-1.79236416162215*10^(-8)*(T__1(t)+T__1s(t))^3+1.33479173942873*10^(-10)*(T__1(t)+T__1s(t))^4-4.03880841196434*10^(-13)*(T__1(t)+T__1s(t))^5)))^(9/16))^(8/27))^2/(.11), diff(Q(t), t) = (0.1375e-1*(T__2s(t)-T__2(t)))*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949)*(.825+.387*(((-(9.8*.11^3*4190)*(4.216485*10^(-2)-7.097451*10^(-3)*(T__2(t)+T__2s(t))+2.63217825*10^(-5)*(T__2(t)+T__2s(t))^2-4.9518879*10^(-8)*(T__2(t)+T__2s(t))^3)/(999.9399+2.1082425*10^(-2)*(T__2(t)+T__2s(t))-1.77436275*10^(-3)*(T__2(t)+T__2s(t))^2+.438696375*10^(-5)*(T__2(t)+T__2s(t))^3-.6189861563*10^(-8)*(T__2(t)+T__2s(t))^4))*((999.9399+2.1082425*10^(-2)*(T__2(t)+T__2s(t))-1.77436275*10^(-3)*(T__2(t)+T__2s(t))^2+.438696375*10^(-5)*(T__2(t)+T__2s(t))^3-.6189861563*10^(-8)*(T__2(t)+T__2s(t))^4)^2))*(T__2s(t)-T__2(t))/((0.178910466924394e-2-0.593656020810955e-4*(T__2(t)+T__2s(t))+0.130419399687942e-5*(T__2(t)+T__2s(t))^2-1.79236416162215*10^(-8)*(T__2(t)+T__2s(t))^3+1.33479173942873*10^(-10)*(T__2(t)+T__2s(t))^4-4.03880841196434*10^(-13)*(T__2(t)+T__2s(t))^5)*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949)))^(1/6)/(1+((.492*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949))/(4190*(0.178910466924394e-2-0.593656020810955e-4*(T__2(t)+T__2s(t))+0.130419399687942e-5*(T__2(t)+T__2s(t))^2-1.79236416162215*10^(-8)*(T__2(t)+T__2s(t))^3+1.33479173942873*10^(-10)*(T__2(t)+T__2s(t))^4-4.03880841196434*10^(-13)*(T__2(t)+T__2s(t))^5)))^(9/16))^(8/27))^2/(.11)}, numeric)

by the way, it was a time memory didn´t change at all, neither time, maybe it entered in an infinite loop or something?
 

Download ecuation_1.mwecuation_1.mw

@Carl Love hello again,

I remembered what you said about that exponent on denominator and i replace it by a fifth grade polynomium using curve adjust. so i ran it again but i has been an hour and still no answer. why would be it taking so long? i have worked even with a double pendulum ecuation before, with very wide and long trigonometric expressions for theta, like sin() and cos(). however i could get an answer in less than a minute, just a few seconds of evaluating (something like 10 sec max).  

@Carl Love thank you very much, i had no idea a system like this could take so long. which is more, i didn't even know maple could keep evaluating an expression for days! that's crazy and amazing 😂. do you think an ordinary computer could resist so much time processing? it doesn't matter if my screen auto-black-out (some times when computer stays in recess so much time, screen just turn off saving energy), i mean, calculations are not interrupted? 

@Carl Love ecuation_1.mw
 

dsolve({Q(0) = 0, Q(t) = (1.375*4190)*(80-T__1(t)), Q(t) = (1.375*4190)*(T__2(t)-38.2), diff(Q(t), t) = (240*0.1375e-1)*(T__1s(t)-T__2s(t))/(0.1e-2), diff(Q(t), t) = (0.1375e-1*(T__1(t)-T__1s(t)))*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949)*(.825+.387*(((-(9.8*.11^3*4190)*(4.216485*10^(-2)-7.097451*10^(-3)*(T__1(t)+T__1s(t))+2.63217825*10^(-5)*(T__1(t)+T__1s(t))^2-4.9518879*10^(-8)*(T__1(t)+T__1s(t))^3)/(999.9399+2.1082425*10^(-2)*(T__1(t)+T__1s(t))-1.77436275*10^(-3)*(T__1(t)+T__1s(t))^2+.438696375*10^(-5)*(T__1(t)+T__1s(t))^3-.6189861563*10^(-8)*(T__1(t)+T__1s(t))^4))*((999.9399+2.1082425*10^(-2)*(T__1(t)+T__1s(t))-1.77436275*10^(-3)*(T__1(t)+T__1s(t))^2+.438696375*10^(-5)*(T__1(t)+T__1s(t))^3-.6189861563*10^(-8)*(T__1(t)+T__1s(t))^4)^2))*(T__1(t)-T__1s(t))/(2.414*10^(247.8/(.5*(T__1(t)+T__1s(t))+133)-5)*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949)))^(1/6)/(1+((.492*(-9.481411*10^(-6)*(T__1(t)+T__1s(t))^2+2.1356735*10^(-3)*(T__1(t)+T__1s(t))+.5599920949))/((4190*2.414)*10^(247.8/(.5*(T__1(t)+T__1s(t))+133)-5)))^(9/16))^(8/27))^2/(.11), diff(Q(t), t) = (0.1375e-1*(T__2s(t)-T__2(t)))*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949)*(.825+.387*(((-(9.8*.11^3*4190)*(4.216485*10^(-2)-7.097451*10^(-3)*(T__2(t)+T__2s(t))+2.63217825*10^(-5)*(T__2(t)+T__2s(t))^2-4.9518879*10^(-8)*(T__2(t)+T__2s(t))^3)/(999.9399+2.1082425*10^(-2)*(T__2(t)+T__2s(t))-1.77436275*10^(-3)*(T__2(t)+T__2s(t))^2+.438696375*10^(-5)*(T__2(t)+T__2s(t))^3-.6189861563*10^(-8)*(T__2(t)+T__2s(t))^4))*((999.9399+2.1082425*10^(-2)*(T__2(t)+T__2s(t))-1.77436275*10^(-3)*(T__2(t)+T__2s(t))^2+.438696375*10^(-5)*(T__2(t)+T__2s(t))^3-.6189861563*10^(-8)*(T__2(t)+T__2s(t))^4)^2))*(T__2s(t)-T__2(t))/(2.414*10^(247.8/(.5*(T__2(t)+T__2s(t))+133)-5)*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949)))^(1/6)/(1+((.492*(-9.481411*10^(-6)*(T__2(t)+T__2s(t))^2+2.1356735*10^(-3)*(T__2(t)+T__2s(t))+.5599920949))/((4190*2.414)*10^(247.8/(.5*(T__2(t)+T__2s(t))+133)-5)))^(9/16))^(8/27))^2/(.11)}, numeric)

ok, thank you for answer me. here is my input in typed commands, i also have uploaded a couple days ago another corrected ecuation with the hole process in order to explain my problem, althought with some mistakes. i just uploaded the maple document right now, so you can open it and try to evaluate it by yourself. that's the DAE i can't solve. 

it would be great if could at least reply telling why maple just kept evaluating it and doesn´t give me a procedure. do i have to give a long while for calculations or something? thank you very much.

Download ecuation_1.mw

 

@tomleslie or you have no idea?...say something at least. it appears like maple can't solve EVERY ecuation can be solved. 

Waiting for your answer...

1 2 3 Page 1 of 3