Unit Check Error

Use this forum to post Vensim related questions.
Post Reply
Space Man
Junior Member
Posts: 5
Joined: Thu May 04, 2023 8:50 pm
Vensim version: PLE+

Unit Check Error

Post by Space Man »

I recently made some additions to a model that had no unit errors a few days ago (except for some warnings for where I'm using lookup tables/relations). After making my changes the last couple of days, I have been getting errors in multiple variables in the model with the unit checking. Posting images to hosting websites is cumbersome, but the gyst of the issue is Vensim's unit checker is saying some of my variables do not have units defined, or they are some unit that is not actually in the description for the variable.

As a specific example, I have a flow called "aging of internet sats" in my model. The Unit Checker says no units are defined for this variable. When I click on the variable to correct the issue, I see that not only are units defined for the variable, but they are correctly assigned as well. I've noticed the same type of issue in at least one other place in the model so far, and I believe there are other areas I haven't noticed this "error" being thrown.

I've tried saving, closing, and reopening vensim (which has solved some problems for me in the past) but I'm still getting this issue. I've tried changing the unit to something else and then changing it back to the unit type I want and that doesn't work either. I've even made new variables to test the dimensional analysis and it worked on the test variables, but not on my other ones. Any ideas on how to fix this?
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Unit Check Error

Post by Administrator »

Can you share the model? If you cannot share publicly, you can email it to us at vensim@vensim.com (make sure you include your licence details and mention this forum post).
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Space Man
Junior Member
Posts: 5
Joined: Thu May 04, 2023 8:50 pm
Vensim version: PLE+

Re: Unit Check Error

Post by Space Man »

It appears after deleting and replacing one of the variables giving me these unit check errors and then saving, closing vensim completely, and reopening later, the problem went away. Is there any information that can be provided here though about why this issue may have happened and possible troubleshooting steps other than deleting and replacing variables?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Unit Check Error

Post by tomfid »

This is not a known issue, and therefore hard to diagnose without a sample.
Space Man
Junior Member
Posts: 5
Joined: Thu May 04, 2023 8:50 pm
Vensim version: PLE+

Re: Unit Check Error

Post by Space Man »

My model is fairly private so I didn't want to share a sample publicly at this time, but I did email it to the vensim support email shared above for reference. It's been a while since I completed my computer science courses, but it seems like whatever memory "stack" Vensim uses did not track some of the updates I was making (and saving) in the model when it came to checking units. I was kind of curious if details of the behind the scenes process Vensim uses for unit-checking might reveal how this error could happen, but if it's not a common problem there's a chance I was somehow mistaken despite being pretty confident in describing the situation accurately after double checking everything before posting this.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Unit Check Error

Post by Administrator »

We haven't received the model.

As Tom says, impossible to really help without seeing the model. I think it's probably a misunderstanding on how it works rather than an actual error.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Space Man
Junior Member
Posts: 5
Joined: Thu May 04, 2023 8:50 pm
Vensim version: PLE+

Re: Unit Check Error

Post by Space Man »

I realized yesterday that the email got stuck in my outbox for some reason after we had already typed these other messages on the forum. Naturally, it's more likely there wasn't an error, but the fact remains I'm confident I checked that the error was reporting multiple things that were not actually in the model. The simplest of these examples was reporting some variables not having units defined at all, or simply reporting a different unit than what the variable was actually set to.

The version of the model I'm running right now doesn't have this issue any more, so sharing the model is no longer productive.
Space Man
Junior Member
Posts: 5
Joined: Thu May 04, 2023 8:50 pm
Vensim version: PLE+

Re: Unit Check Error

Post by Space Man »

After doing some more unit checking for other new variables in my model, I'm 99% sure I found what my "problem" was.

When one clicks on the "Units Check" button in Vensim, Vensim opens a window that lists all the detected unit errors. After correcting these errors, one can hit the button again to check if the problems were fixed. My model uses a lot of lookup tables that give warnings for the units since the output units are typically different from the inputs but this is intentional and okay. Even though I am fine with that behavior (and the warning) I get 24 warnings currently when unit checking. This means every time I do a unit check, I have to scroll through the results to see where the real errors are (plus many of my equations are pretty lengthy. I use verbose variable names to keep things clear).

After I would tweak something and hit the "Unit Check" button, I would scroll to the top of that window, and check the errors. What I didn't realize, is this window was simply adding the results of the check to the BOTTOM of the existing window's list. In other words, it wasn't resetting/replacing that window with new results. It was simply printing the new unit check results below the previous unit check's results. This meant that when I scrolled to the top of what I thought was the current results of the unit check, I really WAS looking at old model definitions instead of my latest fixes, leading me to think something looked broken in the unit checking process. If I didn't have such a big window to scroll through, I closed the window after every unit check, or I started at the bottom of the window, I wouldn't run into this confusion, but in my case, this threw me for a real. Hopefully if anyone else gets confused in this scenario this thread can help.
Post Reply