janhardo

700 Reputation

12 Badges

11 years, 41 days

MaplePrimes Activity


These are replies submitted by janhardo

@vv 

Thanks!

Was not intented to ask something again about the math behind a possible procedure , although interesting
I do have some calculus books about two variables and old studymaterial, so no shortage about theory.

I see a 3 x3 Hessian determinant ..(for  x,y,z) , i know only a 2x2 hessiaan determinant for functions of two variables and never got lectures about 3d conics(solids).  

My question was not to  the point, but  must be about the classification of quadric surfaces.  
It seems that you give at the end of the worksheet a classification and as start a formula f , unfortanely don't know their connection

I do have still a lot of programming tasks for working on it.    

 

@Joe Riel 

Do you want use Maple on the same way as with Mathematica and Direktmath?
Like doing math by hand..interesting.

When i tried to rearrange the expression for a conic classification it become difficult , because its nowhere  documented on one place how this exactly in Maple can be done  
In another study book i got the advice don't bother about simplification, because Maple can handle big expressions, but that was for engineering  

 

@Joe Riel 

That object orientated programming is this possible in a Maple procedure to get his at a higher level of programming?

Object orientated programming should be a better way of programming than ..... 

@Joe Riel 

Thanks

I am curious  with my modest knowledge of programming procedures,  has this  something to do with object  inheritance.?

@Joe Riel 

Thanks

I don't know too  how a programming toolbox must be filled with the regular programming commands  ?
There is so much possible with programming in Maple and on different ways.
A toolbox was  for sale in the past  (Maple V), but as you noticed its not useful anymore 
 

Learning programming in Maple is starting with easy programming tasks to difficult tasks.
That's the challence for educators who want to learn people programming in Maple.   

 

@janhardo 
I want to add vertical lines to the cornerpoints of the (step)planes to the roster with  command spacecurve, but even for one manual input the vertical line plot is not to get ? 
Later on make it general..
 
 

@tomleslie 

Thanks.

I really think that there was such a toolbox focussed on programming in Maple back in 2000
Not focussed on Matlab.
Is there now a toolbox to get what supports programming?

On the other hand why it should not exists anymore, if there was such a toolbox in the past ?


 

@janhardo

 The domain roster is correct, but not all planes can be used as input

 

 

@janhardo 
Also got education(not extensively)  in matrix and determinants theory,although a long time back , so i can study the subject,but it is a lot to study. 

https://en.wikipedia.org/wiki/Matrix_representation_of_conic_sections

The Ax^2 + By^2 + Cx + Dy + E = 0 general formula is programmed for conics by inspecting the formula and rearrange it and look at the conics definitions.   
Don't know if this is intendend to do it on this way by the authors of the book to improve your programming /analyzing skills at that time 2002 ( further in the book the authors using matrix and determinants fo rprogramming)

So i could be still possible to program conics2 by inspecting the general formula  Ax^2 + Cy^2 + Bxy + Dx + Ey + F = 0  and rearrange it .. ? ( see my post ) 

@vv 

Thanks!

Looks interesting the programming and the result of course.
No background study material of this all, so there is nothing to learn for me from this as you mentioned earlier.

The original question was :

(2)  Write a conics2 procedure that will classify a quadratic equation of the form
             "Ax^2 + Cy^2 + Bxy + Dx + Ey + F = 0"


where there is a cross term. You might want to review the conic sections chapter in you calculus book.  This classification involves a rotation of axes and is considerably more complicated.

This means the programming of the book task: conics2 is not so advanced as your example

Maybe got the students for the programming course more background information than i had ?  
Its mission impossible for me

The nice thing on this procedure P is that it include also the conics from general formula
Ax^2 + By^2 + Cx + Dy + E = 0
It are parabolas, ellipses and hyperbolas in any orientation covered by  proc P and the degenerated cases

 I discovered in my programmed procedure conics : conics(1,2,3,4,5) gives "no graph"

