Group Abstract Group Abstract

Message Boards Message Boards

Fix Wolfram demonstration project: world energy by Eugene Poberezkin?

Posted 9 years ago

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

Attachments:
POSTED BY: Matthew Schaefer
13 Replies
Posted 9 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

POSTED BY: Andrea Griffin
POSTED BY: Matthew Schaefer

What version of Mathematica are you running?

POSTED BY: Ed Pegg
In[1]:= $Version

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

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

enter image description here

THANK YOU! Any idea when that will happen?

POSTED BY: Matthew Schaefer

A fix has been found. This will be republished.

Attachments:
POSTED BY: Ed Pegg

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

POSTED BY: Matthew Schaefer

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]

and

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.

POSTED BY: Nick Lariviere

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
POSTED BY: Nick Lariviere

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.*

POSTED BY: Matthew Schaefer

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

POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard