euler polynomial into a matrix form
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Matlab code
hello anyone can help me
I want to find an approximate solution for volterra integral
with truncated euler series with weighted residual method,
in the method I want to find multiple matrices,
I tried with matlab but it doesn't seem to work,
%start
clear;
clc;
syms x t c
n=3;
f(c)=6*c-3*c^2 ;
%determine matrices E and K with collocation point c = {0, 1/3, 1}
c=0;
E=[];
K=[];
for i=1:n;
E(i)=euler(i,c);
K(i)=int(euler(i,t),0,c);
end
E1=E'
K1=K'
F1=f(c)
%c=1/3
c=1/3;
E=[];
K=[];
for i=1:n;
E(i)=euler(i,c);
K(i)=int(euler(i,t),0,c);
end
E2=E'
K2=K'
F2=f(c)
%c=1
c=1;
E=[];
K=[];
for i=1:n;
E(i)=euler(i,c);
K(i)=int(euler(i,t),0,c);
end
E3=E'
K3=K'
F3=f(c)
%combine
matrixE=[E1 E2 E3]
matrixK=[K1 K2 K3]
%matrix F
F=[F1 F2 F3]'
%matrix E-K
EK=matrixE-matrixK
%find the coefficient [E-K]X=F => X=inv(E-K)*F
X=inv(EK)*F
%approximate solution
Ua=matrixE*X
%exact solution is u=6*c
%maybe anyone can help me
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!