that's wrong..no still correct!.
How could i ever doubt to this programming made by a professional    
P(1,0,2,3,4,5);
         2      2                      
        x  + 2 y  + 3 x + 4 y + 5 = 0, 

          Type = "This equation has no real solutions."  =. no graph


Is it that the rotation axes also must be plotted against the xoy system for the conics in the task ? 


 

@vv 

Thanks

Yes, i agree with you
Of course you must first master the math if you want to optimal work/solve with it in Maple.
Doing it by hand first with exercises.
I did it with series : a topic not mastered by me and then in Maple makes it harder.

In this case of conics:=proc(A,B,C,D,E) it was only elementair formula manipulation for the general formule Ax^2 + By^2 + Cx + Dy + E = 0.

Note: 

example 

conics(1,2,3,4,5); ( all + ) 
                           "no graph" => wrong : something went wrong in the bookexample code ?.NO its correct

The same can be done for conics2 ,but is more complicated with all those cases to reckon with.

@vv 

Thanks

I am aware of this , but the exercise is about classifying conics it is not about solving for values
What i did for Ax^2 + By^2 + Cx + Dy + E = 0

You can try out ..

example 

conics(1,2,3,4,5); ( all + ) 
                           "no graph" => wrong : something wrong in the bookexample code 

conics(0,1,2,3,4); 
                       " laying parabola"

conics(0,0,2,3,4);
                             "line"

conics(0,0,0,3,4);
                             "line"

conics(0,0,0,0,4);
                           "no graph"

conics(0,0,0,0,0);
                       "the whole plane"

restart: with(student):with(plottools): with(plots):
conics:=proc(A,B,C,D,E)
  local N,M,O, ans;
    if A<>0 and B<>0 then #(1)
         M:=evalf((B*C^2+A*D^2-4*E*A*B)/(4*A*B)); 
           if M=0 then 
                 if A*B>0 then ans:= "point"
                 else ans:="two lines"
                 end if;
           elif M<>0 then
              if (M/A)>0 and (M/B)>0 then  ans:= "ellipse" 
             elif (M/A)<0 and (M/B)<0 then ans:= "no graph" 
             else ans:="hyperbola" 
             end if;
           end if;
     elif A=0 and B<>0 #(2)
           then N:=-E/B+D^2/(4*B^2);
            if C<>0 then ans:=" laying parabola"
            elif C=0 then 
              if N>0 then ans:="two lines" 
              elif N=0 then ans:="point" 
                else  ans:="no graph"
              end if;
            end if;
     elif A<>0 and B=0 #3 was excercise
           then O:=-E/A-C^2/(4*A^2);
            if D<>0 then ans:=" vertical parabola"
            elif D= 0 then 
              if O>0 then ans:="two lines" 
              elif O= 0 then ans:="point" 
                else  ans:="no graph"
              end if;
            end if;

     elif A=0 and B=0 then #(4)
           if C<>0 or D<>0 then ans:="line"
           elif E=0 then ans:="the whole plane"
           else ans:="no graph" 
           end if;
      end if;
      ans; 
     end proc:
------------------------------------------------------------

Ax^2 + Cy^2 + Bxy + Dx + Ey + F = 0 i try to classyfying conics for this 

It seems to be not yet correct this formulamanipulation above ?

Corrected 


 

Transformation of eq 1 in wanted eq 2 form

A*x^2+B*x*y+C*y^2+D*x+E*y+F = 0 (general form 2)

After complete square for x and y and some rearrangment (general form 2) ,  i got this equation eq1  

 

 

(A*(x + (B*y + D)/(2*A))^2 + C*(y + (B*x + E)/(2*C))^2)/(-C*y^2 - E*y - 2*F + (B*y + D)^2/(4*A) - A*x^2 - D*x + (B*x + E)^2/(4*C))=1;

