Anda di halaman 1dari 4

Model Predator (Pemangsa) - Prey

(Mangsa)

Bagian 1. Latar Belakang


Baris berikut memuat eskpresi untuk penggunaan paket yang diperlukan (PlotField)
<< Graphics`PlotField`

Part 2. The Lotka-Volterra Model


Bagian 2. Model Lotka-Volterra
Input nilai a, b, c, p: sebagai contoh:
a = 1;
b = 0.03;
c = 0.4;
p = 0.01;

Dalam kelompok berikut ini beberapa ekspresi yang perlu diinput untuk membuat grafik/kurva
medan arah dari persamaan Lotka-Volterra LV1 dan LV2.
LV1 = x '@tD == a * x@tD - b * x@tD * y@tD;
LV2 = y '@tD == - c * y@tD + p * x@tD * y@tD;
system = 8LV1, LV2<;

fieldPlot = PlotVectorField@81, H- c * y + p * x * yL  Ha * x - b * x * yL<,


8x, 0, 140<, 8y, 0, 80<, PlotLabel ® "Lotka-Volterra Model",
AxesLabel ® 8"x", "y"<, ScaleFunction ® H0.25 &L, Axes ® TrueD;

Ekspresi perintah berikut memplot beberapa lintasan/ trayektori untuk beberapa nilai awal yang
diberikan dalam sebuah daftar nilai awal untuk masing-masing x dan y pada saat waktu bernilai 0.
initial = 88x@0D == 15, y@0D == 15<,
8x@0D Š 20, y@0D Š 20<, 8x@0D Š 25, y@0D Š 25<, 8x@0D Š 30, y@0D Š 30<<;
solutions = Table@NDSolve@Join@system, initial@@kDDD, 8x, y<, 8t, 0, 12<D,
8k, Length@initialD<D
solutionsPlot = Table@ParametricPlot@Evaluate@8x@tD, y@tD< . solutions@@iDDD,
8t, 0, 12<, PlotStyle ® RGBColor@0, 0, 1D,
DisplayFunction ® IdentityD, 8i, Length@initialD<D;

Show@fieldPlot, solutionsPlot, DisplayFunction ® $DisplayFunctionD;

Berikut ini ekspresi perintah untuk mengkalkulasi koordinat titik equilibrium.


2 model_matematika_predprey_SistemPDB_orde1_nonlinear_2023.nb

xs = ? ;
ys = ? ;

Bagian 3. Representasi Model Secara Grafis


Ekspresi perintah berikut untuk mendapatkan hasil kreasi pembuatan grafik untuk populasi mangsa.
example1 =
NDSolve@8system@@1DD, system@@2DD, x@0D == 15, y@0D == 15<, 8x, y<, 8t, 0, 20<D;
curve = Flatten@example1D;
preyplot = Plot@Evaluate@x@tD . curve@@1DD, 8t, 0, 20<D,
PlotStyle ® RGBColor@1, 0, 0D, AxesLabel ® 8"x", "y"<D;

Sekarang kita plot populasi predator dengan cara yang sama dan menenpatkan secara bersamaan
dua buah grafik. Karena kita akan membuat grafik dengan nama yang mirip, maka kita perlu berhati-
hati dengan ejaannya.
Off@General::spell1D;

predplot = Plot@Evaluate@y@tD . curve@@2DD, 8t, 0, 20<D,


PlotStyle ® RGBColor@0, 0, 1D, DisplayFunction ® IdentityD;
Show@preyplot, predplot, DisplayFunction ® $DisplayFunction,
AxesLabel ® 8"t", "x,y"<, PlotLabel ® "Population for 2 Periods"D;

Answers to questions 3 and 4:

Perintah berikut akan membangun plot 3-dimensi dari kurva {x [t], y [t], t}. Opsi perintah BoxRatio
memberikan panjang yang relatif dari sisi frame.
example2 =
NDSolve@8system@@1DD, system@@2DD, x@0D == 15, y@0D == 15<, 8x, y<, 8t, 0, 30<D;
curve = Append@Flatten@example2D, t ® tD;
spaceplot = ParametricPlot3D@Evaluate@8x@tD, y@tD, t< . curveD,
8t, 0, 20<, BoxRatios ® 81, 1, 1<, AxesLabel ® 8"x", "y", "t"<D;

