Git Product home page Git Product logo

22_6xx-dg-for-pdes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

22_6xx-dg-for-pdes's Issues

Can't understand the formulation of ExactRHS in Module 2

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 $\int u_h \phi = \int u_0 \phi$. According to my understanding, I would like to formulate as follows,

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 $\int u_0 \phi$ and the definite integral is over every single element. However, the above formulations give different result.

The plot of your formulation is

rhs

While my formulation output as follows,

f

Could you point out why I'm wrong? Thanks!

There maybe some errors in Module 3B

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.