En realidad, confundí la última vez con la temperatura de Jacobi. En el Jacobi, deberíamos ver [math] u_n [/ math] como [math] b [/ math]. Y crea otra variable temporal.
Mi error es solo poner la última vez temp y Jacobi temp en una variable.
El código lo edito de la siguiente manera. Lo siento
subrutina one_d_linear_convt_impl (c, dt, t, dx, x, u0, u, epsilon)
- ¿Es posible simular el genoma humano y Cas9 CRISPR en una computadora cuántica D-Wave para predecir la manipulación genética de una manera segura?
- ¿Cuál es la diferencia entre la decoherencia cuántica y el colapso de la función de onda?
- ¿Qué es la computación cuántica?
- ¿Son permanentes las fluctuaciones cuánticas?
- ¿Por qué la ciencia en general parece ignorar la diferencia fundamental entre la aleatoriedad clásica (pseudo) y cuántica (genuina) en la naturaleza?
implícito ninguno
real (kind = 8), intent (in) :: c, dt, dx, t, x, epsilon
real (tipo = 8) :: suma
entero :: itime, ispace
real (tipo = 8), dimensión (:), intento (in) :: u0
real (tipo = 8), dimensión (tamaño (u0)), intención (fuera) :: u
real (tipo = 8), dimensión (tamaño (u0)) :: ut_last, utemp_J
! real (tipo = 8), externo :: norm2
u = u0
print *, nint (t / dt)
print *, nint (x / dx), c * dt / dx
Do itime = 1, nint (t / dt) +1
! ============ Jacobi iteration ============
ut_last = u
hacer
suma = 0
utemp_J = u
do ispace = 2, nint (x / dx)! obtenga Xn + 1 por Xn
u (ispace) = ut_last (ispace) -c * dt / 2.d0 / dx * (utemp_J (ispace + 1) -utemp_J (ispace-1))
sum = (u (ispace) -utemp_J (ispace)) ** 2 + sum
! print *, “used”, u (ispace), utemp_J (ispace)
enddo
u (1) = ut_last (1) -c * dt / 2.d0 / dx * (utemp_J (2) -utemp_J (nint (x / dx)))
u (nint (x / dx) +1) = u (1)
sum = (u (1) -utemp_J (1)) ** 2+ (u (nint (x / dx) +1) -utemp_J (nint (x / dx) +1)) ** 2 + sum
! print *, sum
sum = (sum / (ispace + 1)) ** (1.d0 / 2)! obtenga la norma 2
! if (norm2 (utemp_J-u) <epsilon) sale
! print *, sum, epsilon
if (sum <epsilon) sale
enddo
! u (1) = ut_last (1) -c * dt / dx * (ut_last (1) -ut_last (nint (x / dx)))
print *, itime
enddo
finalizar subrutina one_d_linear_convt_impl