Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017

0 views

Published on

This session will give you a brief overview of how Tenkiv and Nexus Brain use Kotlin and Physikal/JSR 363 to calculate the optimal usage of alternate energy sources and control solar power systems used for making clean water anywhere from Flint Michigan to Afghanistan.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017

  1. 1. Copyright © 2016, Creative Arts & Technologies and others. All rights reserved. Physikal – JSR 363 and Kotlin for Clean Energy Werner Keil JSR 363 Maintenance Lead @wernerkeil October 18, 2017
  2. 2. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Agenda 1. Introduction 2. Tenkiv Nexus 3. JSR 363 4. Physikal
  3. 3. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Who am I? Werner Keil • Consultant – Coach • Creative Cosmopolitan • Open Source Evangelist • Software Architect • Spec Lead – JSR363 • Individual JCP Executive Committee Member [www.linkedin.com/in/catmedia] Twitter @wernerkeil
  4. 4. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Save Water
  5. 5. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Water Crisis
  6. 6. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI The Globe 2.5 billion people across the globe lack access to clean water.
  7. 7. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Developing Nations In places like Afghanistan, lack of access to water sanitation leads to a 1 in 5 child mortality rate.
  8. 8. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI California 98% of California is experiencing severe drought, placing major stress on our water infrastructure.
  9. 9. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is Tenkiv Nexus? The Tenkiv Nexus is a fully modular renewable energy system. It uses heat from the sun in order to power anything for 1/13th the cost of existing solar panels and 1/5th the cost of fossil fuels without any subsidies. It’s the breakthrough the world’s been waiting for that finally enables us to truly utilize the most abundant source of power available on earth: the sun. Tenkiv started deployment of the Tenkiv Nexus for water purification, but over time will replace more and more of the world's dying energy infrastructure with this new, more powerful, cost-effective, and completely clean energy nexus.
  10. 10. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Tenkiv Nexus
  11. 11. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is JSR-363? 5,999 miles A Quantity A Unit Brussels São Paulo
  12. 12. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Why do we need JSR-363? There are no specifications or standards for handling units in Java. The current solution is to use primitives, that don’t provide any Type Safety. The errors are difficult to find using unit testing: Interface and Internationalization (e.g. radian/degree, meters/feet); Arithmetic operations (e.g. overflow); Conversion between units (e.g. from same domain);
  13. 13. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI 5,999 miles A Quantity A Unit What is the problem, in code? int distance = 5999; //in miles float speed = airplane.getSpeed(); //in km/h System.out.println(“ETA: “ + (distance/speed) + “ h”);
  14. 14. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is JSR-363, in code? Quantity<Length> distance = Quantities.getQuantity(5999, US.MILE); Quantity<Speed> airplaneSpeed = getAirplaneSpeed(); Quantity<Time> eta = (Quantity<Time>)distance.divide(airplaneSpeed); System.out.println(“ETA: “ + eta.to(Units.HOUR)); ETA: 10.216345960256564 h
  15. 15. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is Physikal? Library providing Kotlin extensions and ease of use functions for Java Units of Measurement libraries based on JSR-363. Contains • Core - Basic Metric units. • SI-Units - SI units. • Complete-Units - All units including US or Imperial.
  16. 16. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is Physikal, in code? Create Units val added = 10.metre + 1.kilo.metre >> 1010.0 m val small = 10.metre val large = 10.kilo.metre
  17. 17. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is Physikal, in more code? Includes all operators val added = 10.metre + 1.kilo.metre >> 1010.0 m val speed = added/10.minute >> 101 m/min var aFewSeconds = 5.second aFewSeconds++ >> 6.0 s 10.peta.watt > 2.watt >> true
  18. 18. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI What is Physikal, in more code? Using different units (SI units & other units) 5.gram + 2.pound >> 912.18474 g (13.kilo.gram + 20.pound) convertTo STONE >> 3.47572100600243466674378 st
  19. 19. © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI Links Public JSR-363 mailing list(s) and/or forum(s) Units-Dev on Google Groups Units-Users on Google Groups JSR-363 page: https://jcp.org/en/jsr/detail?id=363… Project Website: http://unitsofmeasurement.github.io on GitHub Tenkiv: https://tenkiv.com Physikal: https://github.com/Tenkiv/Physikal
  20. 20. @YourTwitterHandle#DVXFR14{session hashtag} © 2017 Creative Arts & Technologies and others. All rights reserved.#Physikal @UnitAPI

×