Stretto

235 Reputation

5 Badges

6 years, 58 days

MaplePrimes Activity


These are questions asked by Stretto

Normally the wheel mouse will scroll a file like it does in just about every other program... but when the mouse is over a code edit region it does nothing ;/ As one is scrolling with the wheel and a code edit region pops up this breaks the flow and requires hoops, I don't like hoops!

 

Seems most mouse funcitons do not work well in the region. Just trying to select and drag doesn't scroll the region.

I have a proc f(a,b)

 

For example

m := n->piecewise(type(n,even),0, 1):
f := proc(a,b)
    m(a*b);
end;

 

when I execute f(a,b) I get 1!!

 

for some reason the type is returning that it is not even, even though the expansion needs to be delayed.

I did this because mod was also doing this. I replaced it so I could undefine m and actually get a general expansion in terms of m.

 

Is there any way to get it to delay the expansion? I guess I need to check if the type is a "variable" or not an itneger and just return it.

 

I've created

 

m := n->piecewise(type(n,even),0, type(n, integer), 1, M(n)):

 

which seems to work but this is not ideal because sometimes M is returned even if an integer is used when used in other expressions. I suppose it is how ever maple figures out how evaluate things.

 

 

I have several plots where I use display(a,b,c). Maple displays them with display(actual plot of a, actual plot of b, ...).
I've tried adding insequence but nothing and also tried passing them as sets or lists. In earlier versions I could use display(plots) and it would display all the plots on one plot together but now maple always separates them. I'd rather have the old behavior.

How do I get them to plot on the same plot and is there any way to set it as a global ooption?

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.

 

 

 

First 11 12 13 14 15 16 Page 13 of 16