program_1a.m
来自「《Dynamical Systems with Applications usi」· M 代码 · 共 23 行
M
23 行
% Chapter 1 - Linear Discrete Dynamical Systems.
% Program 1a - Solving Recurrence Relations.
% Symbolic Math toolbox required.
% Copyright Birkhauser 2004. Stephen Lynch.
% Solving a first order recurrence relation (Example 1).
% Call a Maple command from the Symbolic Math toolbox.
xn=maple('rsolve({x(n+1)-(1+(3/(100)))*x(n),x(0)=10000},x)')
n=5
savings=vpa(eval(xn),7)
%Solving a second order recurrence relation (Example 2(i)).
clear
xn=maple('rsolve({x(n+2)-x(n+1)-6*x(n),x(0)=1,x(1)=2},x)')
% Solving a characteristic equation (Example 2(iii)).
syms lambda
CE=lambda^2-lambda+1
lambda=solve(CE)
% End of Program 1a.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?