Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.8K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Dynamic [x] with units not solving to a number ? Help ;-)

Posted 11 years ago

Folks,

Can't see to get ff= to show just a single value ?

I would like to input with a slider a vlaue (with units) and let it dynamiclly update in other equations (MAthCAD Like ?)

Please take a look at my code--any help would be greatly appreciated.

ClearAll["Global`*"]


II = t h^3/12;
Kbeam = 3 Esteel II/(l^3);
keff = 2*Kbeam (* two uprights *);
Print ["\!\(\*SubscriptBox[\(I\), \(beam\)]\)=", 
 TraditionalForm[II], ", \!\(\*SubscriptBox[\(K\), \(beam\)]\)=", 
 TraditionalForm[
  Kbeam], ", \!\(\*SubscriptBox[\(K\), \(eff\)]\)=", keff]
m = Quantity[10., "Pounds"];
r = Quantity[5., "Feet"]
g = Quantity[32., "Feet"/"Seconds"^2];
t = Quantity[8., "Inches"];
l = Quantity[9., "Feet"]*Quantity[12., "Inches"/"Feet"];
h = Quantity[16., "Inches"];


Esteel = Quantity[30. 10^6, "PoundsForce"/"Inches"^2];
Print["g=", g, ", t=", t, ", l=", l, ", h=", h, ", \
\!\(\*SubscriptBox[\(E\), \(steel\)]\)=", Esteel]
Print["\!\(\*SubscriptBox[\(I\), \(beam\)]\)=", II, ", keff=", 
 ScientificForm[keff, 3]]
Print["keff=", UnitConvert[Quantity[keff], "Newtons"/"Meters"]]
Slider[Dynamic[v0]]
Print ["v=", v = Dynamic[v0]*Quantity[1., "Feet"/"Seconds"]]
ff = m*(v^2)/r;
Print ["ff= ", ff]
Print["Why above is not solving ? for actual number ? The quantities \
are correct"]

Regards,

John

POSTED BY: john massucci
4 Replies
POSTED BY: Sean Clarke
Posted 11 years ago

Again, thank you for your help -John

POSTED BY: john massucci
Posted 11 years ago

Ok, thanks for the tip (I'll be clearer )--Attached is the code See two questions below

Attachments:
POSTED BY: john massucci

I am not sure I understand what you are asking. Can you try removing the extraneous parts of your code. Just include enough code to show the problem you are seeing. Try to make it as simple as possible. Make a simple example with just a couple of lines instead of this example which has many variables.

You asked:

Can't see to get ff= to show just a single value ?

Can you explain futher what you mean? What kind of behavior do you see? What kind of behavior do you want?

In the code you asked:

Why above is not solving ? for actual number ? The quantities are correct"

I'm not sure what this is asking. Can you be more precise about what you mean?

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard