Python
Python
clear all
close all
clc
syms t
a = I(1);
b = I(2);
L = (b - a) / 2;
a0 = int(f, a, b) / L;
Fx = a0 / 2;
for n = 1:m
figure;
Fx = vpa(Fx, 4);
hold on
hold off
end
disp(Fx)
PAGE RANKING== 2
clear all
clc
[V, D] = eig(A);
for i = 1:length(A)
X = V(:, i);
break;
end
end
pn = ('A':'E');
pn = pn(I);
disp(pn)
METHOD OF VARIATION == 3
clear all
close all
clc
syms c1 c2 x m
m = solve(AE);
m1 = m(1); m2 = m(2);
D = b^2 - 4 * a * c;
y1 = exp(m1 * x);
y2 = exp(m2 * x);
y1 = exp(m1 * x);
y2 = x * exp(m1 * x);
alfa = real(m1);
beta = imag(m1);
end
yc = c1 * y1 + c2 * y2;
fx = f / a;
W = y1 * diff(y2, x) - y2 * diff(y1, x); % Wronskian
u = int(-y2 * fx / W, x);
v = int(y1 * fx / W, x);
yp = y1 * u + y2 * v;
y_gen = yc + yp;
check = input('If the problem has ini al condi ons then enter 1 else enter 2: ');
if check == 1
dy_gen = diff(y_gen);
y = simplify(subs(y_gen));
disp(y);
else
y = simplify(y_gen);
disp(y);
end
LAPLACE METHOD== 4
clear all
clc
syms t s y(t) Y
dy(t) = diff(y(t));
IC = input("Enter the ini al condi ons in the form [y0, Dy(0)]: ");
LTY = subs(LTY, {laplace(y(t), t, s), y(0), subs(diff(y(t), t), t, 0)}, {Y, y0, dy0});
eq = collect(LTY, Y);
Y = simplify(solve(eq, Y));
yt = simplify(ilaplace(Y, s, t));
disp(yt)
A=input('Enter A: ');
[P D]=eig(A);
X = P*[Sol1;Sol2];
if upper(ch) == 'Y'
t0=Cond(1);x10=Cond(2);x20=Cond(3);
solve(eq1,eq2);
X=subs(X);
else
t0=0;x10=0;x20=0;
eq1=subs(X(1)-x10,t0);eq2=subs(X(2)-x20,t0); X=subs(X);
end
clear all
syms y(n) z Y
ysol = simplify(ysol);
EIGEN VALUE AND EIGEN VECTOR==7
clc;
clear all;
syms L
eq = det(A - L * eye(s)) == 0;
disp('Eigenvalues are:');
disp(eigenvalues);
for i = 1 : length(eigenvalues)
disp(eigenvectors);
end