0

我试图使用 Julia 制作曲面图。但是我在运行程序时遇到错误找到附加的错误

using LinearAlgebra, SparseArrays, Plots, DifferentialEquations
using Surrogates
using Plots
gr()
L=20
N=100
k=50
x=range(0, stop=100, length=100);
dx=x[2]-x[1];
dt=0.5*dx^2/(2*k);
t=0:dt:10
# print("the vlues of t",t)
T=zeros(length(t),length(x))
s=size(T)
print("size of matrix",s)
T[1,2]=T[1,1]=100 #complete 1st row
T[end,end]=150  #last row of a matrix
 for i in 2:1960
    for j=1:99
        T[i,j+1]=T[i,j]+k*dt/(dx^2)*(T[i+1,j]-2*T[i,j] + T[i-1,j])
    end
end
surface(x,t,T)

4

0 回答 0