Indices

Hi!

I have a big prob:

I have to do a quite long calculation for a construction.

In order to be able to keep track I need to use variables with indices like xEngine, xGearbox, ...

But when I for example define x:=5, and later I want to use vx (describing velocity in x-direction) maple understands v5.

If I define vx as "atomic identifier" - what seemd to be the solution for my problem - I can not use the solve-function anymore. It just does not work anymore.

I would be very greatful if somebody could help me.

Thanks!

Axel Vogt's picture

indexing = function on discrete values

does it work for x(5) instead of x[5] ? indexing is a bit hairy ... the other thing may be to use subs( x[Engine] = 5 , ...) ... not sure, what you mean exactly

Hi! Thanks for your

Hi!

Thanks for your reply!

No - I want to use "vx"as a single Variable. Like "y" or "b". No v1, v2,...

What I for example want to do is:

5* vx = 7      ----->solve for vx

acer's picture

atomic identifiers

It may be necessary to toggle each relevant instance of v_x (which gets created as table-reference v[x] by default) as an atomic identifier.

In other words, you have to toggle it in each of your equations, and also in your solve() call if you use it as one of the variables for which to solve.

Or use the subliteral item from the palettes, for each and every occurence.

And make such that none of them are in any special font (bold, italic, size, etc) before toggling as atomic.

In short, you have to make sure that all the instances of v_x really are the same atomic name, for solve() and Maple to recognize then as being the same.

Wouldn't it be nice, if v_x got typeset as v with an x as the subscript without getting converted by default to the indexed name v[x]? If that were so, then all this atomic identifier effort would not be required. I cannot recall having seen anyone post code where the table-reference nature of subscripted input names was desired.

acer

atomic identifiers

For 2D Math input in Maple 12, <Ctrl>-underscore should result in an atomic identifier, without having to use palettes or context-menus. 

Dave Linder
Mathematical Software, Maplesoft

It creates

eg the Maple-mathml name

`#msub(mi("x"),mi("a"))`;

 `#msub(mi(x),mi(a))`;

I am using maple11. For

I am using maple11.

For example I do:

1. 5*v_x=7

2. enter

3. right mousebutton -> 2D-Math -> convert to -> atomic identifier

4. enter

5. right mousebotton on equation -> solve -> solve for variable -> THERE STANDS: '#msub(mi("v"),mi("x"))'

when I click that - nothing happens.

where can I find this "subliteral item from the palettes"?

acer's picture

I see

I see, the context menus which explicitly suggest the variable names like '#msub(mi("v"),mi("x"))' don't do anything for your equation. That's a bug.

The context-menu items which just do general solving (ie. Solve -> Solve, rather than Solve -> Solve for Variable) seem to work ok.

You could try entering the solve() call by hand, instead of using the context-menus.

solve( eqn, v_x )

where you remember to toggle the v_x as atomic identifier so that it truly matches the name of your variable in the equation.

The subliteral item is in the top-right corner of the Layout palette. You can manage palettes using the top menubar with the choice View -> Palettes -> Show Palette.

acer

Thank you very much for your

Thank you very much for your help!

solve( eqn, v_x ) does work.
But I can not believe that such a bug can occur.

This is an elementary funktion...



edgar's picture

identifiers

Mathematicians use one-letter variables for everything, but computer programs (including Maple) need not do that. So how about using variables named vx and xEngine and things like that?
---
G A Edgar

Computer programs do not care

about long names or 1D output. It is for the humans interacting with the computer,  that it makes a big advantage good typesetting and compact notation in case of long, complex results. Ie it is an issue of efficiency in the machine-human  interface.

I need this subs because

I need this subs because otherwise i would loose track.

But the replies above helped me. Now I use the palette and the solve() funktion. Works pretty good.

Except this problem I like maple very much.

Thank you all for your replies!

Comment viewing options

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