least square approcah for method of moments fourth order non linear differential equations
Info
This question is closed. Reopen it to edit or answer.
Show older comments
hi
plz help
How can we apply least square approach for the convergence of solution for this given code.
%%MoM Solution
syms f(x)
%MoM Solution
syms k(x)
k = 1*x^2+1*x+1.05;
%L=diff(y,x,2)
%weight n is chosen to satisfy the boundary conditions stated above
N = 1;
for n = 1:N
t(n) = x - x^(n+1);
end
%For Galerkin's Mom the weighting functions are the same as the basis
%functions
M = N; %M=N
%for j=1:N
% weight(j)=basis(j);
for m = 1:M
w(m) = x - x^(m+1);
end
%Create Matrix Z
for i = 1:M
for j = 1:N
%-((9*(x.^2)+6)*f(4))-(((8*x)+3)*f(3))-(f(1)*f(2))-f(1)+(20*(x^2))+(13*x)+36];
temp = w(i).*(-(9*(x.^2)+6)*(diff(t(j),x,4))-((8*x+3)*(diff(t(j),x,3))- t(j)*diff(t(j),x,2) -1*(diff(t(j),x,1))));
% + w(i-1).*((a*x+b)*(diff(t(j),x,1)))+w(i-2).*(diff(t(j),x,0) +(a*x+b)*(diff(t(j),x,1))+(diff(t(j),x,0)))];
Z(i,j) = int(temp, 0, 1);
end
end
%Create' Vector V
for i = 1:N
temp = k*w(i);
V(i) = int(temp, 0, 1);
end
I = inv(Z)*V';
f(x) = 0;
for n = 1:N
f(x) = f(x) + I(n) * t(n);
end
ezplot(f(x), [0 10])
axis([0 10 0 140]);
title('MOM for N=1')
%legend('N=3')
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!