userjjb / 22_6xx-dg-for-pdes Goto Github PK
View Code? Open in Web Editor NEWAn intro to DG methods for PDEs
An intro to DG methods for PDEs
I've watched your youtube tutorial on DG and cloned this git repo. Thank you for the excellent explanation.
What I'm concerned is your demo MATLAB script in module 2.
In the demo script, I can't understant why you formulate ExactRHS such way:
ExactRHS(1, :) = ...
( tau * deltax .* cos(tau * xNode(1:end-1)) ...
+ sin(tau * xNode(1:end-1)) ...
- sin(tau * xNode(2:end)) ) ...
./ ( 4 * pi^2 * (deltax) );
ExactRHS(2, :) = ...
-( tau * deltax .* cos(tau * xNode(2:end)) ...
+ sin(tau * xNode(1:end-1)) ...
- sin(tau * xNode(2:end)) ) ...
./ ( 4 * pi^2 * (deltax) );
I know that the key idea behind the above is that
f1 = @(x) - sin(2*pi*x)/(4*pi^2) - (cos(2*pi*x)/2 - (x*cos(2*pi*x))/2)/pi;
f1_int = zeros(K, 1);
for i = 1 : K
x_init = xNode(i);
x_end = xNode(i+1);
f1_int(i) = f1(x_end) - f1(x_init);
end
f2 = @(x) (sin(2*pi*x) - 2*pi*x*cos(2*pi*x))/(4*pi^2);
f2_int = zeros(K, 1);
for i = 1 : K
x_init = xNode(i);
x_end = xNode(i+1);
f2_int(i) = f2(x_end) - f2(x_init);
end
They are the integral of
The plot of your formulation is
While my formulation output as follows,
Could you point out why I'm wrong? Thanks!
I directly execute the script SC1DLeg.m
and get the following error
>> SC1DLeg
Error using toeplitz (line 23)
Inputs must be numeric.
Error in SC1DLeg (line 86)
SelfStencil = 2*(toeplitz(mod(0:N,2),0:N<0))-ones(N+1);
I suppose the input parameters for toeplitz maybe be wrong. Please check.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.