(A*(x+(1/2)*(B*y+D)/A)^2+C*(y+(1/2)*(B*x+E)/C)^2)/(-C*y^2-E*y-2*F+(1/4)*(B*y+D)^2/A-A*x^2-D*x+(1/4)*(B*x+E)^2/C) = 1

(1)

eg1:= (-4*A^2*C*x^2 + (-4*y^2*C^2 + (-8*B*x*y - 4*D*x - 4*E*y)*C - (B*x + E)^2)*A - (B*y + D)^2*C)/(4*A^2*C*x^2 + (4*y^2*C^2 + (4*D*x + 4*E*y + 8*F)*C - (B*x + E)^2)*A - (B*y + D)^2*C) = 1;

(-4*A^2*C*x^2+(-4*y^2*C^2+(-8*B*x*y-4*D*x-4*E*y)*C-(B*x+E)^2)*A-(B*y+D)^2*C)/(4*A^2*C*x^2+(4*y^2*C^2+(4*D*x+4*E*y+8*F)*C-(B*x+E)^2)*A-(B*y+D)^2*C) = 1

(2)

 

 

 

 

 

 

lijkt niet op eq1 !

(1) wanted form of eg1
"A x^2+B x y+C y^2+D x+E y+F=0*("general form 2))

for M ≠ 0

 

(x+(B*y+D)/(2*A))^2/X+  (y+(B*x+E)/(2*C))^2/Y = 1

 

Note : what X and Y could be ? :   M/A and M/B  ..

So it must be possible to transform eq1  in this form  above ?

 

Some background info

If B= 0 in (general form 2) you get (general form 1)  

 

(2) In book for M ≠ 0 as example we get this form
 Ax^2+Cy^2+Dx+Ey+F = 0(general form 1 )

(x+C/(2*A))^2*A/M+  (y+D/(2*B))^2*B/M = 1

 

 

restart;# via forum

f := A*x^2+B*x*y+C*y^2+D*x+E*y+F;

A*x^2+B*x*y+C*y^2+D*x+E*y+F

(3)

# complete squares in x and y, then separate the term with x or y

temp := selectremove(has,Student:-Precalculus:-CompleteSquare(f,[x,y]),{x,y});

C*(y+(1/2)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)/C)^2+A*(x+(1/2)*D/A)^2-(1/4)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)^2/C, F-(1/4)*D^2/A

(4)

# equate the first to the negation of the second

temp[1]=-temp[2];

C*(y+(1/2)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)/C)^2+A*(x+(1/2)*D/A)^2-(1/4)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)^2/C = -F+(1/4)*D^2/A

(5)

# alternate way

((a,b)->a=-b)(temp);

C*(y+(1/2)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)/C)^2+A*(x+(1/2)*D/A)^2-(1/4)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)^2/C = -F+(1/4)*D^2/A

(6)

# one way to treat the new rhs (there are others)

((a,b)->a=(numer/denom)(-b))(temp);

C*(y+(1/2)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)/C)^2+A*(x+(1/2)*D/A)^2-(1/4)*((x+(1/2)*D/A)*B+E-(1/2)*D*B/A)^2/C = (1/4)*(-4*A*F+D^2)/A

(7)

# with some forcing sorting of terms

((a,b)->sort(a,order=plex(A,B))=sort(numer(-b),order=plex(C,D))/denom(-b))(temp);

((1/2)*D/A+x)^2*A+C*(y+(1/2)*(-(1/2)*D*B/A+((1/2)*D/A+x)*B+E)/C)^2-(1/4)*(-(1/2)*D*B/A+((1/2)*D/A+x)*B+E)^2/C = (1/4)*(D^2-4*F*A)/A

(8)

simplify( (8), 'symbolic' );

(1/4)*(4*A^2*x^2+((4*B*y+4*D)*x+4*C*y^2+4*E*y)*A+D^2)/A = (1/4)*(D^2-4*F*A)/A

(9)

(4*A^2*x^2 + ((4*B*y + 4*D)*x + 4*C*y^2 + 4*E*y)*A + D^2)/(4*A)/(D^2 - 4*F*A)/(4*A)=1;

