Subtitution/explicit calculation

Hi,

I guess the best way if i give an example, what i would like to achive with maple:

q=5kN/m
L=10m
...
M=q*L2/8=5kN/m*(10m)2/8=62.5kN*m

I want to get the underlined part essentially, because im creating calculations in standard report format, with a lot of variables and constants so i cant recall all of the variables before using them, but i have to create a verifiable calculation.
Please let me know if maple capable of this or not. (sorry if its already discussed, i didnt find any similar topic)

 

Doug Meade's picture

working with equations

Maple should be able to extract parts of an object or expression. However, as written, you do not have a valid Maple object.

While Maple is perfectly happy to work with equations, it does not like implicitly multiple equalities (more than 1 equal sign). If you have an equation, say,

eq:= A = B;
                                    A = B

Then you can do manipulations such as:

lhs(eq);
                                      A
rhs(eq);
                                      B
(lhs-rhs)(eq);
                                    A - B

If this does not, directly, answer your question, please give us some more details and let us see if we can help.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

units

This is the closest I could get. All the MySI setup stuff is so that N*m does not automatically turn into joules, etc, as it's supposed to in the SI system. The ``() is to prevent S from multiplying out.

with(Units:-Standard):
Units:-AddSystem(MySI,Units:-GetSystem(SI),N*m,kN*m,N/m):
Units:-UseSystem(MySI):

q:=5*Unit(kN/m);

L:=10*Unit(m);

S:=``(q)*``(L)^2/8;

evalf(combine(expand(S),units));

thank you for the

thank you for the answer,
its close, but still not what i want, i would like to get all of the substitutions and final result (with arbitrary accuracy and units) in the same line and in a clear format( i need only some narrative text, equations->subtitution the variables and the final result (important to see the value of the variables) like in a book), without `` and other stuff, of course i can hide a lot of line, but its still a lot of work to get the right units and formats
i want to make a static calculation of structures, im using  mathcad too, but there i have some problem with the substitution
so if anybody know a great software for document the static calculation (mainly bridges) pls let me know (a maple solution would be the best), thanks



annotated context menu actions

Have you seen the annotated context menu actions? By that I mean what happens when you right-click on an input and then select from the popup menu of action choices. What you end up with is the input-->output with a brief description above the arrow. You can chain several of those in one line. (Whether the annotations appear above the arrows, or not, is a preference that can be set in Maple's Standard graphical interface.)

And those menus can be customized with new types of action (w/descriptions). Hence, I'm pretty sure that Maple can be customized to do something closer to what you've described. The ``() and the expand() could be hidden automatically in this way (ie. "inside the arrow action"). A new action could also be implemented which substitutes into a formula with the values of the variables, while inserting the hidden ``() calls so that it doesn't fully evaluate/expand right away.

So you'd end up with a bunch of lines showing the "assignents" (equations showing values for the variables). And then on a single, new line you could have a chain of arrow actions. First would be the formula without values, then next with the simple substitutions, then next with the combination of units, then next (if you had exact input values) with the floating-point equivalent. And above each arrow could be nice terse words annotating each action. And of course, you'd just have to hide all the (reusable!) setup code.

Does that sound closer?

Doug Meade's picture

annotations can be edited

One addition to pagan's comments.

The annotations that Maple inserts above the arrows is editable. So, if you don't like what Maple inserts, or want to otherwise modify this string, just select and edit it. Couldn't be easier!

While easy, it would be even nicer if users could customize the annotations so the changes could be made consistently and automatically across (at least) a worksheet. This should be doable via the preferences.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}