Carl Love

Carl Love

28060 Reputation

25 Badges

13 years, 19 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

You only need 1 loop. I can't even conceive of using two.

Edit: Upon further thought, I do see that two nested loops could be used: The outer loop checks convergence conditions, and the inner loop does the updating of the solution vector. 

You need a multiplication sign after the first x. A space may also work, but I prefer an explicit sign.

Simple solve works:

solve(abs(x^2-3*x) + 4*x - 6, x);
              1, -3 

Or are you looking for a way to solve it "by hand" that doesn't involve breaking it into two cases? I don't think that there's any better way. It is the way that I teach it.

Indeed, there is a package named Student:-VectorCalculus, but it's not needed to create vector-valued functions. No package is needed. For example,

Helix:= t-> <cos(t), sin(t), t>

is a vector-valued function.

Simply

ColorTools:-NearestNamedColor~(c);

Surely something like that must've occurred to you?

The order of a permutation is the least common multiple of the lengths of its orbits. So, the order of the permutation that you show is 3. The order of the permutation from your last question is 20. 

If the order is o, then P^e = P^(e mod o).

The mathematical constant that you have as "pi" is spelled Pi (with uppercase P) in Maple. Once you make this correction, the pdetest will take an extremely long time (20 minutes or so), and will not provide a very useful answer (it'll have an unevaluated limit).

You can remove the inequalities and filter the solutions like this:

select(type, eval~(' '[x,y]' ',  {isolve}({x^2+y^2 = 29})), list(posint));

Or, for this specific problem, you could use a dedicated command:

NumberTheory:-SumOfSquares(29);

You've defined the expression to be plotted as

Bst:= [some long expression, 0]

What do you mean by that? I'm pretty sure that Maple's interpretation of what that means---a list of two separate algebraic expressions---is not what you intended it to mean.

It is done like this:

P:= Matrix(10, shape= identity)[convert([[1,4,6,9,10],[2,3,5,7]], permlist, 10)];

The convert(..., permlist, 10applies the permutation to the list [1, 2, ..., 10].

Using a list to index a Matrix permutes the Matrix's rows as specified by the list. If the Matrix that that's being done to is the identity matrix, the result is a permutation matrix.

All that you need is

op~(0, indets(x, function))

Do you want to know why that works? Or do you want to know why it continues to work after you put {name, `+`, `*`} after function?

If A and are lists with the same number of elements, then 

​​​​​​`[]`~(A,B)

is the list of pairs that you want.

The syntax of kernelopts is kernelopts(settingvalue),

so,

kernelopts(assertlevel= 2);

For this application, I would use Records. Deep type checking is much easier with Records than with tables. But why do you copy the record? I think that you should update the input record inplace. Copying will cost both time and memory. So, here's my version of your foo3:

foo3a:= (input::record(x::algebraic, y::algebraic, result::identical()))->
    (input:-result:= input:-x*input:-y)
:
foo3a((input:= Record("x"= 4, "y"=6, "result"= ())));
                               24

eval(input);
               Record(x = 4, y = 6, result = 24)

 

This is a bit more efficient than has, and definitely more to-the-point:

remove~(`=`, A, 0);

Note that if had a sublist such as [f(x,0), 3, 4], then has would cause the f(x,0) to be removed because f(x,0) has 0.

First 101 102 103 104 105 106 107 Last Page 103 of 395