protrader

409 Reputation

7 Badges

16 years, 315 days

MaplePrimes Activity


These are replies submitted by protrader

Alec,

Thanks a million, you are a real master man! I have 3 questions:

1) I refered to the help page of rtable_scanblock but I could find enough info about the details, like: what is val or res or res[2] and so on. Could you please explain what they are?

2) And your second solution is just amazing. Could you explain the second one too, I cannot get how it works?

3) Can we modify this to find the index of a given value(s)? e.g.

M:=Matrix([[1,2,9],[-4,5,0],[3,9,2]]);

we want to locate 2 which will be (1,2) and (3,3)

TIA

Alec,

Thanks a million, you are a real master man! I have 3 questions:

1) I refered to the help page of rtable_scanblock but I could find enough info about the details, like: what is val or res or res[2] and so on. Could you please explain what they are?

2) And your second solution is just amazing. Could you explain the second one too, I cannot get how it works?

3) Can we modify this to find the index of a given value(s)? e.g.

M:=Matrix([[1,2,9],[-4,5,0],[3,9,2]]);

we want to locate 2 which will be (1,2) and (3,3)

TIA

it is a finite element problem. I mesh a bar with an amount of elements like 4 or 5 or so. One of the elements is important  and its length should be determined by user after the mesh. The mesh is structured, that means their length are the same. Then the user enters thelength of the specific element. That length should NOT exceed the length of other elements e.g.

I have not used any maplet yet in my program. I have assigned the values (L and N) and in the first lines of my program.  The user can change these values and when he runs the program, it calculates the length of the elements.

L=length of bar=1 m

N=Number of elements=4

length of each element=0.25 m

after some other calculations, the user should specify the length of the specific elemnts (say the 2nd element or 3rd, it does not matter)

So the user should enter any length smaller than 0.25, if he enters 0.3, there will be an overlap which destroys everything and the program runs for some seconds without any good result. Of course in this case the user can easily see that there was an error and none of the rest commands or procedures will work well. When I will develp the program much more, there will be so many similar cases like that so I need to communicate with user or define an input maplet that is active and can warn the user once he enters the values. That means for example, when he runs the program, the program asks him to imput values using a maplet, once he imputs L and N, the maplet shows a message that the size of the specific elements should be smaller than 0.25. In fact the program does not allow the user to run the program with invalid inputs. I have done such things with MATLAB but I have less experience with maple

If you need any more info let me know :)

TIA

it is a finite element problem. I mesh a bar with an amount of elements like 4 or 5 or so. One of the elements is important  and its length should be determined by user after the mesh. The mesh is structured, that means their length are the same. Then the user enters thelength of the specific element. That length should NOT exceed the length of other elements e.g.

I have not used any maplet yet in my program. I have assigned the values (L and N) and in the first lines of my program.  The user can change these values and when he runs the program, it calculates the length of the elements.

L=length of bar=1 m

N=Number of elements=4

length of each element=0.25 m

after some other calculations, the user should specify the length of the specific elemnts (say the 2nd element or 3rd, it does not matter)

So the user should enter any length smaller than 0.25, if he enters 0.3, there will be an overlap which destroys everything and the program runs for some seconds without any good result. Of course in this case the user can easily see that there was an error and none of the rest commands or procedures will work well. When I will develp the program much more, there will be so many similar cases like that so I need to communicate with user or define an input maplet that is active and can warn the user once he enters the values. That means for example, when he runs the program, the program asks him to imput values using a maplet, once he imputs L and N, the maplet shows a message that the size of the specific elements should be smaller than 0.25. In fact the program does not allow the user to run the program with invalid inputs. I have done such things with MATLAB but I have less experience with maple

If you need any more info let me know :)

TIA

Doug,

Thanks, my need is way simpler.

constant A should be entered/modified by the user, A must be smaller than B otherwise the program won't work and there will be errors. So I don't need to waste time watching running the program with errors.

To warn the user to give a smaller A I need a warning message/window pops up to ask the user to modify A. It needs one OK button. When we press ok the program stops running and terminates. Then the user can modify the value of A

In a more developed way, the popped up window can inform the user and ask him whether he wants to continue with a new iput for A or he wants to cancel.

 

I hope this clarifies,

TIA

Doug,

Thanks, my need is way simpler.

constant A should be entered/modified by the user, A must be smaller than B otherwise the program won't work and there will be errors. So I don't need to waste time watching running the program with errors.

To warn the user to give a smaller A I need a warning message/window pops up to ask the user to modify A. It needs one OK button. When we press ok the program stops running and terminates. Then the user can modify the value of A

In a more developed way, the popped up window can inform the user and ask him whether he wants to continue with a new iput for A or he wants to cancel.

 

I hope this clarifies,

TIA

surprisingly it did not work for the thing I wanted. Perhaps I did not explain well. I have a condition that when happens I have to stop executing the maple program (like interruption button which looks like a stop sign)

- - - - - - - - - - -

- - - - - - - - - - -

- - - - - - - - - - -
- - - - - - - - - - -

if c=2 then
[show the alert window]
[exit]

end if

- - - - - - - - - - -

- - - - - - - - - - -

- - - - - - - - - - -

 

surprisingly it did not work for the thing I wanted. Perhaps I did not explain well. I have a condition that when happens I have to stop executing the maple program (like interruption button which looks like a stop sign)

- - - - - - - - - - -

- - - - - - - - - - -

- - - - - - - - - - -
- - - - - - - - - - -

if c=2 then
[show the alert window]
[exit]

end if

- - - - - - - - - - -

- - - - - - - - - - -

- - - - - - - - - - -

 

Alec, I want to use it for warning GUI which has OK and cancel buttons. I want it to stop executing the program when cancel is pushed. The warning wizard pops up when a cindition is due.

Alec, I want to use it for warning GUI which has OK and cancel buttons. I want it to stop executing the program when cancel is pushed. The warning wizard pops up when a cindition is due.

When we have repeated input in the first row, the function returns the last one, how can we change it in a way that it returns all the possible values in a list or vector? e.g.

A:=Matrix([[B, C, F, G, B, 8, 9], [0, 1, 2, 3, 21, 22, 23]]);

f(B)=[0,22]

When we have repeated input in the first row, the function returns the last one, how can we change it in a way that it returns all the possible values in a list or vector? e.g.

A:=Matrix([[B, C, F, G, B, 8, 9], [0, 1, 2, 3, 21, 22, 23]]);

f(B)=[0,22]

Alec, it does not work in maple 9.5?

Alec, it does not work in maple 9.5?

I tried the automated way but it did not work. I am using Maple 9.5.

The fact is that if the vecor is large, then I should eliminate some of the components that I have their order in a vector or a list:

e.g.

A:=<4,5,3,0,8,12>

elim-order:=[2,3,5]

answer=<4,0,12>

how can we do this?

1 2 3 4 Page 3 of 4