Kitonum

14289 Reputation

24 Badges

11 years, 228 days

MaplePrimes Activity


These are replies submitted by Kitonum

Dear Mr. Hirnik! Unfortunately, the calculations made ​​by you in the package DirectSearch are wrong! Look at the screenshot and all become clear. First, using the procedure P1 i found true minimum for the first 10 numbers from your list, then for next 15. From the inequality |a+b|<=|a|+|b| obtained a rough estimate of initial minimum. I think that actually it is even much less!

Your code does not work because:

1) For the command DotProduct the option conjugate=false is required.

2) The system has not one but two solutions.

The corrected code:

restart:

with(LinearAlgebra): 

A:=<-1,3,6>: B:=<2,2,-0>: N:=<x,y,z>: o:=<1,-1,7>:

Sys:={Norm(o-N,2)^2=9, DotProduct(N - o, N-A,conjugate=false) = 0, DotProduct(N - o, N-B,conjugate=false) = 0}:

Sol:=[solve(Sys)]:

N1:=[seq(rhs(Sol[1,i]),i=1..3)];

N2:=[seq(rhs(Sol[2,i]),i=1..3)];

Your code does not work because:

1) For the command DotProduct the option conjugate=false is required.

2) The system has not one but two solutions.

The corrected code:

restart:

with(LinearAlgebra): 

A:=<-1,3,6>: B:=<2,2,-0>: N:=<x,y,z>: o:=<1,-1,7>:

Sys:={Norm(o-N,2)^2=9, DotProduct(N - o, N-A,conjugate=false) = 0, DotProduct(N - o, N-B,conjugate=false) = 0}:

Sol:=[solve(Sys)]:

N1:=[seq(rhs(Sol[1,i]),i=1..3)];

N2:=[seq(rhs(Sol[2,i]),i=1..3)];

Your function depends on 4 variables. To plot only if the number of variables does not exceed 2.

Your way is very good!

Here is the corrected code:

 

A:=<0,1,2>:  M:=<2*t,1 + t,-1 - t>: N:=<1+m, -1 -2*m,2+m>:

u:=A - M: v:=A - N:

w:=LinearAlgebra[CrossProduct](u,v):

solve([seq(w[i]=0,i=1..3)]): assign(%):

'M'=M; 'N'=N;

Your way is very good!

Here is the corrected code:

 

A:=<0,1,2>:  M:=<2*t,1 + t,-1 - t>: N:=<1+m, -1 -2*m,2+m>:

u:=A - M: v:=A - N:

w:=LinearAlgebra[CrossProduct](u,v):

solve([seq(w[i]=0,i=1..3)]): assign(%):

'M'=M; 'N'=N;

Why do you think that the parameters of two different lines for the same point must be the same? Take t =- 1 / 3 for the first line, and t = 2 / 3 for the second straight. Get the same point!

Why do you think that the parameters of two different lines for the same point must be the same? Take t =- 1 / 3 for the first line, and t = 2 / 3 for the second straight. Get the same point!

If k is not 0 and not 1, then your problem will have two solutions. For example, for your example the second solution would be if you take k =- 2 in your formulas .

If k is not 0 and not 1, then your problem will have two solutions. For example, for your example the second solution would be if you take k =- 2 in your formulas .

Dear Mr. Hirnyk! The procedure is written for any skew lines and your lines intersect at the point [-1, -1 / 3, 2 / 3].

Of course, checking of the lines may be included in the text of the procedure, but it does not matter!

Dear Mr. Hirnyk! The procedure is written for any skew lines and your lines intersect at the point [-1, -1 / 3, 2 / 3].

Of course, checking of the lines may be included in the text of the procedure, but it does not matter!

If three points A, B and C are collinear, they define a single plane, and each point M of this plane is given by the formula M = xA + yB + zC, where x + y + z = 1. The numbers x, y, z are called the barycentric coordinates of the point M.

If three points A, B and C are collinear, they define a single plane, and each point M of this plane is given by the formula M = xA + yB + zC, where x + y + z = 1. The numbers x, y, z are called the barycentric coordinates of the point M.

The last command  convert(M,list)  provides the list of coordinates of the point M. Copy my code to your Maple and run!   

First 103 104 105 106 107 Page 105 of 107