15 Reputation

3 Badges

4 years, 250 days

MaplePrimes Activity

These are questions asked by bacalfa

I'm trying to plot a piecewise function whose return value has units, but I get an error saying that it found a "name" (i.e., the unit symbol).


> f := t -> 2*t;

> fp := piecewise(f(tt) <= 4, 1*Unit(W), f(tt) > 4 and f(tt) <= 8, 2*Unit(W), f(tt) > 8, 3*Unit(W));

> plot(fp, tt = 0..10);


I've tried using the option useunits, but no success. Any help will be appreciated.

Is it possible to assign both a value of zero to a variable and a unit? Maple seems to be ignoring the units when I do that.

For example:

a := 0atm

Becomes simply a := 0. My workaround so far is to declare a very small value, e.g.:

a := 1E-6atm

This keeps the units for the variable a. Note that 0 pressure isn't relevant here (the same happens for 0m).


I'd like to define a function after loading the Units package. But when using the defined function, Maple displays "Units:Standard-" everywhere. Even in labels of plots. I'd like to avoid that. A sample file is attached. Is there a better way of doing it?




Page 1 of 1