03G. Effective potential revisited
Mingyang Lu
1/7/2024
Consider the following system:
null1 = null_fx(20, X_range, Y_range);
null2 = null_fy(20, X_range, Y_range);
figure('Units', 'inches', 'Position', [0, 0, 5, 5]);
plot(null1(:, 1), null1(:, 2), 'red', ...
'DisplayName', 'dX/dt=0','LineWidth', 2);
plot(null2(:, 1), null2(:, 2), 'blue', ...
'DisplayName', 'dY/dt=0','LineWidth', 2);
We perform the following two calculations.
First, we compute the potential along the first nullcline,
.
.Second, we can also compute the potential along the second nullcline,
.
.% Integrate along nullclines
U1 = cal_int_2D_line(null1, @derivs_ts);
U2 = cal_int_2D_line(null2, @derivs_ts);
% Plot the results (along X)
figure('Units', 'inches', 'Position', [0, 0, 5, 5]);
plot(U1(:, 1), U1(:, 3), 'black', 'DisplayName', 'along dX/dt=0' ...
plot(U2(:, 1), U2(:, 3), 'red', 'DisplayName', 'along dY/dt=0' ...
ylabel('Effective Potential');
% Plot the results (along Y)
figure('Units', 'inches', 'Position', [0, 0, 5, 5]);
plot(U1(:, 2), U1(:, 3), 'black', 'DisplayName', 'along dX/dt=0' ...
plot(U2(:, 2), U2(:, 3), 'red', 'DisplayName', 'along dY/dt=0' ...
ylabel('Effective Potential');
Define MATLAB functions
1. Define derviatives function for a toggle swtich circuit
function dXdt = derivs_ts(t, Xs)
dXdt(1) = 5 + 20 / (1 + (Xs(2) / 100)^4) - 0.1 * Xs(1);
dXdt(2) = 5 + 20 / (1 + (Xs(1) / 100)^4) - 0.1 * Xs(2);
2. Generate nullcline for dX/dt = 0
function results = null_fx(gX, X_range, Y_range)
Y_all = linspace(Y_range(1), Y_range(2), 1000);
X_all = (5 + gX ./ (1 + (Y_all ./ 100).^4)) ./ 0.1;
results = [X_all', Y_all'];
3. Generate nullcline for dY/dt = 0
function results = null_fy(gY, X_range, Y_range)
X_all = linspace(X_range(1), X_range(2), 1000);
Y_all = (5 + gY ./ (1 + (X_all ./ 100).^4)) ./ 0.1;
results = [X_all', Y_all'];
4. Integrate f = derivs along a line with the trapezoidal rule
function result = cal_int_2D_line(line, derivs)
dx = line(i + 1, 1) - line(i, 1);
dy = line(i + 1, 2) - line(i, 2);
dX_i1 = derivs(0, Xs_i1)';
U_all(i + 1) = U_all(i) - (dX_i(1) + dX_i1(1)) / 2 * dx - (dX_i(2) + dX_i1(2)) / 2 * dy;