MATLAB Session -- Deriving finite-difference approximations

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 11

  • @jeffreyseverino4486
    @jeffreyseverino4486 5 лет назад +3

    Great video! I recreated this code as a function that allows the user to input the number of points they would like! Here's the code:
    Instead of:
    syms h f1 f2 f3
    %Define offset points
    x = [ -h; 0; h];
    f = [f1; f2; f3];
    Replace with
    syms f [1 nPoints]
    syms h
    %Define offset points
    % the lower/upper coefficient of the offset point will be odd if central
    % difference. We can express this as nPoints = 2C - 1 , k = 1 , 2 , 3 ...
    % Solving for C
    f = f.';
    C = (nPoints - 1)/2;
    x = (-C:C).*h;
    x = x.';
    Thanks!!!!!!! This is useful for my linear advection calculation comparison!

  • @luisguevara154
    @luisguevara154 6 лет назад +2

    The first lesson to learn when entering the world of finite differences

    • @shadmankhan110
      @shadmankhan110 6 лет назад

      u r rt luis..btw can u help me in implementing finite difference using symbolic toolbox ??
      I have 2 pde in 2 dependent variables
      I apply finite diference in space & time
      I get finite difference equation
      now since my pde are non linear also ..I cannot solve it but simply A\B technique
      I have to use NEWTON RAPHSON METHOD FOR SYSTEM OF NON LINEAR EQAUTIONS
      Each node equation is non linear equation
      how do I differentiate it symbolically?
      I am at a loss in implementing NEWTON RAPHSON SYMBOLICALLY IN MATLAB FOR SYSTEM OF EQUATIONS FOR FINITE DIFFERENCE?????

  • @amorfati9861
    @amorfati9861 3 года назад +2

    Give the man a Beer !!! Thank you !

    • @empossible1577
      @empossible1577  3 года назад +3

      I'll take it! I like Russian Imperial Stouts, dark wheats, and plenty of others.

  • @shadmankhan110
    @shadmankhan110 6 лет назад +3

    I have 2 pde in 2 dependent variables
    I apply finite diference in space & time
    I get finite difference equation
    now since my pde are non linear also ..I cannot solve it but simply A\B technique
    I have to use NEWTON RAPHSON METHOD FOR SYSTEM OF NON LINEAR EQAUTIONS
    Each node equation is non linear equation..SO DIFFERENTIATE IT..MAKE A JACOBIAN
    how do I differentiate it symbolically?
    I am at a loss in implementing NEWTON RAPHSON SYMBOLICALLY IN MATLAB FOR SYSTEM OF EQUATIONS FOR FINITE DIFFERENCE?????
    Show less

    • @empossible1577
      @empossible1577  6 лет назад +1

      Can you use the secant method and solve your problem numerically? The secant method is essentially a fully numerical version of the Newton-Raphson method. See Lecture 4b in this video series.

  • @karishmajoshi1279
    @karishmajoshi1279 4 года назад +1

    I want to solve a waveguide problem by FDM metrix method can you please help me !

    • @empossible1577
      @empossible1577  3 года назад

      Sorry. I somehow missed your question. If are you willing to spend a little money, here is your answer...
      empossible.thinkific.com/courses/fdmhybridmodes

  • @wenjieyu6242
    @wenjieyu6242 5 лет назад +1

    Strictly speaking, this is not programming finite difference in matlab. It's more like writing the analytical solution of FD, which can be done by hand, with matlab.

    • @empossible1577
      @empossible1577  5 лет назад

      You are correct. This video merely shows how to derive the finite-difference approximations. It does not show you how to use those to perform numerical differentiation or to solve differential equations. That happens in later videos and lectures.
      It is also possible to do this on paper, however, a numerical approach is needed if you ever implement the finite-difference method on an unstructured or nonuniform grid.