Skip to content

Instantly share code, notes, and snippets.

@samubernard
samubernard / svd_lowrank.py
Last active August 29, 2015 14:10
Exemple d'approximation d'une matrice image par des matrices de bas rangs.
from numpy import *
# chargez une image stockée dans un tableau (image monocolore)
im = genfromtxt('image.csv')
# Décomposition en valeurs singulières
U, s, Vs = linalg.svd(im, full_matrices=True)
# Dimension des matrices
U.shape
@samubernard
samubernard / methode_puissance.py
Last active December 7, 2015 01:00
Méthode de la puissance pour le calcul des valeurs propres -- code phyton
# coding: utf-8
## Méthode de la puissance pour le calcul de valeurs propres
# In[1]:
from numpy import *
import matplotlib as plt
import pylab as pl
@samubernard
samubernard / tennis_ranking.ipynb
Created September 18, 2016 08:56
Exemple de classement WTP par vecteur propre dominant
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samubernard
samubernard / algo_QR_pur.ipynb
Last active September 18, 2016 09:07
Exemple algorithme QR pur pour le calcul des valeurs propres
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samubernard
samubernard / polynome_wilkinson.ipynb
Last active September 18, 2016 09:07
Exemple de calcul de racines d'un polynôme
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samubernard
samubernard / turing.m
Created May 8, 2017 20:07
Equations de Turing (linéaires 1D spatial)
function [c,f,s] = turing(x,t,u,DuDx)
% TURING PDE components for the Turing equations
%
% Examples
% x = -20:0.1:20;
% t = 0:20;
% sol = pdepe(0,@turing,@turingic,@turingbc,x,t);
% u = sol(:,:,1);
% v = sol(:,:,2);
% imagesc(x,t,u); axis xy;
@samubernard
samubernard / kuramoto.m
Created May 16, 2017 11:19
Oscillateurs de Kuramoto
function sol = kuramoto
% KURAMOTO Systeme d'oscillateurs de phase couples
% sol = kuramoto resoud un systeme de N d'oscillateurs de phase couples
% intervalle d'integration
t0 = 0;
tfinal = 500;
% nombre d'oscillateurs
N = 400;
@samubernard
samubernard / methode_puissance.ipynb
Last active May 14, 2018 13:31
Méthode de la puissance pour le calcul des valeurs propres -- notebook iphyton
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.