Page 109 - ExtendSim User Guide
P. 109

Areas of Application 83
Custom blocks
offices per month. This amount is accumulated to get the total number of businesses occupy-
ing offices, so that the number of business failures can be calculated.
• BusinessFailures:Thereisa6-monthdelay,then2%ofthebusinessesfailandmoveoutof
their offices each month.
Notice that the number of failures is based on the net total number of businesses, not just on the total number of new businesses occupying offices. The failure amount is removed from the “Businesses Occupying” Holding Tank, so that failures are calculated on a net number. The number of offices recovered due to businesses failing is returned to the Office Bank, making more office space available.
Vary the available office space, office space usage per business, or growth projections to explore alternatives.
Custom blocks
As mentioned previously, it is common to develop custom continuous blocks. The advantage is that you can use the full capability of the ExtendSim development environment, including the ModL programming language and dialog editor, to create blocks that behave and look exactly as you want. Then use those blocks to build a model that accesses ExtendSim’s robust simula- tion architecture.
Planet Dance
The Planet Dance model demonstrates the inverse square law of gravity. It uses the Planet and Planet Plotter blocks from the Custom Blocks library. Both blocks were created specifically for this model.
☞ The model is located in the folder \Examples\Continuous\Custom Block Models.
About the model
When you run the Planet Dance model, the three Planet blocks pass information about the planets they represent to the Planet Plotter block. This block plots the location of the blocks on the model worksheet by drawing them as animation objects that move over time.
Each Planet block in the model contains the
definition of one planetary object whose mass
will affect, and will in turn be affected by, each
of the other objects in the model. The dialogs of
the Planet blocks contain parameters that define the mass, position, density, and initial velocity of a particular planet. The block’s code contains the math for calculating the gravitational attractions of the objects to each other.
When this model runs the planets display the “slingshot effect.” As one object approaches another, the attraction between them increases, leading to the less massive object being accel- erated to a high speed. Scientists sometimes use the slingshot effect to accelerate vehicles on their trips to explore the outer planets in our solar system.
Note that the units of the various parameters are not defined in this model. The numbers entered in the dialogs are just used relative to the other objects in the model.
Planet Dance model

   107   108   109   110   111