Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 306 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

The read command can be used like an include. You can read in any section of code from a plaintext file consisting of complete statements.

Try

v1:= [seq((tau^2)[lambda,i], i= 1..2)];

latex(v1);

[{\tau}^{2}_{{\lambda,1}},{\tau}^{2}_{{\lambda,2}}]

 

The reason for the subs problem is that the integrals on the left sides of the substitutions have minus signs in front of them. It can't find the corresponding thing with the minus signs in the substitution target. So, change Subs to

Subs:= {-b[1]= -i[1], -b[2]= -i[2]};

 

Student:-LinearAlgebra:-NullSpace(< < 2 | -3 | 6 > >);

There are three differences between map and LinearAlgebra:-Map (henceforth, simply Map): in-place operation, the treatmeat of immutable entries, and the options that can be passed in square brackets.

In-place operation: Map(f, A) changes A. But map(f, A)---like the vast majority of Maple commands---does not change its arguments. It makes a copy of A and changes that. So, your example that purports to show that sometimes map and Map operate the same is incorrect.

restart:
with(LinearAlgebra):
A:= <2>:
B:= Map(x-> x^2, A);

A[1];

               4

B:= map(x-> x^2, A);

A[1];

            4

The treatment of immutable entries: This is what is shown correctly by your second example. If certain entries cannot be changed, then Map does not change them; map does change them, but in the copy of course. In your example, the lower triangle and the diagonal cannot be changed because the Matrix is declared to be unit lower triangular.

Options: Both Map and map have options that can be passed in square brackets next to the command. These options are different, as described on the respective help pages.

 

Rather than saying that print produces no output, I'd say that the output of print is NULL and that it produces printed results as a side effect.

Also, the structures in your first example (in the original Question) are properly called lists, not arrays.

L:= [1,1,1,2,3,3,4]:
[ListTools:-SearchAll(1,L)];

[ListTools:-SearchAll(2,L)];

                              [4]

seq(myfun(V1[[1..k-1,k+1..-1]]), k= 1..numelems(V1));

If you need it in a for loop, then

for k to numelems(V1) do
     myfun(V1[[1..k-1,k+1..-1]])
end do:

There is very useful version of solve called eliminate which returns the partial solutions (i.e., certain variables eliminated from the equations) and the residual equations. Here, I re-solve those residual equations. For educational purposes, I recommend that you look at the results of eliminate below.

eqs:= {3*a+4*b = 3*x, 5*a+7*b = 7*x}:
vars:= {a,b}: newvars:= {z||(1..nops(vars))}:
Subs:= newvars =~ vars/~x:
subs(Subs, solve(eliminate(eqs union Subs, vars)[2], newvars));

A table is easier. Change the line

m:= (T, x1+x2);

to

m[T]:= [T, x1+x2];

That will make m a table. When you want to use the table, type

convert(m, list)

For example,

plot(convert(m, list));

I find no mistakes, just explainable differences between the plots.

The first difference is the grid spacing. The analytic plot is using the default 25x25 grid. The numeric plot is using the grid that you chose for the finite element method, which is 11x11. You can reduce the grid on the analytic plot by including the option grid= [11,11] in the plot3d command.

The other difference is the scaling on the x and y axes. In the analytic plot, these are of course the x= 0..1 and y= 0..1 which are the true scaling of the problem. But the numeric plot is generated with the matrixplot command, which by default uses the row and column numbers of the matrix for the independent-axes labelling. The matrix data contains only the z values; the scaling for the other axes cannot be deduced from it. The axes on the matrixplot can be rescaled by adding the option

axis[1,2]= [tickmarks= [1=0, 2=``, 3=.2, 4=``, 5=.4, 6=``, 7=.6, 8=``, 9=.8, 10=``, 11=1]]

Making both of those changes, I get these plots:

No. If you try it, you'll get an error message saying that the method can only be used on linear ODEs.

dsolve({diff(y(x),x) = y(x)^2, y(0)=1}, {y(x)}, method= laplace);

Error, (in dsolve/inttrans/solveit) transform method can only be applied to linear ODE

Try this:

sort(add(a||k*x^k, k= 0..N), x, ascending);

No explicit print command is required.

Let me know how that works for your situation.

While it is not exactly changing the font, permanently changing your zoom factor is easier than permanently changing your default font size, and it may just as well be a solution for your vision issue. Go to the Tools menu and open the Options dialog. Go to the Interface tab. The third item is "Default zoom". Set it at 125% and then click Apply Globally at the bottom of the dialog.

If an expression needs to be fully evaluated before becoming the body of a function, then use unapply to create the function, like this:

a:= 3*x+5:
f:= unapply(a, x);

f(1);
                                        8

First 310 311 312 313 314 315 316 Last Page 312 of 395