Stretto

260 Reputation

5 Badges

6 years, 88 days

MaplePrimes Activity


These are questions asked by Stretto

Is there any easy way to use logical "operatives"(not sure what they are called)?

 

e.g., x^2[x=3] = if x = 3 then 3^2 or 0

f(x)[g(x)=x^2] = f(x) when g(x)=x^2

or whatever. I don't care about the syntax but would like it to be short and distinct. There are obviously ways to get the same behavior but they are too verbose. I like the bracket syntax but I doubt maple works with it. It could be done with a binary operator that does the comparison and returns if true...

 

But curious if maple has such a thing built in?

I have a simple proc that generates some arrays based in some input values.

I have a function that uses the proc to do math on the array. I have anoother function that uses that function to do more things. The last function does not evaluate because it says that it is unable to evaluate the sequence in the proc.

 

It seems that because I am summing over the first function and the sum variable is "unknown" the proc cannot create the arrays. Maple is trying to "simply" bottom up rather than top down and craps out.

 

It really has nothing to do with the sequence though but that the input that ultimately gets to the proc involves a negative index. Even though I've attempted to prevent that every possible way such as max(0,j)... even though j is negative higher up in the evaluation maple insists in not clamping it first.

f(max(0,j-1))

 

f cannot deal with negative indicides(even though I also have an if j < 0 then return 0; fi; in the proc)

 

Maple is trying to do some magic annd failing. I've ran in to this problem before and I solved it, I thought, bu using ` ` around the function name... it does not work here.

 

It seems that maple tries to evaluate everything in the proc regardless of the actual inputs used or the if statements before the evaluation(unlike traditional programming which can be sequentially reasoned).

How to stop it from doing this nonsense and just give me what I want?

Error, (in f) out of bound assignment to a list

 

f := proc(i) local A; A := [3,4,5]; if i < 0 then return 0; fi; return A[i]; end;

 

f(-1) works

 

but when used in other things with a variable it fails.

 

 

 

I'm pretty annoyed with maple because when I try to create proc's it dooes not use tabbing or smart tabbing. This makes writing readable code a chore. Basically it's always screwing up alignment. (it wants to left justify things a lot)...

 

What's worse is that using the tab key takes one outside the proc rather than adding a tab, making one having to use spaces.

Any way to fix this?

How can I set the alpha for the plot symbols? I would like to add some alpha for blending purposes(will help with the visual in my case).

 

Idealy I would like to plot a 2d "guassian" fade.

F := proc(f,x)

    f(x); # invalid.

end proc;

 

f := (a,b,c)->a*b*c;

 

F(f,3);

    = 3*b*c;

 

How can I just apply 3 to one of the parameters in F without knowing how man(I really want to apply it to the first parameter but it doesn't matter all that much).

 

I really need to sorty of curry and uncurry a function. I might want to pass an function of arbitrary dimension but only apply a value to one parameter(usually the first).

 

while I could do somethign like

 

F(x->f(x,b,c))

 

this is kinda verbose and requires me to know the parameters of f at the call site, I don't think that is necessary.

First 12 13 14 15 16 Page 14 of 16