필터 지우기
필터 지우기

euler polynomial into a matrix form

조회 수: 1 (최근 30일)
Relly Syam
Relly Syam 2021년 3월 27일
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개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by