天天看點

文學文享(47):三方演化博弈Matlab仿真學習

作者:LearningYard學苑
文學文享(47):三方演化博弈Matlab仿真學習

分享興趣,傳播快樂,增長見聞,留下美好。

親愛的您,這裡是LearningYard新學苑!

今天小編為大家帶來三方演化博弈Matlab仿真學習分享。

歡迎您的通路!

Share interest, spread happiness, increase knowledge, and leave beautiful.

Dear, this is the LearingYard Academy!

Today, the editor brings the learning from matlab simulation of tripartite evolutionary games.

Welcome to visit!

1 内容摘要(Content summary)

今天小編将從“思維導圖、精讀内容、知識補充”三個闆塊,解讀分享三方演化博弈Matlab仿真學習。

Today, the editor will interpret and share the learning from matlab simulation of tripartite evolutionary games from the three sections of "mind map, intensive reading content, and knowledge supplement".

2 思維導圖(Mind mapping)

文學文享(47):三方演化博弈Matlab仿真學習

3 精讀内容(Intensive reading content)

本次将對三方演化博弈Matlab仿真部分進行學習。在進行Matlab仿真前,要進行參數指派這一步驟,這也是數值仿真的前提,是十分重要的一步。一般來說,複制動态方程中出現的所有值都要進行指派,對這些值進行指派可依據穩定性的結果、現實案例或者二者的結合來進行。

This session will focus on learning the Matlab simulation part of the triadic evolutionary game. Before performing the Matlab simulation, it is necessary to perform parameter assignment, which is a crucial step and the prerequisite for numerical simulation. Generally, all values appearing in the replicator dynamic equations need to be assigned. These values can be assigned based on stability results, real-world cases, or a combination of both.

文學文享(47):三方演化博弈Matlab仿真學習

将參數要賦的值确定好後,便可将所需要的代碼輸入到Matlab中,本次以一篇在系統工程理論與實踐期刊上發表的文章為例,将其三方演化博弈模型中的三個複制動态方程輸入到Matlab中。此代碼建立了一個三元一次方程組,每條代表一個複制動态方程,其中t表示系統運作的時間。

After determining the values to assign to the parameters, you can input the required code into Matlab. This time, using an article published in the Journal of Systems Engineering Theory and Practice as an example, we will input the three replicator dynamic equations from its triadic evolutionary game model into Matlab. This code creates a system of three first-order equations, each representing a replicator dynamic equation, where t represents the system's running time.

文學文享(47):三方演化博弈Matlab仿真學習

然後另建立一個腳本,裡面輸入繪圖的代碼。代碼中最上方的三行for代表xyz三者的取值,都是從0.1開始,到0.9截止的相同數值。設定好取值後,使用ode45函數進行求解,并使用plot3函數繪制三維圖,同時為圖像加上網格,為坐标軸命名。

Next, create another script to input the plotting code. The top three lines of the code use for loops to represent the values of x, y, and z, all ranging from 0.1 to 0.9 with the same values. After setting the values, use the ode45 function to solve the equations and the plot3 function to draw a 3D plot, adding a grid to the image and naming the axes.

文學文享(47):三方演化博弈Matlab仿真學習

以下就是運作上述程式得到的圖像,每條線條代表一次演化的路徑,其中較為分散的一端是演化的初始位置,而所有線條彙聚的地方是演化的末尾。從圖中我們可以看出,無論初始值如何,最終的演化結果都将趨于統一,在此圖中演化的結果為z向1演化,而x和y都向0演化。

The following is the image obtained by running the above program. Each line represents an evolution path, where the more dispersed end is the initial position of the evolution, and the converging points of all lines are the end of the evolution. From the figure, we can see that regardless of the initial values, the final evolution results will tend to be uniform. In this figure, the evolution result is that z evolves towards 1, while x and y evolve towards 0.

圖中所得到的演化結果的依據是前面我們進行的參數指派,此組參數的值滿足向此種情況演化的條件,故三者才出現此種演化結果。這樣的演化結果可以說明數值仿真模拟和理論分析的結果是一緻的,可以由此說明理論分析的結果是正确的。從圖中我們還可以看出不同初始值向最終結果演化的速率的快慢,那些較為筆直的線條代表較高的速率,而長度較長的曲線則代表速率較慢。

The evolutionary results obtained in the figure are based on the parameter assignments we performed earlier. The values of this set of parameters satisfy the conditions for evolving towards this situation, so the three exhibit this evolutionary result. Such an evolutionary result demonstrates that the numerical simulation and theoretical analysis results are consistent, indicating that the theoretical analysis results are correct. From the figure, we can also observe the speed of evolution from different initial values to the final result. The straighter lines represent higher speeds, while the longer curves represent slower speeds.

文學文享(47):三方演化博弈Matlab仿真學習

4 知識補充(Knowledge supplement)

什麼是ode45函數?

What is the ode45 function?

ode是Matlab專門用于解微分方程的功能函數。該求解器有變步長和定步長兩種類型。不同類型有着不同的求解器,其中ode45求解器屬于變步長的一種,采用Runge-Kutta算法。ode45表示采用四階-五階Runge-Kutta算法,它用4階方法提供候選解,5階方法控制誤差,是一種自适應步長,即變步長的常微分方程數值解法,解決的是Nonstiff非剛性常微分方程。

The ode function in Matlab is specifically used for solving differential equations. The solver has two types: variable step size and fixed step size. Different types have different solvers, and the ode45 solver belongs to the variable step size type, using the Runge-Kutta algorithm. ode45 indicates the use of the fourth-order and fifth-order Runge-Kutta algorithm. It provides a candidate solution with the fourth-order method and controls the error with the fifth-order method. It is an adaptive step size, i.e., a variable step size numerical solution method for ordinary differential equations, solving Nonstiff (non-rigid) ordinary differential equations.

今天的分享就到這裡了。

如果您對今天的文章有獨特的想法,

歡迎給我們留言,

讓我們相約明天,

祝您今天過得開心快樂!

That's all for today's sharing.

If you have a unique idea about the article,

please leave us a message,

and let us meet tomorrow.

I wish you a nice day!

參考資料:

翻譯:ChatGPT 4o

文字:[三方演化博弈零基礎教學]matlab仿真部分_哔哩哔哩_bilibili

參考文獻:何鵬, 尚琦, 王先甲, 等. “直播+”背景下考慮平台監管的電商供應鍊演化博弈分析 [J]. 系統工程理論與實踐, 2023, 43(8): 2366-2379.

本文由LearningYard學苑整理并發出,如有侵權請背景留言溝通。

文案I姜瘋雨火

排版I姜瘋雨火

稽核Izjj

繼續閱讀