The code is from the book(SDE). I think P.n := evalm( P.(n-1)&*P0) causes the problem. I have never seen this kind of the structure before ( I did some coding with C and Java). Could you explain that? P0, P1, P2,,,, using for n from 1 to 10. Is "." between P and n the dot (period)? Thank you in advance.
> |

|
> |

|
> |

|
> |

|
> |

|
> |
![P := matrix(dimP, dimP, [`$`(0, dimP*dimP)])](/view.aspx?sf=227183_question/70384c408e900eb90e628c2b8655ff74.gif)
|
> |
![P[1, 1] := sa; P[1, 2] := 1-sa; P[dimP, dimP] := sb; P[dimP, dimP-1] := 1-sb](/view.aspx?sf=227183_question/367f63c37ef8e67d4ec4ab4be7f53bcf.gif)
|
> |
![for i from 2 to dimP-1 do P[i, i-1] := q; P[i, i] := r; P[i, i+1] := p end do](/view.aspx?sf=227183_question/97137c9c4d05f6fd426a3bafad986dd4.gif)
|
> |

|
> |

|
> |

|

|
(1) |
> |

|
|
Download TransitionMatix.mw