SD Everywhere, getting stuck.

Use this forum to post Vensim related questions.
Post Reply
TK421

SD Everywhere, getting stuck.

Post by TK421 »

I've attached a model that ships with Vensim (I'm testing with it).

Running "sde generate --genhtml prod5.mdl", I get the following output. I'm confused by the reports of "has no subscripts", those variables have got subscripts.

Any help will be very welcome.

Code: Select all

 sde generate --genhtml prod5.mdl
_average_orders[them] has no subscripts in vensimName
_average_orders[us] has no subscripts in vensimName
_capacity[them] has no subscripts in vensimName
_capacity[us] has no subscripts in vensimName
/Users/TK421/prod5/model/build/prod5.c:367:21: error: use of undeclared identifier 'them'
    &_capacity_life[them],
                    ^
/Users/TK421/prod5/model/build/prod5.c:368:21: error: use of undeclared identifier 'us'
    &_capacity_life[us],
                    ^
/Users/TK421/prod5/model/build/prod5.c:369:31: error: use of undeclared identifier 'them'
    &_time_to_adjust_capacity[them],
                              ^
/Users/TK421/prod5/model/build/prod5.c:370:31: error: use of undeclared identifier 'us'
    &_time_to_adjust_capacity[us],
                              ^
/Users/TK421/prod5/model/build/prod5.c:371:30: error: use of undeclared identifier 'them'
    &_time_to_average_orders[them],
                             ^
/Users/TK421/prod5/model/build/prod5.c:372:30: error: use of undeclared identifier 'us'
    &_time_to_average_orders[us],
                             ^
/Users/TK421/prod5/model/build/prod5.c:393:29: error: use of undeclared identifier 'them'
  outputVar(_average_orders[them]);
                            ^
/Users/TK421/prod5/model/build/prod5.c:394:29: error: use of undeclared identifier 'us'
  outputVar(_average_orders[us]);
                            ^
/Users/TK421/prod5/model/build/prod5.c:395:23: error: use of undeclared identifier 'them'
  outputVar(_capacity[them]);
                      ^
/Users/TK421/prod5/model/build/prod5.c:396:23: error: use of undeclared identifier 'us'
  outputVar(_capacity[us]);
                      ^
10 errors generated.
Attachments
model.zip
(75.95 KiB) Downloaded 285 times
TK421

Re: SD Everywhere, getting stuck.

Post by TK421 »

Some more info, I think this is related to graphs.csv. If I replace the variables listed in the graphs.csv file with "time" only get one error (which I can solve easily),
"cp: no such file or directory: /Users/tony/OneDrive/Work/VSUK/Companies/V/Ventana_Systems_UK/SDEverywhere/prod5/model/logo.png"
TK421

Re: SD Everywhere, getting stuck.

Post by TK421 »

I made a few changes to the model to avoid subscripts, and everything now seems to build (no output messages). But when visiting the resulting website, I get a white screen with two white squares (I think these should be the graphs).

I'm stuck. Thanks in advance for any help.

Tony.
Attachments
model 2.zip
(1.23 MiB) Downloaded 277 times
Todd
Junior Member
Posts: 11
Joined: Tue Aug 20, 2019 7:35 am
Vensim version: DSS

Re: SD Everywhere, getting stuck.

Post by Todd »

I was able to get the original model with subscripts working by fixing a few things in the config files. I agree that the error messages did not help much. I'm using SDEverywhere version 0.5.1, which was just published to npm with a few recent enhancements and fixes.

Change the initial view in app.csv to "Models > PROD5" to match the view name in views.csv. This is why the graphs came up blank before.

Use numeric subscripts in sliders.csv instead of subscript names.

Use numeric subscripts in graphs.csv instead of subscript names. I also adjusted the graph x and y axis ranges to match the model data.

BTW if you haven't discovered this yet, the CSV files are much easier to work with in Excel if you open them from the Finder or File Explorer instead of from Excel. This avoids the Text Import Wizard.
Attachments
prod5_sde_2019-09-27.zip
(22.82 KiB) Downloaded 285 times
TK421

Re: SD Everywhere, getting stuck.

Post by TK421 »

Do I need to update to 0.5.1 as well? I've just tried the commands using what I have installed (and get the same grey screen with two white squares).
TK421

Re: SD Everywhere, getting stuck.

Post by TK421 »

Scratch that, uploaded to a website and it seems to work.

Now to try on something a little more complex....
TK421

Re: SD Everywhere, getting stuck.

Post by TK421 »

Getting the following error now. Is there a specific place I should look to try and figure out what is causing it?

Code: Select all

(node:1196) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'trim' of undefined
    at canonicalName (/usr/local/lib/node_modules/sdeverywhere/src/Helpers.js:31:8)
    at /usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:68:41
    at _map (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_map.js:6:19)
    at map (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/map.js:64:14)
    at /usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_dispatchable.js:41:15
    at Object.f2 [as map] (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_curry2.js:29:14)
    at getVarNames (/usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:68:29)
    at initConfig (/usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:32:3)
    at generate (/usr/local/lib/node_modules/sdeverywhere/src/sde-generate.js:85:5)
    at Object.handler (/usr/local/lib/node_modules/sdeverywhere/src/sde-generate.js:71:3)
(node:1196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1196) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Todd
Junior Member
Posts: 11
Joined: Tue Aug 20, 2019 7:35 am
Vensim version: DSS

Re: SD Everywhere, getting stuck.

Post by Todd »

The way I would approach that problem is to run SDEverywhere in a debugger using your particular model and spec files. If you can post them I can take a look.

Yes, please use SDEverywhere 0.5.1 henceforth. It's also possible I will fix problems in between releases that you would need to get from the develop branch of the GitHub repo. The README shows how to get the development version of SDEverywhere.

And yes, it's also necessary to use a local web server to serve the files. Previously, we could run local files in Firefox, but they recently disabled that capacity as a security feature. The README suggests a simple local server that can be used in development.
Post Reply