It is not just Energy and it is not just Oil.  Human behavior is involved.
And stupidity will be dealt with accordingly.   

Main Menu

The Limits to Growth

Started by K-Dog, Apr 30, 2024, 08:18 PM

Previous topic - Next topic

K-Dog

Urban Dynamics is worth talking about all by itself.  But not today.  Today I found the Dynamo Users Manual using a Russian search engine.

It looks like I may be working on this project by myself for a while.  I'll publish a link to the manual when somebody else shows up to participate.


K-Dog

#1
Running The Limits to Growth model involves processing the model equations to generate initial values.

Once the initial values are know the model runs and generates data.

From the data, plots are generated.

The hard part is processing the model equations to generate initial values.  After that part is done turning the digital crank is easy enough.

I am making progress.  About 1000 lines of JavaScript into the project.

K-Dog

#2
Now over 1200 lines and I loaded initial values from the Dynamo example card deck. I ran my first time 'DT' cycle to step Dynamo model equations forward one time increment.

Dynamo is the simulator that ran the original Limits to Growth model.  A new page will be added to this website when the Limits to Growth model simulator is ready for prime time.  Users will be able to run the card deck and see the original graphs.  They will also be able to run their own versions.

The input card deck.

*    M478-248,DYN,TEST,1,1,0,0
RUN  2698JP
NOTE  MODEL OF RETAIL STORE
NOTE 
1L    IAR.K=IAR.J+(DT)(SRR.JK-SSR.JK)          INVENTORY ACTUAL
1L    UOR.K=UOR.J+(DT)(RRR.JK-SSR.JK)          UNFILLED ORDERS
20A  NIR.K=IAR.K/DT                          NEGATIVE INVENTORY
20A  STR.K=UOR.K/DFR                          SHIPMENTS TRIED
54R  SSR.KL=MIN(STR.K,NIR.K)                  SHIPMENTS SENT
40R  PSR.KL=RRR.JK+(1/DIR)(IDR.K-IAR.K)      PURCHASE ORDERS SENT
12A  IDR.K=(AIR)(RSR.K)                      INVENTORY DESIRED
3L    RSR.K=RSR.J+(DT)(1/DRR)(RRR              REQUISITIONS SMOOTHED
X1    .JK-RSR.J)
39R  SRR.KL=DELAY3(PSR.JK,DTR)                SHIPMENTS RECEIVED
NOTE 
NOTE  INITIAL CONDITIONS
NOTE 
12N  UOR=(DFR)(RRR)                         
6N    RSR=RRR                                 
6N    IAR=IDR                                 
NOTE 
NOTE  INPUT
NOTE 
7R    RRR.KL=RRI+RCR.K                        REQUISITIONS RECEIVED
45A  RCR.K=STEP(STH,5)                        REQUISITION CHANGE
NOTE 
NOTE  CONSTANTS
NOTE 
C    AIR = 8 WKS                              CONSTANT FOR INVENTORY
C    DFR = 1 WK                              DELAY IN FILLING ORDERS
C    DIR = 4 WKS                              DLY REFILLING INVENTORY
C    DRR = 8 WKS                              REQUISITION SMTHNG T C
C    DTR = 2 WKS                              DELAY IN TRANSIT
C    RRI = 1000 ITEMS/WK                      REQ. RECEIVED INITIALLY
C    STH = 100 ITEMS/WK                      STEP HEIGHT
NOTE 
PRINT 1)IAR,IDR/2)UOR/3)RRR,SSR/4)PSR,SRR
PLOT  IAR=I,UOR=U/RRR=R,SSR=S,PSR=P,SSR=Q
SPEC  DT=0.1/LENGTH=10/PRTPER=5/PLTPER=0

Results from reading and processing the input card deck.  The variables *001, *002, *003 are internally generated by expanding a delay card.  Getting this far took quite a bit of processing.  The hard work is done.  Now the devil will be in the details.

RSRJ1000K1000
UORJ1000K1000
IARJ8000K8000
RCRJ0K100
STRJ1000K1000
IDRJ8000K8000
NIRJ80000K80000
RRRJK1000KL1100
SSRJK1000KL1000
PSRJK1000KL1000
SRRJK1000KL1000
*001JK1000KL1000
*002JK1000KL1000

   
DT0.1
AIR8
DFR1
DIR4
DRR8
DTR2
RRI100
STH100
*0036.666666666666666

