Summary: This is a supplementary module explaining the use of a GUI to draw and simulate networks of strings.
This is a brief module on creating and analyzing a web using a GUI implementing the finite element discretization of a network of strings, covering
First, download the web3.zip file, and after unzipping it, change the Matlab directory to the one in which you unzipped web3.zip . Then, in the Matlab command window, type webgui3 to open up the GUI window. You should see a Matlab figure titled “Spiderweb creation GUI" with buttons on the left and an empty grid on the right.
To draw the web, click first on the “Draw nodes" button. These will be either the endpoints of strings or the junctions at which strings connect together. If you left click on a space in the empty grid, you will place a node in that position. Continue to left click until you have placed all the nodes, then right click to indicate that you are finished.
|
Next, once you have drawn the nodes, you can connect them together to create a network of strings. To do this, click on the “Connect nodes" button. Once you have pressed the button, you can click on a node, then on another node to place a connection between the two. Clicking on the first node will cause it to turn red, showing you which node you have chosen (if you choose wrong, right click to cancel).
|
After clicking on both nodes, a blue line will appear on the grid connecting them. Note that you cannot connect a node to itself. Continue to do so until you have drawn your network, and right click to indicate you are finished.
If you click on a spot where there isn't a node, you will select the closest node to where you clicked.
|
Keep in mind that for these simulations, all webs must have endpoints that are considered anchored in place. Using the GUI, these endpoints are assigned to be nodes that are connected only to one other node. If no nodes fit these results, the discretization will contain errors, making it impossible to run simulations.
Once the basic network is drawn, we can go on to adjusting the fineness of our grid. The fineness of the grid will determine the accuracy of your simulations, and is important if you want accurate approximations to a larger number of eigenvalues. However, with every node added, the size of our matrix discretization increases by 3 rows and 3 columns, so there is a computational tradeoff for accuracy.
There are two ways to increase the grid size - one is to click on the button labeled “Alter dx". The GUI will then query you for the desired step size between nodes, and will add the nodes automatically. Keep in mind that the query asks you to specify a number of units for step size, and a box is 1 unit by 1 unit.
|
The second way to increase the grid size is to press the button labeled “Dbl grid pts" (double grid points). Each press of the button will place a grid point between all pairs of connected nodes, and you can continue to press the button until the desired density of grid points is achieved.
There are several physical parameters that are adjustable in the model. The first box in the GUI is labeled “k,s, and a constants", with 3 boxes below with values that can be edited.
There are two ways to adjust parameters in a network. One is to simply adjust the values in the editable boxes as connections are drawn between nodes. The other is to first draw the outline of the network, and then to click on the button “Edit cnx params" (edit connection parameters). After clicking on this, if you click on two nodes with a connection between them, a box will appear with the current values for the
Running a simulation on a web allows you to provide an initial displacement (like choosing where to pluck a string) and see how the web will behave for a given time period. To run a simulation, the initial displacement should first be specified. By clicking on the “Run Simulation" button, you will be able to select nodes by clicking close to them. After clicking on a node, a box will appear and query you for the components of the forces in the
|
For one node, clicking an initial displacement will simulate a smooth displacement of the string. The selected node will be given an initial displacement, but the neighboring connected nodes will also be raised up a little, so that the initial displacement is smoother. Clicking on many nodes close together will cause these displacements to overlap and build on each other.
After selecting all the desired nodes to be displaced, right click to indicate you are finished. Another box will appear, querying you for the runtime of the simulation, the timestep desired (a smaller timestep is more accurate, but takes longer to compute with), as well as the total norm (size) of the initial displacement. After pressing OK, Matlab will run the simulation and play a movie of it on screen.
|
For data analysis, after the simulation has finished, a box will come up querying whether or not you want to save the data. If yes, you can specify a name for the Matlab
data file, and the GUI will save the data structures, discretization matrices, and the data from the simulation into this file. The data from the simulation will contain a vector
Another tool in the GUI is to view the eigenvalues and eigenmodes of a spiderweb. Once the web has been drawn and the grid has been adjusted as desired, clicking on the “See eigs" button will calculate the eigenvalues and eigenmodes of the web. A figure will appear, plotting the eigenvalues, and another figure will also appear, in which movies and sounds of the eigenmodes will be played. After one eigenmode movie is finished playing, press any key to continue to the next.
|
Note that the number of eigenvalues calculated is far less than the dimension of the matrix. This is because the discretization approximates only a few eigenvalues accurately. The size of the matrix is 3 times the number of nodes, but the number of eigenvalues calculated is only
|
After all the eigenmode movies are played, a box will appear asking whether or not you want to save the data. The procedure to save the data is the same as saving data after running a simulation of spiderweb motion.
There are two other options available - one is to save a drawn web into a loadable file format, and the other is to load a picture into the background of the GUI.
To save a web after it has been drawn, click on the “Save/Load" button and select the “Save" option. A box will appear, querying you for the name of the web. After pressing OK, the web data will be saved in a .mat file in your current directory under the specified name. To load, press the same button, but select “Load" and specify the file name.
An easy way to use the GUI to create large webs is to draw the outline of a web, save it, and then reload it, adjusting grid size until satisfied.
Since it's possible to trace the outline of any web, it's possible to use the web GUI to trace an actual web out. To do so, include (in the same directory as the GUI) a JPEG photo of the web to trace. Click the "Load pic" button, and it will display the picture as the background of the GUI.
|