Implement a model that represents a dynamical flow from a source to a sink with a restricted flow pathway in-between.
Use the given plot package (plot.jar) to plot the results for the following problem:
Implement the model with the initial values:
v0,0 = 10.0
v1,0 = 5.0
p0,0 = 0.1
p1,0 = 0.05
s0 = 0.0
t0 = 0.0
t_max = 5.0;
dt = 0.1
θ0 = π * 0.2
θ1 = π * 0.1
Fmax = 5.0
And the dynamics equations:
p0,i = v0,i - 1 * 0.1
f0,i = p0,i * v0,i - 1 + 0.2 * sin(t * θ0)
v0,i = v0,i - 1 - f0,i * dt
p1,i = v1,i - 1 * 0.1
f1,i = p1,i * v1,i - 1 + 0.1 * sin(t * θ1)
v1,i = v1,i - 1 - f1,i * dt
if f0,i + f1,i < Fmax
{
Fi = f0,i + f1,i
}
else
{
Fi = Fmax
}
si = si - 1 + Fi * dt
Then display the following three separate plots:
v0, v1, and s values versus t
p0 and p1 values versus t
f0, f1, and F values versus t
on a three GUI panels (may be in separate frames).
If you require extra arguments on the javac and java command lines create a script (makefile, bourne script, perl script, python script, ...) which is easily executed and performs the compile and run of your code.
These are to be placed in a single jar or tar file and e-mailed as an attachment to jholten@nmt.edu
The plot.jar package contains a directory structure and the java source code for the plot and support routines, as well as a test program called "plf_2_tst.java" as an included example, so access the plot files and the example as follows:
The source code included in this exercise is open source and you may use it freely, distribute it, and/or modify it as you see fit.
To compile and run your own code using the libraries you merely need to include the import statements in your code and make sure the directory hierarchy base is in your classpath, which it is for any code compiled and executed from the directory you created for its installation above.
The files to be turned in for this programming assignment are as follows:
All your source code files and any others you modified
Writeup on how to compile, run, and use the program, as well as details of which systems you used, any problems you encountered, and how you overcame them.
Include a discussion of any significant problems found in the model and suggestions of how they might be overcome.
Any output text file log from your test run.
Generate and display the following, using the plot objects, on each panel of plotted values above: