Joe Riel

9660 Reputation

23 Badges

20 years, 3 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@acer Both solutions offered use the determinant.  Suppose the set only consisted of three vectors (of dimension 4).

@Carl Love The bigger problem with that many positional parameters is that it is hard to visually check whether the call is correct. A way around that is to use keyword parameters, the call is then sort of self-documenting.  The same issue arises when using a vector or array to group values; for that reason I generally prefer using a record.  Debugging and maintaining is generally easier when you can associate a meaning with a value.

@assma Thanks for the explanation.  I don't have 2017.0 immediately available to check it on; it looks fine in 2018.2. What OS are you using?

Explain what you think is wrong.  The plot in the worksheet is correct for the given input.

@Kitonum I'm thinking maybe the posted worksheet is not what he has. Or possibly he doesn't realize that, after calling the assign procedure, the values of a and b are assigned so that the evaluation of v(x) does not have a literal a and b (they are globals, not arguments of v), but rather their numeric values. If the latter is the issue, then a and b can be unassigned, say with

a := a': b := 'b':
v(x);
     -1/2*x^2-1/6*x^3+a*x+b

I don't understand what you think is wrong.

@acer Good point, I hadn't noticed that. It would be safe to use RK__1, which will look the same in 2D output.

Consider uploading your mw file here.  Use the green up arrow.

@acer Am guessing he is only using GAMMA because that's what came from the 2D palette.  I don't use 2D math as input; maybe there is a way to access Gamma, which would work and look the same.

Why do want the parameters to be arguments of a procedure? What's the bigger picture? 

@Kitonum While that works, it only does so because s is a global. Inside a procedure you might use

Data:=[seq([theta, solve(subs(thetabn=theta, s = 0), t)], theta=[seq(Pi*k/100, k=1..43)])];

@acer For consistency, I'd probably use algsubs for the first case as well. There should be a nicer way to do this. One could use applyop, but it is too syntactical:

applyop(eval, -1, work, h=0);

Better might be an applydenom function, but it probably isn't useful enough to bother writing. Maybe the better approach is

mtaylor(work, h, 2);

applied to the result of the integral. The second substitution can be achieved with

simplify(work, {g = G*M/R^2}, [G]);

@vv While I'm not convinced of the importance of that operation, here is a way to do that without creating new mutable elements.

# Combining the following two steps into a single step generates a set with only two Vectors
# because Maple's simplifier removes the "duplicate" before the Vector is generated.
S := <1>, <1>, <2>:
S := {S}:
S := {entries(table([seq(convert(x,list)=x, x = S)]), 'nolist')};

@vv Nice workaround. Here's maybe a clearer way to convert indexed names to symbols:

sys1 := subsindets(sys, indexed, convert, symbol);

@John Fredsted It's unfortunate that that there is no way to pass the third argument to coeffs, to assign the terms of p, without passing the optional second argument. One could pass indets(p) to coeffs.  Here's a variation that collects the terms that have a common coefficient. 

C := [coeffs](p,indets(p),'T'):
A := add(``(C[i])*T[i], i=1..numelems(C)):
collect(A, ``~(C));
First 22 23 24 25 26 27 28 Last Page 24 of 195