
%%%%%%%%%%%%%%%% 第一部分：数据中间商市场结构与国家福利 %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% 第一部分：数据中间商市场结构与国家福利 %%%%%%%%%%%%%%%%
%% Figure: beta与国家U的福利
clear; clc; close
warning('off','all')

load ("data\Baseline.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.wel_u, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3.wel_u, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{U} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.wel_u, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4.wel_u, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{U} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV1 不同数据中间商市场结构以及不同数据政策下国家𝑈的福利\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV1.png', 'Resolution', 1200);

%% Figure: beta与国家C的福利
clear; clc; close
warning('off','all')

load ("data\TariffNash.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.wel_c, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3.wel_c, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{C} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.wel_c, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4.wel_c, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{C} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV2 不同数据中间商市场结构以及不同数据政策下国家𝐶的福利\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV2.png', 'Resolution', 1200);


%%%%%%%%%%%%%%%% 第二部分：数据中间商市场结构与贸易政策 %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% 第二部分：数据中间商市场结构与贸易政策 %%%%%%%%%%%%%%%%
%% Figure：垄断模式下国家C和国家U最优关税对比
clear; clc; close
warning('off','all')

load ("data\TariffUnilateral_CU.mat");
load ("data\TariffUnilateral_UC.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case3_cu.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3_uc.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case4_cu.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4_uc.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2], {'国家C', '国家U'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV3 垄断模式下国家𝑈和国家𝐶的最优关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV3.png', 'Resolution', 1200);


%% Figure: beta与国家U的最优贸易政策
clear; clc; close
warning('off','all')

load ("data\TariffUnilateral_UC.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1_uc.t_uc, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3_uc.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2_uc.t_uc, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4_uc.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV4 不同数据中间商市场结构以及不同数据政策下国家𝑈的最优关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV4.png', 'Resolution', 1200);

%% Figure: beta与国家C的最优贸易政策
clear; clc; close
warning('off','all')

load ("data\TariffUnilateral_CU.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1_cu.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3_cu.t_cu, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2_cu.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4_cu.t_cu, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV5 不同数据中间商市场结构以及不同数据政策下国家𝐶的最优关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV5.png', 'Resolution', 1200);



%% Figure：垄断模式下国家C和国家U纳什关税对比
clear; clc; close
warning('off','all')

load ("data\TariffNash.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case3.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case4.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2], {'国家C', '国家U'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV6 垄断模式下国家𝑈和国家𝐶的纳什关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV6.png', 'Resolution', 1200);




%% Figure: beta与国家U的纳什关税
clear; clc; close
warning('off','all')

load ("data\TariffNash.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.t_uc, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.t_uc, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4.t_uc, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV7 不同数据中间商市场结构以及不同数据政策下国家𝑈的纳什关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV7.png', 'Resolution', 1200);


%% Figure: beta与国家C的纳什关税
clear; clc; close
warning('off','all')

load ("data\TariffNash.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
line(beta, Case3.t_cu, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.t_cu, 'Color', 'k', 'LineStyle', '-.', 'LineWidth', 1.2);
h2 = line(beta, Case4.t_cu, 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1,h2], {'竞争','垄断'}, ...
    'Orientation','horizontal','Box','off','FontSize',10);
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV8 不同数据中间商市场结构以及不同数据政策下国家𝐶的纳什关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV8.png', 'Resolution', 1200);


%%%%%%%%%%%%%%%% 第三部分：突破路径模拟：算力比较优势与贸易政策 %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% 第三部分：突破路径模拟：算力比较优势与贸易政策 %%%%%%%%%%%%%%%%
%% Figure: beta、B与国家U的福利
clear; clc; close
warning('off','all')

load ("data\Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.wel_u(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1.wel_u(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1.wel_u(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{U} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.wel_u(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2.wel_u(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2.wel_u(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{U} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV9 竞争模式下国家𝐶算力进步时国家𝑈的福利变化\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV9.png', 'Resolution', 1200);


%% Figure: beta、B与国家C的福利
clear; clc; close
warning('off','all')

load ("data\Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.wel_c(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1.wel_c(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1.wel_c(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{C} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.wel_c(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2.wel_c(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2.wel_c(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.0f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ U_{C} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV10 竞争模式下国家𝐶算力进步时国家𝐶的福利变化\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV10.png', 'Resolution', 1200);


%% Figure: beta、B与国家U的最优关税
clear; clc; close
warning('off','all')

load ("data\TariffUnilateral_Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1_uc.t_uc(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1_uc.t_uc(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1_uc.t_uc(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2_uc.t_uc(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2_uc.t_uc(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2_uc.t_uc(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV11 竞争模式下国家𝐶算力进步时国家𝑈的最优关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV11.png', 'Resolution', 1200);


%% Figure: beta、B与国家C的最优关税
clear; clc; close
warning('off','all')

load ("data\TariffUnilateral_Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1_cu.t_cu(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1_cu.t_cu(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1_cu.t_cu(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2_cu.t_cu(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2_cu.t_cu(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2_cu.t_cu(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV12 竞争模式下国家𝐶算力进步时国家𝐶的最优关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV12.png', 'Resolution', 1200);


%% Figure: beta、B与国家U的纳什关税
clear; clc; close
warning('off','all')

load ("data\TariffNash_Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.t_uc(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1.t_uc(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1.t_uc(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.t_uc(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2.t_uc(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2.t_uc(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{UC} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV13 竞争模式下国家𝐶算力进步时国家𝑈的纳什关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV13.png', 'Resolution', 1200);


%% Figure: beta、B与国家C的纳什关税
clear; clc; close
warning('off','all')

load ("data\TariffNash_Tech.mat");

picture = figure('Color', 'white', 'Units', 'centimeters', 'Position', [0, 0, 30, 12]);

% 子图1
ax1 = subplot(1, 2, 1);
hold on;
line(beta, Case1.t_cu(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
line(beta, Case1.t_cu(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
line(beta, Case1.t_cu(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{禁止流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

% 子图2
ax2 = subplot(1, 2, 2);
hold on;
h1 = line(beta, Case2.t_cu(:,1), 'Color', 'k', 'LineStyle', ':', 'LineWidth', 1.5);
h2 = line(beta, Case2.t_cu(:,2), 'Color', 'k', 'LineStyle', '--', 'LineWidth', 1.2);
h3 = line(beta, Case2.t_cu(:,3), 'Color', 'k', 'LineStyle', '-', 'LineWidth', 1.2);
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%.2f'));
xlabel('$ \beta $','Interpreter','latex', 'FontSize',12);
ylabel('$ t_{CU} $','Interpreter','latex', 'FontSize',12);
title('\fontname{SimSun}{自由流动}', ...
    'Interpreter','tex','FontSize',12);
% grid on; set(gca, 'GridLineStyle', ':', 'GridColor', [0.7 0.7 0.7], 'GridAlpha', 0.7);

lgd = legend([h1, h2, h3], {'$B_C = 0.5$', '$B_C = 1$', '$B_C = 1.5$'}, ...
    'Orientation', 'horizontal','Box', 'off','FontSize', 10,'Interpreter', 'latex');lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.Position = [0.3 0.000001 0.6 0.05];  % 手动调整位置使其居中
lgd.ItemTokenSize = [25, 4];

fprintf('\n=================================================================\n');
fprintf('         图XIV14 竞争模式下国家𝐶算力进步时国家𝐶的纳什关税\n');
fprintf('=================================================================\n\n');
exportgraphics(picture, 'result/图XIV14.png', 'Resolution', 1200);













