New Features in Maple 2018 - Units - Maplesoft

What's New in Maple 2018

Units



Maple 2018 offers enhanced tools for using units throughout your analysis. 


Units in Solving, Integration, and Optimization

You can now use use units in numeric equation solving, integration, and optimization. Several functions support units, including fsolve and the optimizers in the Optimization package. In addition, units handling has been improved in the solve command and the int command for symbolic and numeric inputs. 


Example: Adiabatic Flame Temperature of Butane 

Liquid butane is burnt with 100% theoretical air at an initial temperature of 298.15 K. The combustion reaction is 


C4H10 (l) + 6.5 O2 (g)+ 24.44 N2 (g) → 4 CO2 (g) + 5 H2O (g) + 24.44 N2 (g)


Here, we will calculate the adiabatic flame temperature of the combustion products. 


Heat of formation of butane 

> with(ThermophysicalData); -1
> h_f_C4H10 := Chemicals:-Property(
 
Typesetting:-mprintslash([h_f_C4H10 := `+`(`-`(`*`(150664.000, `*`(Unit(`/`(`*`(J), `*`(mol)))))))], [`+`(`-`(`*`(150664.000, `*`(Units:-Unit(`/`(`*`(J), `*`(mol)))))))])
 

Equating the enthalpy of the reactants and the enthalpy of the combustion products gives the adiabatic flame temperature 

> h_N2 := Chemicals:-Property(h_O2 := Chemicals:-Property(h_H2O := Chemicals:-Property(h_CO2 := Chemicals:-Property(

Enthalpy of the reactants 

> H_reactants := `*`(Unit('mol'), `*`(h_f_C4H10))
Typesetting:-mprintslash([H_reactants := `+`(`-`(`*`(150664.000, `*`(Unit(mol), `*`(Unit(`/`(`*`(J), `*`(mol))))))))], [`+`(`-`(`*`(150664.000, `*`(Units:-Unit(mol), `*`(Units:-Unit(`/`(`*`(J), `*`(mo...

Total enthalpy of the combustion products 

> H_products := `+`(`*`(4, `*`(Unit('mol'), `*`(h_CO2))), `*`(5, `*`(Unit('mol'), `*`(h_H2O))), `*`(24.44, `*`(Unit('mol'), `*`(h_N2))))
Typesetting:-mprintslash([H_products := `+`(`*`(4, `*`(Unit(mol), `*`(ThermophysicalData:-Chemicals:-Property(
Typesetting:-mprintslash([H_products := `+`(`*`(4, `*`(Unit(mol), `*`(ThermophysicalData:-Chemicals:-Property(

Equating the enthalpy of the reactants and the enthalpy of the combustion products gives the adiabatic flame temperature 

> fsolve(H_reactants = H_products, T = `+`(`*`(2000, `*`(Unit('K')))))
Typesetting:-mprintslash([`+`(`*`(2379.853026, `*`(Unit(K))))], [`+`(`*`(2379.853026, `*`(Units:-Unit(K))))])

Example: Optimizing the Design of a Fuel Pod 

You are designing a fuel pod with a hemispherical cap, cylindrical mid-section and conical cap. 


Image 


What are values of L, H and R that minimize the surface area while maintaining the volume V at 3 m3


> restart; -1

Objective function - surface area of pod 

> obj := `+`(`*`(2, `*`(Pi, `*`(`^`(R, 2)))), `*`(2, `*`(Pi, `*`(R, `*`(L)))), `*`(Pi, `*`(R, `*`(sqrt(`+`(`*`(`^`(H, 2)), `*`(`^`(R, 2)))))))); -1

Constraint on the volume area of pod 

> cons1 := `+`(`*`(`/`(2, 3), `*`(Pi, `*`(`^`(R, 3)))), `*`(Pi, `*`(`^`(R, 2), `*`(L))), `*`(`/`(1, 3), `*`(Pi, `*`(`^`(R, 2), `*`(H))))) = `+`(`*`(3, `*`(Unit(`*`(`^`('m', 3)))))); -1


All dimensions must be greater than 0 

> cons2 := `<=`(0, R), `<=`(0, L), `<=`(0, H); -1


Hence the optimized dimensions are 

> dimensions := Optimization:-Minimize(obj, {cons1, cons2}, initialpoint = {H = Unit('m'), L = Unit('m'), R = Unit('m')})

Example: Work Done in Isothermal Compression of Methane 

Methane at 350 K is isothermally compressed from a specific volume of 1.0 m3 kg-1 to 0.5 m3 kg-1. Here, we will calculate the work done. 


First, we define an expression that gives the pressure of methane as a function of the specific volume V. 

> P := ThermophysicalData:-Property(

We then perform the numeric integration int(P, V = `+`(`/`(`*`(1.0, `*`(`^`(m, 3))), `*`(kg))) .. `+`(`/`(`*`(.5, `*`(`^`(m, 3))), `*`(kg)))) to calculate the work done. 

> `+`(`-`(int(P, V = `+`(`*`(1.0, `*`(Unit(`/`(`*`(`^`('m', 3)), `*`('kg')))))) .. `+`(`*`(.5, `*`(Unit(`/`(`*`(`^`('m', 3)), `*`('kg')))))), numeric)))
Typesetting:-mprintslash([`+`(`*`(125434.5869, `*`(Unit(`/`(`*`(Pa, `*`(`^`(m, 3))), `*`(kg))))))], [`+`(`*`(125434.5869, `*`(Units:-Unit(`/`(`*`(Pa, `*`(`^`(m, 3))), `*`(kg))))))])

Unit Conversion

Maple 2018 moves the units formatting dialog into the new Context Panel, and enhances its functionality.  


Image 


Changing units takes fewer mouse clicks, and can be used in tandem with numeric formatting to quickly create presentable, readable results. For example, you can reformat this result... 

> with(ThermophysicalData:-Chemicals); -1; Property(
Typesetting:-mprintslash([`+`(`-`(`*`(274957.7153, `*`(Unit(`/`(`*`(J), `*`(mol)))))))], [`+`(`-`(`*`(274957.7153, `*`(Units:-Unit(`/`(`*`(J), `*`(mol)))))))])

...to... 

> Property(
Typesetting:-mprintslash([`+`(`-`(`*`(274957.7153, `*`(Unit(`/`(`*`(J), `*`(mol)))))))], [`+`(`-`(`*`(274957.7153, `*`(Units:-Unit(`/`(`*`(J), `*`(mol)))))))])

...with a few mouse clicks, and without navigating between different dialogs. 

The list of suggested unit conversions now gives you: 

  • Typeset Greek letters, e.g. micro Joules are typeset as μJ
  • Typeset math, e.g. `/`(`*`(J), `*`(mol, `*`(K))) instead of J/mol/K
  • Sensible suggestions for unit conversions, e.g. selecting a result with units of `/`(`*`(kg, `*`(`^`(m, 2))), `*`(`^`(s, 2), `*`(mol))) offers `/`(`*`(J), `*`(mol)) and `/`(`*`(kJ), `*`(mol)) as potential conversions
  • A cleaner, more streamlined experience by removing little used unit systems (although all unit systems can still be set via the command line)