Robert Israel

6577 Reputation

21 Badges

18 years, 212 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

... or try

> dsolve(ode, y(x), useint);

 

... or try

> dsolve(ode, y(x), useint);

 

1) You need to remove the units: ArrayInterpolation just wants numbers.
2) Your Ay has 19 elements, but Z has 15.

-- Oops, never mind: I must have looked at the wrong list.


3) In general it's best not to do calculations using evalf with small values of Digits: roundoff error can be very bad.  If you want to round to 4 digits, first
do the calculation and  then apply evalf[4] to the result.  I don't think this makes much difference in this case, though.

1) You need to remove the units: ArrayInterpolation just wants numbers.
2) Your Ay has 19 elements, but Z has 15.

-- Oops, never mind: I must have looked at the wrong list.


3) In general it's best not to do calculations using evalf with small values of Digits: roundoff error can be very bad.  If you want to round to 4 digits, first
do the calculation and  then apply evalf[4] to the result.  I don't think this makes much difference in this case, though.

Unfortunately the <maple> tag doesn't really work with a Matrix.  If you highlight both input and output, copy with Ctrl-C, and then paste into the editing window, you should get a pretty-printed text version of the output.  You can then set the Format for that paragraph to Formatted.

 

> Matrix([[1, 2, 9], [-4, 5, 0], [3, 9, 2]]);


                                 [ 1  2  9]
                                 [        ]
                                 [-4  5  0]
                                 [        ]
                                 [ 3  9  2]

Unfortunately the <maple> tag doesn't really work with a Matrix.  If you highlight both input and output, copy with Ctrl-C, and then paste into the editing window, you should get a pretty-printed text version of the output.  You can then set the Format for that paragraph to Formatted.

 

> Matrix([[1, 2, 9], [-4, 5, 0], [3, 9, 2]]);


                                 [ 1  2  9]
                                 [        ]
                                 [-4  5  0]
                                 [        ]
                                 [ 3  9  2]

labels = [x, `#mo("Area in m")`^2]

labels = [x, `#mo("Area in m")`^2]

You can use the view option to make sure there is some space there.  For example:
 

> plot(x^2,x=-3..3,legend="this is a very very long legend",view=[DEFAULT,-2..9],
      axis[2]=[location=low]);

I think you left out one vital step.

Before hitting <Enter>, right-click on the expression, choose 2-D Math, Convert to, Atomic Identifier.

This is necessary in order for the colour change to appear in the output (and lprint operates on the output, not the input).

 

I think you left out one vital step.

Before hitting <Enter>, right-click on the expression, choose 2-D Math, Convert to, Atomic Identifier.

This is necessary in order for the colour change to appear in the output (and lprint operates on the output, not the input).

 

> find := (A, v) ->  select(i -> (A[op(i)]=v), {indices(A)});

For your example:

> find(M, 2);

        {[1,2], [3,3]}

The way this works is quite simple.  {indices(A)} produces the set of indices of the Matrix A, i.e.
{[1,1], [1,2], ..., [m,n]} if A is m by n (it would also work for an Array, Vector or table). 
select returns the members of an object for which a certain procedure returns true.  In this case the
object is the set of indices, and the procedure checks whether the corresponding entry is v.

> find := (A, v) ->  select(i -> (A[op(i)]=v), {indices(A)});

For your example:

> find(M, 2);

        {[1,2], [3,3]}

The way this works is quite simple.  {indices(A)} produces the set of indices of the Matrix A, i.e.
{[1,1], [1,2], ..., [m,n]} if A is m by n (it would also work for an Array, Vector or table). 
select returns the members of an object for which a certain procedure returns true.  In this case the
object is the set of indices, and the procedure checks whether the corresponding entry is v.

Any Maple object that can be assigned to a variable can be saved in a file, using save

Any Maple object that can be assigned to a variable can be saved in a file, using save

First 79 80 81 82 83 84 85 Last Page 81 of 187