【问题标题】:Recurrence relations in Maple using MatricesMaple 中使用矩阵的递归关系
【发布时间】:2017-11-12 20:52:26
【问题描述】:

所以就像标题暗示的那样,我正在使用枫树做一个涉及使用重复的项目。

作为前任。假设我们有一个名为 A3x3 矩阵,我们将它乘以 3x1(B) 然后相加到一个 3x1(C) 并且得到的矩阵被用作新的 B 并且我们做同样的操作。我将如何在 maple 中执行此操作?

【问题讨论】:

    标签: matrix linear-algebra recurrence maple


    【解决方案1】:

    您可以使用procedure

    recurrence := proc(A,b,c,n)
        ## A is a k x k matrix
        ## b is a 1 x k vector
        ## c is a 1 x k vector
        ## n is the number of iterations
    
        local btemp, i;
    
        btemp := b;
    
        for i to n do
            btemp := A.btemp+c;
        end do;
    end proc:
    

    使用示例:

    A:= <<1,4,7>|<2,5,8>|<3,6,9>>;
    b:=<1/10,1/10,1/10>;
    c:=<-1,2,-2>;
    seq(recurrence(A,b,c,n),n = 1..3);  ## Output the recurrence for 1,2 and 3 iterations
    

    【讨论】:

      猜你喜欢
      • 2012-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-16
      相关资源
      最近更新 更多