Quiz 9 MCS 320 Friday 28 October 2005
1. Plot the curve defined by (x^2 + y^2)^2 - 2*(x^2 - y^2) = 0, for x and y both in [-2,2].
Create a better plot by converting to polar coordinates.
Give the polar representation of this curve and all relevant Maple commands.
| > | p := (x^2 + y^2)^2 - 2*(x^2-y^2); |
| > | plots[implicitplot](p,x=-2..2,y=-2..2); |
![[Plot]](images/quiz9_2.gif)
| > | pp := subs(x=r*cos(t),y=r*sin(t),p); |
| > | sr := solve(pp,r); |
| > | plots[polarplot](sr[3],t=0..2*Pi); |
![[Plot]](images/quiz9_5.gif)
| > | restart; |
2. Consider the polynomial system defined by f = x^3 - 3*x*y^2 + 1 =0 and g = x^2 + y - 1 = 0.
Use the method of Groebner bases to determine how many real solutions this system has.
Give all relevant commands to create a list of coordinates of the real solutions.
| > | s := {x^3 - 3*x*y^2 + 1,x^2 + y - 1}; |
| > | gb1 := grobner[gbasis](s,[x,y],plex); |
Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
We follow the warning of Maple and use the new Groebner[Basis]:
| > |
Notice the difference in the order of the polynomials between gb1 and gb2. With gb1, we start with gb1[2].
| > | ys := [fsolve(gb2[1],y)]; |
| > | eqs := seq(subs(y=ys[j],gb2[2]),j=1..nops(ys)); |
| > | xs := map(eq -> fsolve(eq,x),[eqs]); |
| > | real_sols := zip((x,y) -> [x,y],xs,ys); |
| > |