Message Boards Message Boards


Fix Wolfram demonstration project: world energy by Eugene Poberezkin?

Posted 5 years ago
13 Replies
1 Total Likes

Several years ago I stumbled on a terrific demonstration titled: World Energy: Electricity, Oil, and Gas. I developed a good lesson for my precalculus class utilizing the demonstration. My school does not have school license for mathematica, but my students can of course use the CDF player. When I tried to do the lesson this year, I found that the demonstration did not work for my students, but did for me. After a lot of chatting with Tech at Mathematica, we eventually discovered that I was running a lower version of Mathematica, that the newest version of mathematica had changed some code and that thisn demonstration needed an update. The team at mathematica said they would fix it, but a few weeks later they contacted me and said it was too more work than worth their time, and it is now left at that... so I am pretty desperate here, and know there is a low probability, but I am looking for someone who might know the creator of the demo, Eugene Poberezkin? Or thinks they could take a stab at trying to fix the demo? I have the old file to share, it is attached. I am a novice coder, it would take me forever to decipher the original code, much less fix it for the newest version of Mathematica!

Thanks in advance. Matt

13 Replies

Did you try contacting Demonstrations Team via feedback button located at the bottom of Demonstrations web pages?

Sam, yes I did, the final response is below (after this communication, a follow up email suggested posting here...):

*Hello Matthew, Thank you for contacting Wolfram Technical Support. I just got feedback from our demonstration team. They spend some time but cannot see a quick enough way to debug. Since this demonstration is provided by an external user, we'd have to spend more time on it than it is worth. I apologize for the inconvenience.*

The main issue with this looks to be the introduction of Quantity expressions in the results returned by CountryData. One quick-fix for this would be to turn off the Quantity wrapper in legacy data paclets via SetSystemOptions:

SetSystemOptions["DataOptions" -> {"ReturnQuantities" -> False}];                

Before evaluating the example. A more long-term solution would be to 'fix' the CountryData calls which are returning Quantities(such as CountryData[_,"Population"] by wrapping them in QuantityMagnitude:

In[70]:= CountryData["France", "Population"]

Out[70]= Quantity[64101308, "People"]

In[71]:= QuantityMagnitude[CountryData["France", "Population"]]

Out[71]= 64101308

Nick, thanks. If I add the QuantityMagnitude to all CountryData, will that fix everything? Also, I guess I need to upgrade to latest version of Mathematica to try this, I have 9.0.1, yikes

If you don't have version 10, and want something that should work in both versions, you can probably do something like:

CountryData[#, "Population"] /. q_Quantity :> QuantityMagnitude[q]


CountryData[#, EnergyTypes[[nrgN]] <> data] /. q_Quantity :> QuantityMagnitude[q]

(which I think are the only two places that quantities are coming back) which will leave version 9 results as they are, as it only replaces the Quantity with it's magnitude if there is a quantity result.

A fix has been found. This will be republished.


THANK YOU! Any idea when that will happen?

Unfortunately, the demonstration still has errors, e.g.

enter image description here

What version of Mathematica are you running?

In[1]:= $Version

Out[1]= "10.4.1 for Microsoft Windows (64-bit) (April 11, 2016)"
Posted 5 years ago

Hi Matt,

Out of curiosity, as a fellow precalculus teacher, how were you using the demonstration in your classroom? I hope you can use it again soon!

Thanks! Andrea

Andrea, well this is pretty embarrassing, as responding to this has been on my "to do" list for 7 months now... my sincere apologies, as you are aware us educators are stretched thin, especially boarding school teachers with three young children, like myself... anyway, enough excuses. My lesson on this, the general scope, the students fill out information on energy on an excel sheet with information from the demo, using the map view, I pick 5-10 countries, they have to add 5-10 more of their own, this has them learning about just location of countries (always shocking to find out no one has any real idea where Iraq is located, but can certainly solve a trig identity!). I have them do a HW assignment on this in which they learn some excel by learning how to sort lists, have multiple pages, and more. Also, I have them come to next class with 3 interesting and/or surprising things they found out (i.e. Canada has a ton of reserves, Japan imports all oil...). We start the next class sharing the facts we found. Next we look at the table from the demo that appears when you scroll over a country, I have them work in groups to decipher what all the statements mean, then present an explanation for the table that would explain it to a person who does not "get it". We listen to a podcast from This American Life on fracking, we compare numbers of natural gas reserves in USA from the demo, and from Wikipedia with this dispute. We have also looked at Nuclear energy in Japan (although this was after the earthquake and Tsunami that caused the accident in 2011, last year I did not go over this as in depth, as the students did not know about it, in just 5 years it had became history as much as Chernobyl, so now I mention it, but we do not go into how many nuclear power plants being shut down in Japan, and what they will do next...). We finally look at Masdar in the UAE, the irony of a solar power city funded by selling oil... anyway, that is the jist, I do some or all of this, add what fits and is of interest, for example I will certainly try to add something about Dakota pipeline this year. It takes 3-4 classes, and I sacrifice covering some of the "core" topics in precalculus, but it is worth it, and I am lucky to work at a school that is supportive of this, and creating an integrated and place based curriculum. I am more than happy to send you the worksheets I created on this (although they need an update, since I skipped doing this last year with the demo hic-up), my email is Finally, so so so sorry for the delayed response... Matt

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract