Bonjour, je suis débutant et j'utilise octave, je suis un peu perdu et j'aurais besoin d'un peu d'aide.
j'essaye de réaliser la résolution d'une équation différentielle grâce à la méthode aux différences
mon équation est (d²u/dx)+10(du/dx)-u-5=0
j'ai deux conditions (dirichlet et newmann)
(du/dx)=-10 en x=0
et u(x=L)=1
mon programme est le suivant:
Lorsque je compil mon programme des erreurs apparaissent et j'ai du mal à voir à quoi elles sont dues:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 clear all npoints=input('nbre de noeuds intérieurs = ') u1=-83./3; ul=1; l=1; h=l./(npoints+1); n=npoints+1; k=zeros(n,n); f=zeros(n,1) for i=1:n k(i,i)=-2-h.^2; k(i+1,i)=1-5.*h.^2; if i==1 k(i,i+1)=2; f(i)=-20.*h+105*h.^2; if i==n f(i)=5.*h.^2-5.*h-1; else k(i+1,i)=5.*h+1; f(i)=5.*h.^2; end end end u=[u1,k\f,ul]; end
merci par avance pour votre aidenbre de noeuds intérieurs = 10
npoints = 10
f =
0
0
0
0
0
0
0
0
0
0
0
error: operator \: nonconformant arguments (op1 is 12x11, op2 is 11x1)
error: evaluating binary operator `\' near line 24, column 8
error: evaluating assignment expression near line 24, column 2
error: near line 24 of file `diff.m'
error: matrix cannot be indexed with .
error: if: error evaluating conditional expression
error: evaluating if command near line 28, column 3
error: called from `octplot_atexit' in file `C:\Program Files\Octave\share\octpl
ot\m\octplot_atexit.m'
C:\Program Files\Octave\bin>
Partager