(1/16)*(4*A^2*x^2+((4*B*y+4*D)*x+4*C*y^2+4*E*y)*A+D^2)/(A^2*(D^2-4*F*A)) = 1

(10)

 

 

Check-----------------------------------------------------------------------------------------------

A*(x + (B*y + D)/(2*A))^2 + C*y^2 + E*y + F - (B*y + D)^2/(4*A)=C*(y + (B*x + E)/(2*C))^2 + A*x^2 + D*x + F - (B*x + E)^2/(4*C);

A*(x+(1/2)*(B*y+D)/A)^2+C*y^2+E*y+F-(1/4)*(B*y+D)^2/A = D*x+C*(y+(1/2)*(B*x+E)/C)^2+A*x^2+F-(1/4)*(B*x+E)^2/C

(11)

(A*(x + (B*y + D)/(2*A))^2)-(C*(y + (B*x + E)/(2*C))^2)=A*x^2 + D*x + F - (B*x + E)^2/(4*C)-(C*y^2 + E*y + F - (B*y + D)^2/(4*A));

A*(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2 = A*x^2+D*x-(1/4)*(B*x+E)^2/C-C*y^2-E*y+(1/4)*(B*y+D)^2/A

(12)

M=A*x^2 + D*x - (B*x + E)^2/(4*C) - C*y^2 - E*y + (B*y + D)^2/(4*A);

M = A*x^2+D*x-(1/4)*(B*x+E)^2/C-C*y^2-E*y+(1/4)*(B*y+D)^2/A

(13)

 

 

 

A*(x + (B*y + D)/(2*A))^2 - C*(y + (B*x + E)/(2*C))^2/(A*x^2 + D*x - (B*x + E)^2/(4*C) - C*y^2 - E*y + (B*y + D)^2/(4*A));

A*(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/(A*x^2+D*x-(1/4)*(B*x+E)^2/C-C*y^2-E*y+(1/4)*(B*y+D)^2/A)

(14)

A*(x + (B*y + D)/(2*A))^2 - C*(y + (B*x + E)/(2*C))^2/(A*x^2 + D*x - (B*x + E)^2/(4*C) - C*y^2 - E*y + (B*y + D)^2/(4*A))=1;

A*(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/(A*x^2+D*x-(1/4)*(B*x+E)^2/C-C*y^2-E*y+(1/4)*(B*y+D)^2/A) = 1

(15)

A*(x + (B*y + D)/(2*A))^2 - C*(y + (B*x + E)/(2*C))^2/M=1;

A*(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/M = 1

(16)

(A*(x + (B*y + D)/(2*A))^2 - C*(y + (B*x + E)/(2*C))^2/M)/A = 1/A;

(A*(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/M)/A = 1/A

(17)

(x + (B*y + D)/(2*A))^2-(C*(y + (B*x + E)/(2*C))^2)/M/A=1/A;

(x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/(M*A) = 1/A

(18)

((x + (B*y + D)/(2*A))^2 - C*(y + (B*x + E)/(2*C))^2/(M*A))/C=(1/A)/C;

((x+(1/2)*(B*y+D)/A)^2-C*(y+(1/2)*(B*x+E)/C)^2/(M*A))/C = 1/(A*C)

(19)

((x + (B*y + D)/(2*A))^2)/C;

(x+(1/2)*(B*y+D)/A)^2/C

(20)

(x + (B*y + D)/(2*A))^2/C-( (y + (B*x + E)/(2*C))^2/(M*A))=1/(A*C);

(x+(1/2)*(B*y+D)/A)^2/C-(y+(1/2)*(B*x+E)/C)^2/(M*A) = 1/(A*C)

(21)

 

 


 

Download vraag1-herleidingconics2_1.mw

@janhardo 

The definitive procedure


 

restart; with(plots):

conics:=proc(A,B,C,D,E)

  local N,M,O, ans;

    if A<>0 and B<>0 then #(1)

         M:=evalf((B*C^2+A*D^2-4*E*A*B)/(4*A*B));

           if M=0 then

                 if A*B>0 then ans:= "point"

                 else ans:="two lines"

                 end if;

           elif M<>0 then

              if (M/A)>0 and (M/B)>0 then  ans:= "ellipse"

             elif (M/A)<0 and (M/B)<0 then ans:= "no graph"

             else ans:="hyperbola"

             end if;

           end if;

     elif A=0 and B<>0 #(2)

           then N:=-E/B+D^2/(4*B^2);

            if C<>0 then ans:=" laying parabola"

            elif C=0 then

              if N>0 then ans:="two lines"

              elif N=0 then ans:="point"

                else  ans:="no graph"

              end if;

            end if;

     elif A<>0 and B=0 #3 was excercise
           then O:=-E/A-C^2/(4*A^2);

            if D<>0 then ans:=" vertical parabola"

            elif D= 0 then

              if O>0 then ans:="two lines"

              elif O= 0 then ans:="point"

                else  ans:="no graph"

              end if;

            end if;

     elif A=0 and B=0 then #(4)

           if C<>0 or D<>0 then ans:="line"

           elif E=0 then ans:="the whole plane"

           else ans:="no graph"

           end if;

      end if;

      ans;

     end proc:

maplemint(conics);

 

Input for conics : A,B,C,D,E to check : 0 and  +  
For 0 and 1  input gives 2^5 = 32 inputs for parabola, lines,points, hyperbola , whole plane, nothing.
Should be useful to check all input automated , but how?

Lets look for the

 # ans:= conics(0, A, D, C, E).

conics(2,0,5,1,-7)# y=-2x^2+5x-7 ;conics(0,0,1,2,3);#y= -0.5x-1.5

" vertical parabola"

 

"line"

(1)

display(implicitplot({2*x^2-5*x+y+7=0,x+2*y+3=0},x=-4..4,y=-8..4));

 

CDExercises

(1) Adjust the conics procedure to classify a circle as a circle instead of as an ellipse.

 

(2)  Write a conics2 procedure that will classify a quadratic equation of the form

Ax^2+Cy^2+Bxy+Dx+Ey+F = 0

 

where there is a cross term. You might want to review the conic sections chapter in you calculus book.  This classification involves a rotation of axes and is considerably more complicated.

Qestion: what is rotation of axes ? and what kind of graphs ?

 

-----------------------------------------------

Note : is conics() procedure above

the input to the procedure are coefficients of a quadratic equation of the form

"Ax^2+By^2+Cx+Dy+E=0 ---------------------"

 

 

 


 

Download def_conics_procedure.mw

 

@janhardo 

Made a analyse analog in the book for case 3

There was enough formula manipulation to do in Maple , but don't know exactly the handling of this all.
So i did it with drag and drop and as start with Student[Precalculus][CompleteSquare]( );

For case #3 (a is not 0 and B=0 ), the parabola is in normal position  


 

Classification of conic sections

mijn herleiding i als acer maar met drag and drop formule gedeelts

restart; with(student):

A*x^2+B*y^2+C*x+D*y+E=0;

A*x^2+B*y^2+C*x+D*y+E = 0

(1)

f:= A*x^2+B*y^2+C*x+D*y+E; # via contextmenu :

A*x^2+B*y^2+C*x+D*y+E

(2)

Student[Precalculus][CompleteSquare]( (2), [y] ); ## voor [x] en [y] tegelijk: zie commando van acer  # hier 1 voor  1 , eerst naar y

B*(y+(1/2)*D/B)^2+A*x^2+C*x+E-(1/4)*D^2/B

(3)

Student[Precalculus][CompleteSquare]( (2), [x] ); # via x  

A*(x+(1/2)*C/A)^2+B*y^2+D*y+E-(1/4)*C^2/A

(4)

 

B*y^2 + D*y + E - C^2/(4*A);

B*y^2+D*y+E-(1/4)*C^2/A

(5)

Student[Precalculus][CompleteSquare]( (5), [y] );

B*(y+(1/2)*D/B)^2+E-(1/4)*C^2/A-(1/4)*D^2/B

(6)

A*(x + C/(2*A))^2+ B*(y + D/(2*B))^2 + E - C^2/(4*A) - D^2/(4*B);

A*(x+(1/2)*C/A)^2+B*(y+(1/2)*D/B)^2+E-(1/4)*C^2/A-(1/4)*D^2/B

(7)

A*(x + C/(2*A))^2+B*(y + D/(2*B))^2=- (E + C^2/(4*A) + D^2/(4*B));

A*(x+(1/2)*C/A)^2+B*(y+(1/2)*D/B)^2 = -E-(1/4)*C^2/A-(1/4)*D^2/B

(8)

 

 

=====================================================

case 2 A=0 en B niet 0

 

B*(y + D/(2*B))^2 + A*x^2 + C*x + E - D^2/(4*B)=0;#A=0

 

 

B*(y+(1/2)*D/B)^2+A*x^2+C*x+E-(1/4)*D^2/B = 0

(9)

B*(y + D/(2*B))^2= -C*x - E + D^2/(4*B);

B*(y+(1/2)*D/B)^2 = -C*x-E+(1/4)*D^2/B

(10)

B*(y + D/(2*B))^2= -C*(x-E/C+D^2/(4*B*C));

B*(y+(1/2)*D/B)^2 = -C*(x-E/C+(1/4)*D^2/(B*C))

(11)

 

(-C*(x - E/C + D^2/(4*B*C)))/B;

-C*(x-E/C+(1/4)*D^2/(B*C))/B

(12)

simplify(%);

(1/4)*((-4*C*x+4*E)*B-D^2)/B^2

(13)

N=%; #

N = (1/4)*((-4*C*x+4*E)*B-D^2)/B^2

(14)

N= (-E/B)+(D^2/(4*B^2)); # for C = 0 in (14), N can be 0, + , or  -

N = -E/B+(1/4)*D^2/B^2

(15)

================================================
case 3 A niet 0 en B=0

 

A*(x + C/(2*A))^2 + B*y^2 + D*y + E - C^2/(4*A)=0;

A*(x+(1/2)*C/A)^2+B*y^2+D*y+E-(1/4)*C^2/A = 0

(16)

A*(x + C/(2*A))^2= -D*y - E + C^2/(4*A);#B=#0

A*(x+(1/2)*C/A)^2 = -D*y-E+(1/4)*C^2/A

(17)

A*(x + C/(2*A))^2= -D*(y-E/D+C^2/(4*A*D));

A*(x+(1/2)*C/A)^2 = -D*(y-E/D+(1/4)*C^2/(A*D))

(18)

 

(x + C/(2*A))^2= (-D*(y - E/D + C^2/(4*A*D)))/A;

(x+(1/2)*C/A)^2 = -D*(y-E/D+(1/4)*C^2/(A*D))/A

(19)

-D*(y - E/D + C^2/(4*A*D))/A;

-D*(y-E/D+(1/4)*C^2/(A*D))/A

(20)

simplify(%);

(1/4)*((-4*D*y+4*E)*A-C^2)/A^2

(21)

O=%;

O = (1/4)*((-4*D*y+4*E)*A-C^2)/A^2

(22)

O=((-4*0*y + 4*E)*A - C^2)/(4*A^2);# for D=0 in( #22)

O = (1/4)*(4*A*E-C^2)/A^2

(23)

O= E/A-C^2/(4*A^2); # can be 0 , + , or -

O = E/A-(1/4)*C^2/A^2

(24)

 


 

Download vraag_herleiding_conic_sections_formule.mw

First 56 57 58 59 60 61 62 Last Page 58 of 73