(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

I would like to make a physics applet.

I have a numerical solution of the Lotka-Volterra model located here:

https://www.physicsforums.com/threads/lotka-volterra-model-eulers-method.803382/#post-5044961

2. Relevant equations

None

3. The attempt at a solution

I want to be able to make graphs of my numerical solution and I am wondering how do I incorporate my numerical solution of the Lotka-Volterra model into an applet?

I tried searching GUI applets for Java but it is so broad the I would like to narrow it down for only physics application like making graphs or making a wave that corresponds to the wave equation.

Any links or videos of how to make a physics applet would be of great help.

My numerical solution:

Code (Java):

public class Lotka {

public static void main(String[] args) {

double[] prey = new double[1000];

double[] predator = new double[1000];

double[] dt = new double[101];

double[] b = new double[101];

prey[0] = 10;

predator[0] = 5;

dt[0] = 0;

b[0] = 0.01;

for (int j = 1; j < 101; j ++) {

dt[j] = 2 + dt[j-1];

b[j] = b[0]*((double)j/2);

}

for(int i = 1; i < 100; i++) {

prey[i] = prey[i-1] + (0.2*prey[i-1]*(1-prey[i-1]/500)

-(b[i]*prey[i-1]*predator[i-1])/(1+b[i]*prey[i-1]))*(1/dt[i]);

predator[i] = predator[i-1] + (0.1*predator[i-1]*(1-predator[i-1]

/(0.2*prey[i-1])))*(1/dt[i]);

//System.out.println("" + prey[i] + " " + predator[i]);

}

}

}

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Making a Physics Java Applet

Loading...

Similar Threads - Making Physics Java | Date |
---|---|

Making a browser extension | Aug 17, 2017 |

Python Making my web page publicly available | Jul 29, 2017 |

How can I make a custom bootstrap navigation bar? | Mar 6, 2017 |

Python Diffraction applet - how to make one in one day | Sep 2, 2016 |

How do you make a realistic physics engine? | Jan 5, 2014 |

**Physics Forums - The Fusion of Science and Community**