## 15 Reputation

3 years, 341 days

## How to use printf with units or an alter...

Maple 2020

Hello

I have a funtion defined as

`a := diff(u*ln(m__o/(-q*t + m__o)) - g*t, t)`

where m_0, q, g, and u are constants with dimensions. T is the variable and has dimensions as well. I need to print out columns of this function and other similar functions, v and h, in 4 seconds intervals of t. So what I have is this:

```for i from -4 by 4 to 80 do
if i = -4 then printf("%12s %18s %15s %15s \n", "time", "acceleration", "velocity", "altitude"); else printf("%10d %c %10.2f  %s %10.2f  %s %10.2f  %s \n", i, "s", eval(a, t = i), "ft/s^2", eval(v, t = i), "ft/s", eval(h, t = i), "mi"); end if;
end do```

this works perfectly fine until I assign units to the constants and t. Then I get the error: Error, (in fprintf) number expected for floating point format.

Then I also need to plot a v and h against t. Seems like plot doesn't work either with units.

So what do i do?

Thanks

## Can't get rid of those fractions - help ...

Maple 2020

Hello

Just started out with maple.

I entered a function that looks like this, to find the volume of a sphere: V := (4*Pi(d/2)^3)/3

then I use the eval command like this: eval(V, d = 6.35*mm)

and I get this:(4*Pi(3.175000000*mm)^3)/3

Anything I tried, maple doesn't want to spit out one number! I just need what that is equal to, I don't need an expression with Pi. Spent over two hours trying to figure it out, watching videos etc but no luck! hoping that someone can help me with this!

 Page 1 of 1
﻿