vv

13992 Reputation

20 Badges

10 years, 39 days

MaplePrimes Activity


These are replies submitted by vv

@Rohith 

It's elementary to scale the variables. If x is in a..b with step h, simply take x[i] = a + i*h, i=0,1,...
This way you can use arrays or Tom's code.

@Carl Love 

Unfortunately it seems that  in shadebetween  one must remember to reverse the order of the ranges compared with int.

@Mariusz Iwaniuk 

You have d1 instead of d3 for the 3rd sphere.

@brian bovril 

You have found a bug.

restart;
e:=5:
seq(e,e=[sin(u*Pi),2]);# assuming u::integer;

works. But after deleting ;#  it gives

Error, (in assuming) when calling '`one of {seq, sin}`'. Received: 'illegal use of an object as a name'

 

@mehdi jafari 

R gives the parametrization of the surface in spherical coordinates, R = R(u,v). Recall that the Jacobian is r^2*sin(v).
So, the volume equals
int( r^2*sin(v),  r=0..R, u=0..2*Pi, v=0..Pi);
(or equivalently, the double integral above).
 

@brian bovril 

It seems that you have installed a maple init file which does something wrong.
The code works in Maple 2015, 2017 and 2018.

@Carl Love 

Thank you Carl. I think that the situation is clear now.

@Carl Love 

Why are you mentioning only undefined symbols? E.g. Beta is defined and Beta('''f''', A)(x)  acts the same.
The problem is that evalapply is builtin and its action on most functions is not documented. Probably it matters whether the procedure is associated to an operator (such as `[]` and `+`); that's why I have mentioned `&+`.
Note that it's possible to define `evalapply/Beta`  but `evalapply/[]` is ignored.

 

@Carl Love 

You say "this behavior is a natural and logical result of the overall design".
However, the procedures `[]`, `+`   behave differently than  `&+`, `or`  wrt evaluation of  '''f'''

 

['''f''', A](x);
`[]`('''f''', A)(x);
`+` ('''f''', A)(x);
`&+`('''f''', A)(x);
`or`('''f''', A)(x);
    [('f')(x), A(x)]
    [('f')(x), A(x)]
    ('f')(x)+A(x)
    (`&+`(''f'', A))(x)
    f(x) or A(x)

@Christian Wolinski 

I don't quite understand this type of comments. It would be neater to see the command line followed by its result (given by Maple) and your expected result (+ maybe some explanations). Otherwise it's just some obfuscated code, and the reader is supposed to decrypt it.

On the other side, do you want to program something in Maple and the evaluation of  [...](...)  makes this impossible? In this case please present an example.

 

@ebrahimina 

I don't understand the relevance of your computations for non-square matrices.
If you have two square matrices A,B then the eigenvectors are of course OK.

restart;
with(LinearAlgebra):
m:=4;n:=4;
A:=evalf(RandomMatrix(m,n));
B:=evalf(RandomMatrix(m,n));
Bt := HermitianTranspose(B);
InvBtB := MatrixInverse(Bt . B);
PseudoInvB := InvBtB . Bt;
InvBA := PseudoInvB . A;
ek,vk := Eigenvectors(InvBA)
vkt:=vk^+;

(A-ek[1]*B).vkt[1]^+;  # check ok,  the result is almost 0.

Changing now  m:=4;n:=3;  the result is far from 0.

@Rouben Rostamian  

Nice, vote up!
It would be even nicer to not ignore the overlap of the two cylinders. It seems that Mathematica can do it automatically as a triple integral over their union.
In Maple it is not too difficult. For example, let's compute the mass of the intersection. We take r=1 here.

S:=solve({x^2+z^2<1,  y^2+z^2<1,  x>0},[x,y,z]): # the interesction
remove(hastype,S,`=`);
  
[[x < 1, 0 < x, y < -x, -1 < y, z < (-y^2+1)^(1/2), -(-y^2+1)^(1/2) < z], [x < 1, 0 < x, y < x, -x < y, z < (-x^2+1)^(1/2), -(-x^2+1)^(1/2) < z], [x < 1, 0< x, x < y, y < 1, z < (-y^2+1)^(1/2), -(-y^2+1)^(1/2) < z]]

z=-sqrt(-y^2+1)..sqrt(-y^2+1), y=-1..-x, x=0..1: M1:=int(1,%);
M1 := 2/3
z=-sqrt(-x^2+1)..sqrt(-x^2+1), y=-x..x, x=0..1: M2:=int(1,%);
M2 := 4/3
z=-sqrt(-y^2+1)..sqrt(-y^2+1), y=x..1, x=0..1: M3:=int(1,%);
M3 := 2/3
M1+M2+M3; # mass
8/3

 

So, you have two non-square matrices A,B and want to compute the eigenvalues e_k  for B'A, where B' is the generalized inverse.

What relations do you hope to have between A, B and e_k ? I am skeptical concerning the usefulness of this approach.

@ebrahimina 

If Maple  does not use parallel algorithms for these, it will be very tough for you to implement them.

@ebrahimina 

I don't think that Maple can speed up significantly the computations for this precision.
You will need special tools and hardware. For example there are processors having the floating point arithmetic on 128 bits (==>  34 decimal digits) but it is not widely supported.

P.S. Maybe a better algorithm exists for your problem.

First 76 77 78 79 80 81 82 Last Page 78 of 177