%% Menductance functions for use with memristorAudio.m 
%% and memristorAudioSIMPLEST.m
%% Bharathwaj Muthusway, July 17th 2008
%% mbharat@cory.eecs.berkeley.edu

function r=W(y)
    if y(1) <= -1.5e-4
        r = 43.25e-4;
    elseif y(1) > -1.5e-4 && y(1) <= -0.5e-4
        r = -9.33*y(1)-9.67e-4;
    elseif y(1) > -0.5e-4 && y(1) < 0.5e-4
        r = -5.005e-4;
    elseif y(1) >= 0.5e-4 && y(1) < 1.5e-4
        r = 9.33*y(1)-9.67e-4;
    else
        r = 43.25e-4;
    end
end