Script.txt

  • Uploaded by: Ayoub Frigini
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Script.txt as PDF for free.

More details

  • Words: 76
  • Pages: 1
n=6; t=20000; r=0.25; Ta=100; Tb=10; for i=1:(n-2) N0(i)=0; end N0(1)=r*Ta; N0(n-2)=r*Tb; for i=1:n-3 M(i,i)=1-2*r; M(i,i+1)=r; M(i+1,i)=r; end M(n-2,n-2)=1-2*r; u=zeros(n-2,1); for i=1:t u=M*u+N0'; end --------------------------------function y = tridiag( a, b, c, f ) n = length(f); v = zeros(n,1); y = v; w = a(1); y(1) = f(1)/w; for i=2:n v(i-1) = c(i-1)/w; w =a(i)-b(i)*v(i-1); y(i) = ( f(i) - b(i)*y(i-1) )/w; end for j=n-1:-1:1 y(j) = y(j) - v(j)*y(j+1); end -----------------------------f=zeros(9,1); f(1)=-100; f(9)=-10; y = tridiag(-2*ones(length(f),1),1*ones(length(f),1),1*ones(length(f),1),f)

More Documents from "Ayoub Frigini"

Gest Projet.docx
June 2020 11
November 2019 12
Script.txt
December 2019 21
Cours-ensa_lyon.pdf
December 2019 14
Ayoub Aydi Cv-19.docx
May 2020 12
Comportement_asym
April 2020 11