Kita dapat mengubah sudut pandang dengan menggunakan sebagai ekspresi pilihan perinta-
hadalah ViewPoint Selector -> {Xscale, yscale, zscale}. Perhatikan bahwa nilai-nilai ini tidak
mengacu pada titik Cartesian. Pandang pusat kotak sebagai {0,0,0} dengan sisi terpanjang diskala
untuk satu unit. Tiga kali lipat memerintahkan untuk ViewPoint adalah lokasi sudut pandang dalam
skala sistem koordinat. Cobalah bereksperimen dengan sudut pandang yang berbeda dengan
mengubah nilai pandang.
Ada cara cepat untuk menemukan sudut pandang yang Anda inginkan. Silahkan buka menu ketool-
bar, dan klik pada Masukan-> 3D ViewPoint Selector. Pilih Form Cartesian, dan bereksperimen
dengan sudut pandang sampai Anda puas. Kemudian, klik Paste, dan ViewPoint Selector ->
{Xscale, yscale, zscale} secara otomatis akan disisipkan ke notebook terbuka di lokasi kursor
Anda.
view = 81, 0, 0<; H* An Example *L
ParametricPlot3D@Evaluate@8x@tD, y@tD, t< . curveD, 8t, 0, 20<,
BoxRatios ® 81, 1, 1<, ViewPoint ® view, AxesLabel ® 8"x", "y", "t"<D;

Untuk melihat proyeksi mereka ke koordinatbidang, kita dapat mengatur sudut pandang yang
sangat jauh, misalnya Viewpoint -> {100, 0, 0} akan memberi kita proyeksi ke bidang-y(t).
model_matematika_predprey_SistemPDB_orde1_nonlinear_2023.nb 3

ParametricPlot3D@Evaluate@8x@tD, y@tD, t< . curveD, 8t, 0, 20<,


BoxRatios ® 81, 1, 1<, ViewPoint ® 8100, 0, 0<, AxesLabel ® 8"x", "y", "t"<D;

Cara alternatif, Kita dapat menggunakan ParametricPlot untuk membuat kurva\grafik solusi.
ParametricPlot@Evaluate@8x@tD, y@tD< . 8curve@@1DD, curve@@2DD<D,
8t, 0, 20<, PlotLabel ® "Lotka-Volterra Model", AxesLabel ® 8"x", "y"<D;
ParametricPlot@Evaluate@8x@tD, t< . 8curve@@1DD, curve@@3DD<D, 8t, 0, 20<,
PlotLabel ® "Lotka-Volterra Model", AxesLabel ® 8"x", "t"<D;
ParametricPlot@Evaluate@8y@tD, t< . 8curve@@2DD, curve@@3DD<D,
8t, 0, 20<, PlotLabel ® "Lotka-Volterra Model", AxesLabel ® 8"y", "t"<D;

Bagian 4. Prosedur Variasi Parameter


Use the following commands to answer steps 1-4. Make sure that you re-compile all Mathematica
input cells so that you will have an updated plot to examine.
Untuk lebih dapat memahami bagian ini yaitu upaya mendapatkan solusi sistem persamaan diferene-
sial biasa sebagai ilustrasi model matematika dengan menggunakan Mathematica.
a = ?;
LV1 = x '@tD == a * x@tD - b * x@tD * y@tD;
LV2 = y '@tD == - c * y@tD + p * x@tD * y@tD;
system = 8LV1, LV2<;

fieldPlot = PlotVectorField@81, H- c * y + p * x * yL  Ha * x - b * x * yL<, 8x, 0, 200<,


8y, 0, 150<, PlotLabel ® "Lotka-Volterra Model", AxesLabel ® 8"x", "y"<,
ScaleFunction ® H0.25 &L, Axes ® True, DisplayFunction ® IdentityD;

system = 8x '@tD == a * x@tD - b * x@tD * y@tD, y '@tD == - c * y@tD + p * x@tD * y@tD<;


