Question: How to solve 2 equations and use output in for loop to solve the next step, as in finite difference?

I've 2 equatoions that i wish to solve to get 2 values, which should be used as an input for the next step and so on,

I've managed to produce the equations, but i can't force the code to use the output of the first loop T1[1] and T2[1] into the 2nd loop and so on

It produces only equations, I'd appreciate it if anyone could tell me how to do that into an array or something similar

restart

k := 28:

Tinf := 200; -1; h := 45; -1; `Δt` := 15; -1; t_total := 150; -1; T1[0] := Tinf; -1; T2[0] := Tinf; -1; L := 0.4e-1; -1; M := 3; -1; `Δx` := L/(M-1); -1; tau := alpha*`Δt`/`Δx`^2; -1; for i from 0 to t_total/`Δt` do T1[i+1] = tau*(T0+T2[i])+(1-2*tau)*T1[i]+tau*g*`Δx`^2/k; 2*h*`Δx`*(Tinf-T2[i])/k+2*(T1[i]-T2[i])+g*`Δx`^2/k = (T2[i+1]-T2[i])/tau end do

T1[1] = 139.7321429

 

71.42857143 = 2.133333333*T2[1]-426.6666666

 

T1[2] = .4687500000*T2[1]+0.625000000e-1*T1[1]+33.48214286

 

84.28571429-2.064285714*T2[1]+2*T1[1] = 2.133333333*T2[2]-2.133333333*T2[1]

 

T1[3] = .4687500000*T2[2]+0.625000000e-1*T1[2]+33.48214286

 

84.28571429-2.064285714*T2[2]+2*T1[2] = 2.133333333*T2[3]-2.133333333*T2[2]

 

T1[4] = .4687500000*T2[3]+0.625000000e-1*T1[3]+33.48214286

 

84.28571429-2.064285714*T2[3]+2*T1[3] = 2.133333333*T2[4]-2.133333333*T2[3]

 

T1[5] = .4687500000*T2[4]+0.625000000e-1*T1[4]+33.48214286

 

84.28571429-2.064285714*T2[4]+2*T1[4] = 2.133333333*T2[5]-2.133333333*T2[4]

 

T1[6] = .4687500000*T2[5]+0.625000000e-1*T1[5]+33.48214286

 

84.28571429-2.064285714*T2[5]+2*T1[5] = 2.133333333*T2[6]-2.133333333*T2[5]

 

T1[7] = .4687500000*T2[6]+0.625000000e-1*T1[6]+33.48214286

 

84.28571429-2.064285714*T2[6]+2*T1[6] = 2.133333333*T2[7]-2.133333333*T2[6]

 

T1[8] = .4687500000*T2[7]+0.625000000e-1*T1[7]+33.48214286

 

84.28571429-2.064285714*T2[7]+2*T1[7] = 2.133333333*T2[8]-2.133333333*T2[7]

 

T1[9] = .4687500000*T2[8]+0.625000000e-1*T1[8]+33.48214286

 

84.28571429-2.064285714*T2[8]+2*T1[8] = 2.133333333*T2[9]-2.133333333*T2[8]

 

T1[10] = .4687500000*T2[9]+0.625000000e-1*T1[9]+33.48214286

 

84.28571429-2.064285714*T2[9]+2*T1[9] = 2.133333333*T2[10]-2.133333333*T2[9]

 

T1[11] = .4687500000*T2[10]+0.625000000e-1*T1[10]+33.48214286

 

84.28571429-2.064285714*T2[10]+2*T1[10] = 2.133333333*T2[11]-2.133333333*T2[10]

(1)

``


 

Download Advheat-ex55.mwAdvheat-ex55.mw

Please Wait...