Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(scheme,'analytic'))
- %Pour la solution analytique nous allons devoir resoudre une
- %equation differentielle manuellement
- %
- %Nous allons resoudre l'equation differentiel suivante:
- %
- % U'(x) = -c [U(x)]^2
- %
- % Nous allons effectuer une resolution par partie
- %
- % dU(x)
- % ----- = -c [U(x)]^2
- % dx
- %
- % dU
- % ----------- = -c dx
- % [U(x)]^2
- %
- % -1 K
- % -------- = -c X - -----
- % [U(x)] c
- %
- % avec -K/c une constante
- %
- % 1
- % U(x) = ---------
- % c(X+K)
- %
- % Il nous reste a determiner la valeur de K. Mais nous savons que
- % U(X0) = U0. Nous avons qu'a isoler K et nous obtenons:
- K = 1/(c*U0) - X0;
- %Nous pouvons des maintenant ecrire notre fonction
- f = @(x)(1./(c.*(x+K)));
- % Il nous reste finalement a calculer la valeur de nos U(X)
- U = f(X);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement