janhardo

700 Reputation

12 Badges

11 years, 41 days

MaplePrimes Activity


These are replies submitted by janhardo

@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

@janhardo 

Indeed a parabola in standard position
A error ..division by 0  


 

restart; with(plots):

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

  local N,M,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:="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
           then N:=-E/B+D^2/(4*B^2);

            if C<>0 then ans:="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 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:

 conics(1,-1,-6,5,3);   

"hyperbola"

(1)

 

 

 

conics(2,0,5,1,-7);

Error, (in conics) numeric exception: division by zero

 

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

 

 


 

Download antw_symmetry_of_cases.mw

@Carl Love 

Thanks

That's a ingenious way to look at this problem!
Then in case # 2 (A =0) and B not 0 ) the parabola is laying one
For case #3 (a is not 0 and B=0 ), the parabola is in normal position  

All other in # case 2 stays the same in #case 3
Try this out with the code 

@acer 

Thanks


 

 

restart;

The following procedure is for classifying conic sections and starts on page 84 of the text.   The input to the procedure are coefficients of a quadratic equation of the form

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

and the ouput is the type of conic section the equation describes.

 

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

  local N,M,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:="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  then ans:="Exercise" #(3)EXERCISE

      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:

 

 

Example 1

Let's test the procedure on a few equations.  We will start with ones we can classify on sight.  For instance the circle  x^2+y^2 = 4 .

 

conics(1,1,0,0,-4);

"ellipse"

(1)

 

If we look back at the code we see that this is the correct output.  The procedure classifies a circle as an ellipse whose foci coincide.  Let's try another example.

Example 2

conics(2,3,1,5,-7);

"ellipse"

(2)

This corresponds to the equation

2*x^2+3*y^2+x+5*y-7 = 0

We can visually check this by looking at the graph.

 

with(plots):

implicitplot(2*x^2+3*y^2+x+5*y-7=0,x=-4..4,y=-5..5,grid=[75,75]):

 

In the procedure conics as extra to add a small plot as output next to the classification name .  
For case # 3 ( A ≠ 0 o B= 0 )  EXERCISE we need a derived formula based on (1.6) -section start formula

``

 

start formula

   

For case # 3 ( A ≠ 0 o B= 0 )

 

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

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

(3)

from this formula (3) to this formula below  for further analyse
How to this with Maple?

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

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

 


 

Download vraag_2_herleiding_conic_sections_formule.mw

@Carl Love 

Thanks

The procedure conics must show this too the degenerate cases

@acer 

Thanks

This formula is good enough.

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

 

The whole analyse starts with

A*x^2+B*y^2+C*x+D*y+E= 0 
 It defines , conics , lines, point, plane , nothing ,  ?

It are preparations for a new procedure for classifying conic sections 
At page 83 of the enclosed pdf  at number 1 : it starts with a characterization

 

@acer 

Thanks

Looks the correct formula, yes and the command used to produce this is not simple.

With order of addens you mean : leftside of equation : starts with A ?
That doesn't matter here, although the book starts with A( )^2 +.B( )^2 

M is now the new name of rhs of the equation

M = (BC^2+AD^2-4EAB)/4AB shows the book

Maple can do it all, but it is specialized use

I must investigate your derived formula for different conditions for M(=0) and A and B for sign combinations.
It seems to be quicker done by hand, then using Maple for this ?   
blz83.pdf

blz84.pdf

@janhardo 


 

restart;

B:=Array(1..5,1..2);

Matrix(5, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = 0, (2, 2) = 0, (3, 1) = 0, (3, 2) = 0, (4, 1) = 0, (4, 2) = 0, (5, 1) = 0, (5, 2) = 0})

(1)

T2:=Array([[0.5,-1],[1,2],[1.5,1],[1.75,2],[2,2.5]]);

Matrix(5, 2, {(1, 1) = .5, (1, 2) = -1, (2, 1) = 1, (2, 2) = 2, (3, 1) = 1.5, (3, 2) = 1, (4, 1) = 1.75, (4, 2) = 2, (5, 1) = 2, (5, 2) = 2.5})

(2)

op(eval(T2));

1 .. 5, 1 .. 2, {(1, 1) = .5, (1, 2) = -1, (2, 1) = 1, (2, 2) = 2, (3, 1) = 1.5, (3, 2) = 1, (4, 1) = 1.75, (4, 2) = 2, (5, 1) = 2, (5, 2) = 2.5}, datatype = anything, storage = rectangular, order = Fortran_order

(3)

op([2],T2); # go further with this

1 .. 5, 1 .. 2

(4)

Can select all : 1..5 , 1 and 5  ;  1..2 , 1 , 2

op([2,1],T2);

1 .. 5

(5)

op([2,1,1],T2);

1

(6)

op([2,1,2],T2);

5

(7)

op([2,2],T2);

1 .. 2

(8)

op([2,2,1],T2);

1

(9)

op([2,2,2],T2);

2

(10)

 

#op([1],T2); nothing ,[2] is two-dimensional?

op([2],T2);

1 .. 5, 1 .. 2

(11)

 

 

whattype(op([2],T2));

exprseq

(12)

upperbound(T2);

5, 2

(13)

lowerbound(T2);

1, 1

(14)

op([2,1,2], T2) ;

5

(15)

 

op(2, op(1, op(2, T2)));

Error, invalid input: op expects 1 or 2 arguments, but received 3

 

 

 

 


 

Download utzoeken_array_dimensie.mw

 

@Carl Love 

Thanks

The content of the array and the array indexing  are related in this programming of "view" is that it? 
Its a way of modern programming then.

The wireframe ranges for domain must also be made general for any array procedure input

 

@acer 
Thanks

Looking to this explanation ...complicated

Compared with the original bookprogramming is this new programming more advanced , because the intervals for x, y and z  for the 3 axis by a given  input  array are also calculated  by the "view "code in the procedure.

Only how the view code this handles seems to be complicated. 

 

 

 

@acer 

Thanks
I agree with you, to stay in a context for better understanding

@Carl Love 

Thanks

Works great , its the wireframe what's doing the job.
To program this from scratch could be complex to figure out.

Its shows the domain for the planes and compaired with the bookprogramming example, this is so much better.

@janhardo 

It is that the x-axis and y-axis are not visible anymore

 

  restart;
  with(plots):
  T:=Array([[1,2],[1.5,1]]):
  rooster:= plot3d(0,x=0..2, y=0..2,grid=[3,3],color=white):
  display
  ( rooster, [ seq
      ( seq
        ( plot3d
          ( T[i,j],
            x=i-1..i,
            y=j-1..j,
            shading=zhue,
            style=surface,
            axes=normal,
            view=[0..2,0..2,0..2]
          ),
          i=1..2
        ),
        j=1..2
      )
    ]
  );

 

 


 

Download arrplot2domain.mw

@acer 
Thanks

Maybe i can solve this learned by other tasks ?

The domain of a f(x,y) in plot3d is a set of points
Drawing the points with a seq statement..

@tomleslie 

Thanks

Its trivial and straight on for you, but  i need to analyze it compared with the bookexample.

Note:  also for teaching it is not advisable to stress out: how easy or trivial it is for students if they are in their learning process: it can make them unsure. 
Mostly youngster are susceptible for this. (secondairy schools) 
Not everyone can teach.

Your programming looks easier, but its not formulated as a step function. 
Also a domain roster should be informative

In the bookprogramming there is a domain checking, but in this procedure it works differently

 

g:=(x,y)->f(A,B,T,x,y);  with f as procedure

 

h:=(x,y)->doPlot(T);

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