This output shows Dynamo sample model array variables.  The variables on the bottom are constants that do not change.  The variables above them have J and JK values.  J values are initial values.  The K and KL variables are the result of calculating to the next time increment.  The next step will be to  transfer K values to J values and KL values to JK values to step time again.

The Limits to Growth model has about ten time as many equation lines.  When it works and is ready for prime time, the equation simulator won't care about more lines.  First I have errors to fix.  The output is not correct*.

This is what defines what I am doing.  The users manual.

Dynamo

Q: How will the JavaScript implementation compare in speed to the original IBM mainframe implementation?  A: The modern Javascript implementation will run rings around the original IBM implementation.

* The errors were fixed.  But the output above is not corrected.  Output should have no values changing before a step input generates an order in the system at time five.

K-Dog

#3
Progress on the Dynamo Equation Compiler.  The variables from the demo card deck are computed correctly as you can see. 

The scales on the graph are unfinished.  The plots are not scaled to the vertical axis relative to each other as dictated by the plot card yet.

That is the next thing to get working.  More fully parse the PLOT card.  So far I have just grabbed the variable names and charged on to get this far.  I also need to get the PRINT card printing.  So far I only grabbed variable names from the PRINT card and collected the data for them as the model ran.

The icons on top are buttons that run tasks.  The meanings change as I change my code.  The rotating arrow button currently shows the results you see.  I clicked it before taking the screenshot.  In final form these buttons will be the user interface.  Appearance and code will then match, but not now.  Before I reconstruct the original Limits to Growth card deck.

The Dynamo Compiler will need refinement.

So far I have about 90 functions in 1500 lines of JavaScript.  Each of the buttons jumps to a function a generates a chain of activity that gets a task done when pressed.

The Dog button fetches a Dynamo Card Deck file.  Each line represents a card.  Clicking the buttons in sequence runs tasks that are done sequentially to process the deck so it can produce and show output.

K-Dog

#4
Here the variables are scaled correctly.

Processing the details of the plot card was a challenge.  And the example plot in the users manual has two scales but the demo plot card did not specify the plot limits.

Example: 
PLOT  IAR=I,UOR=U/RRR=R,SSR=S,PSR=P,SRR=Q

Corrected:
PLOT  IAR=I,UOR=U(0,12000)/RRR=R,SSR=S,PSR=P,SRR=Q(1000,1200) 

UOR and SSR were cleverly picked to plot because they are on top of each other if both plot to a default scale.  UOR is hidden in my first version which had only internally generated limits.

Scale limits are added to the two plot groups, each plot group has it's variables plotted to the same scale.  The notation to specify the vertical scale limits follows the user manual notation.  Defaults are generated if scale limits are omitted.

Leaving the scale limits off the original card made sense so as to not confuse the reader.  Reading the plot card specification clears things up right away.  Scale groups are separated by '/' on the plot card.  Scale group numbers next to the variable swatch map tell what scale to use to read the variable.

K-Dog

#5
Dr. Jack Alpert is director of Stanford Knowledge Integration Lab, which he started in 1978 at Stanford U and which has been a nonprofit research foundation since 1992.  The lab's research focussed on how people gather and process information to understand dynamic systems.  Over the years, the work changed focus to the relationship between human cognition and civilization viability.  Its current work is on discovering and implementing a viable civilization.

Which is about as easy as eating an elephant with a spoon.

The video was created by https://canadiancor.com/

The Diner returns to 'DOOM' (actually we never left).

K-Dog

#6
Doomerism is not the status quo, but the right thing to do is still the right thing to do even when it's the end of the world. Fight, take care of each other, speak the truth, and reduce harm.

Learn everything you can about the madness of crowds, understand group-speak.  Social life is a performance where people engage in empty conversations and meaningless pursuits driven by needs for validation and a fear of loneliness.  Empty people can't see themselves as empty.  People with distorted uncritical thinking are unaware of their own intellectual limitations. Superficial reality distorted by emotions shapes their desires and understanding of the world.

Only by withdrawing from society can one engage in the deep introspection necessary to perceive the world's underlying truth.

Which along with $4.00 will buy you a foo-foo beverage at Starbucks.