3
$\begingroup$

I have a simple definition as follows and the result expected is in either EngineeringForm or ScientificForm

DurationOfAcquistion[RatePerSec_, RecordLength_] := 
  EngineeringForm[RecordLength/RatePerSec];

DurationOfAcquistion[20.*10^6, 1000] (* results in 50.x10^-6 *)
Manipulate[
 DurationOfAcquistion[r, rl], {r, 20*10^6, 1.25*10^9}, {rl, 1000, 
  125*10^6}]

1

When I deploy the same function definition using Manipulate, I can't seem to get it in either Engineering/Scientific form. I am currently using MMA 11.3 release. Can someone please confirm if this is how it's supposed to be or is there an alternative way?


EDIT

I really have to apologize, this may be like a bug in output format display, but not a serious one. I was able to see the output in EngineeringForm once I started manipulating the sliders >>> Please watch the GIF here.

$\endgroup$
2
$\begingroup$

You need to make the initial value of r or rl a real, instead of an integer (otherwise the initial value of rl / r will be a rational). For example:

Manipulate[EngineeringForm[rl / r],
  {r, 20.0*10^6, 1.25*10^9},{rl, 1000.0, 125*10^6}]

In this case the initial values of both r and rl are reals, but you only need to make one of them real.

$\endgroup$
2
$\begingroup$
Manipulate[N @ DurationOfAcquistion[r, rl], {r, 20*10^6, 1.25*10^9}, {rl, 1000, 125*10^6}]

enter image description here

Alternatively, change the right-hand-side to

EngineeringForm[1. RecordLength/RatePerSec]

when you define DurationOfAcquistion.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.