initial = 88x@0D == 15, y@0D == 15<,
8x@0D Š 20, y@0D Š 20<, 8x@0D Š 25, y@0D Š 25<, 8x@0D Š 30, y@0D Š 30<<;
solutions = Table@NDSolve@Join@system, initial@@kDDD, 8x, y<, 8t, 0, 60<D,
8k, Length@initialD<D
solutionsPlot = Table@ParametricPlot@Evaluate@8x@tD, y@tD< . solutions@@iDDD,
8t, 0, 60<, PlotStyle ® RGBColor@0, 0, 1D,
DisplayFunction ® IdentityD, 8i, Length@initialD<D;

Show@fieldPlot, solutionsPlot, DisplayFunction ® $DisplayFunctionD;

Part 5. The Effect of Hunting Predators


The following commands reset the parameters and define the modified differential equations with
constant hunting of predators. Note that the names of the equations have been changed. Use your
choice of graphical representation to determine the effect of hunting. Be aware that if Mathematica
encounters a singularity in NDSolve, the resulting interpolating function will only be valid over the
interval [initial, singularity] as indicated in the output (below suppressed) for NDSolve.
Perintah berikut mereset parameter dan menentukan persamaan diferensial yang dimodifikasi
(model Predator-Prey) dengan konstanta efek buruan predator yang ditetapkan. Perhatikan bahwa
nama-nama persamaan telah berubah. Gunakan pilihan representasi grafis Anda untuk mengetahui
pengaruh berburu. Sadarilah bahwa jika Mathematica bertemu dengan singularitas di NDSolve,
fungsi interpolasi yang dihasilkan hanya akan berlaku pada interval [awal, singularitas] seperti yang
ditunjukkan dalam output (di bawah ditekan) untuk NDSolve.
interval [initial, singularity] as indicated in the output (below suppressed) for NDSolve.
Perintah berikut mereset parameter dan menentukan persamaan diferensial yang dimodifikasi
(model Predator-Prey) dengan konstanta efek buruan predator yang ditetapkan. Perhatikan bahwa
4 model_matematika_predprey_SistemPDB_orde1_nonlinear_2023.nb
nama-nama persamaan telah berubah. Gunakan pilihan representasi grafis Anda untuk mengetahui
pengaruh berburu. Sadarilah bahwa jika Mathematica bertemu dengan singularitas di NDSolve,
fungsi interpolasi yang dihasilkan hanya akan berlaku pada interval [awal, singularitas] seperti yang
ditunjukkan dalam output (di bawah ditekan) untuk NDSolve.
a = 1;
b = .03;
c = .4;
p = .01;
DE1 = x '@tD == a * x@tD - b * x@tD * y@tD;
DE2 = y '@tD == - c * y@tD + p * x@tD * y@tD - 5;
system = 8DE1, DE2<;

fieldPlot = PlotVectorField@81, H- c * y + p * x * yL  Ha * x - b * x * yL<,


8x, 0, 250<, 8y, 0, 125<, PlotLabel ® "Hunting Predators",
AxesLabel ® 8"x", "y"<, ScaleFunction ® H0.25 &L,
Axes ® True, PlotPoints ® 15, DisplayFunction ® IdentityD;

solution1 =
NDSolve@8system@@1DD, system@@2DD, x@0D Š 25, y@0D == 50<, 8x, y<, 8t, 0, 60<D;
solution2 = NDSolve@8system@@1DD, system@@2DD, x@0D Š 60, y@0D Š 30<,
8x, y<, 8t, 0, 60<D;

Here are the commands to plot the solutions over the interval from t = 0 to 15. Try experimenting
with other values for t1max and t2max. What is the range of valid values for t1max and t2max?
t1max = 15;
t2max = 15;
plot1 = ParametricPlot@Evaluate@8x@tD, y@tD< . solution1D, 8t, 0, t1max<,
PlotStyle -> RGBColor@1, 0, 0D, DisplayFunction ® IdentityD;
plot2 = ParametricPlot@Evaluate@8x@tD, y@tD< . solution2D, 8t , 0, t2max<,
PlotStyle -> RGBColor@0, 0, 1D, DisplayFunction ® IdentityD;
Show@fieldPlot, plot1, plot2, DisplayFunction ® $DisplayFunction,
PlotRange ® 880, 250<, 80, 125<<D;

Anda mungkin juga menyukai