【问题标题】:How can I enter this formula in Mathematica如何在 Mathematica 中输入此公式
【发布时间】:2021-06-19 11:17:35
【问题描述】:

enter image description here

我有以下 e' 的公式,其中 e'i 总是指 e'i-1 的先前结果。开始时存在 e' i=1 的边界条件。我怎样才能输入这个来得到一个包含所有值的矩阵?

i = 1 - 30

在 Matlab 中,我使用 For 循环对其进行管理

【问题讨论】:

    标签: wolfram-mathematica


    【解决方案1】:

    这是你想要的吗?

    eprime[1]=boundary;
    For[i=2,i<=4,i++,
      eprime[i]=e[i]/(d[i]-c[i]*eprime[i-1])==
      (-dt a/dx^2)/((2 dt a/dx^2+1)-(-dt a/dx^2)*eprime[i-1])]
    

    然后

    eprime[4]
    

    返回

    e[4]/(d[4] - c[4]*(e[3]/(d[3] - c[3]*(e[2]/(-(boundary*c[2]) + d[2]) == -((a*dt)/
    ((1 + (2*a*dt)/dx^2 + (a*boundary*dt)/dx^2)*dx^2)))) == -((a*dt)/(dx^2*(1 + (2*a*dt)/
    dx^2 + (a*dt*(e[2]/(-(boundary*c[2]) + d[2]) == -((a*dt)/((1 + (2*a*dt)/dx^2 +
    (a*boundary*dt)/dx^2)*dx^2))))/dx^2))))) == -((a*dt)/(dx^2*(1 + (2*a*dt)/dx^2 + 
    (a*dt*(e[3]/(d[3] - c[3]*(e[2]/(-(boundary*c[2]) + d[2]) == -((a*dt)/((1 + (2*a*dt)/
    dx^2 + (a*boundary*dt)/dx^2)*dx^2)))) == -((a*dt)/(dx^2*(1 + (2*a*dt)/dx^2 + (a*dt*
    (e[2]/(-(boundary*c[2]) + d[2]) == -((a*dt)/((1 + (2*a*dt)/dx^2 + (a*boundary*dt)/
    dx^2)*dx^2))))/dx^2)))))/dx^2)))
    

    然后,您可以将 For 的限制提高到 20,并为您知道的任何事物分配值,然后查看结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多