summaryrefslogtreecommitdiff
path: root/1670/CH9/EX9.15/9_15.sce
blob: 0c29aa0abd9c725255c39d54d3749b1e3a21fc96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//Example 9.15
//Particular Solution
//Page no. 296
clc;clear;close;

x=poly(0,'x')
n=2;
f=x^(n)-1*x^(n-1)-2*x^(n-2);
z=roots(f)
disp(z,f)
printf('\n\n')
printf('            n        n\nC.F. = ')
for i=1:n
    printf('c%i(%g)',i,z(i))
    if i~=n then
        printf(' + ')
    end
end
A=[5/8,0;1/2,5/8];
B=[3;0]
C=inv(A)*B;
printf('\n\n\t \t    n\t   \nP.I = (%gn%g)(4)',C(1),C(2))