WeBWorK Problems

more physics units

more physics units

by Douglas Young -
Number of replies: 3


Would it be possible to have some new unit definitions added?  In particular. there are not many electrical units listed (i.e. there does not seem to be a unit listing for coulombs, ohms, kilo-ohms, Teslas, ect.).  Also, I think volts as V needs to be added to the units wiki page:


Thanks, 

Douglas Young


In reply to Douglas Young

Re: more physics units

by Michael Gage -

Hi Douglas,


The listing on the wiki is incomplete and out of date.  The actual list of units is defined in pg/lib/Units.pm  and you can view the code (which is pretty self explanatory) at  http://webwork.maa.org/viewvc/system/trunk/pg/lib/Units.pm?view=markup.  


That said, we need someone to volunteer to update the list on the wiki -- or even better -- design a workflow that allows the wiki presentation to be easily updated from the code itself.  Perhaps Units.pm and the associated accessors could be rewritten so that you could include a "name" parameter that associates each unit symbol with a name.


Of your list I see Coulomb (C), volt (V), ohms (ohm) -- I don't see Teslas.  


-- Mike

In reply to Michael Gage

Re: more physics units

by Michael Gage -


On Jun 16, 2012, at 9:00 PM, Douglas Young wrote:

Michael, 


Thanks for the information.  I would be willing to update the wiki.  I would also be willing to update the Units.pm to include some other units, like Teslas.  As I understand it, I can edit the wiki, but how would I go about updating the Units.pm file?  


Doug


Hi Douglas,


A very quick method for updating the units file is to download by going to http://webwork.maa.org/viewvc/system/trunk/pg/lib/Units.pm?view=log

and downloading and saving the contents as Units.pm.  Edit, preserving the style on the page.  It's all written as one giant associative array

(perl array) so formatting is important.  Then you can send it to me and I'll get it installed when I get a chance, (gage@math.rochester.edu) which in the summer is likely to be a little sooner than usual. :-)  


If you have your own site and want to help contribute then created a github.com account for yourself (github has good instructions) and fork from our repository at  http://github.com/openwebwork/pg and http://github.com/openwebwork/webwork2.  The Units.pm file is in the pg repository. You can also fork from pg-dev and webwork2-dev repos if you want to help out with the cutting edge development. (see http://hosted2.webwork.rochester.edu/webwork2/maa101

for examples and http://webwork.maa.org/planet for descriptions of recent developments)


We're looking hard for people to help contribute to WW development in big and small ways -- we're abit overwhelmed with the recent growth :-)  

See http://webwork.maa.org/wiki/Github for some preliminary comments on using github.

Take care,

Mike



In reply to Douglas Young

Re: more physics units

by Boyd Duffee -
Hi Doug,

Have a look at Bug 2160 http://bugs.webwork.maa.org/show_bug.cgi?id=2160
There was a problem with Newtons per Coulomb definition in the Units.pm file, so I fixed it and added in 46 more units, hopefully covering all your needs, but it hasn't made it into the production release. Let me know if it works for you.

cheers,
Boyd