Você está na página 1de 5

1Resolverequaescomto_poly_solve

OMaximatemumafunoto_poly_solveparaobtersoluluesdeequaesquebastantepoderosa

> to_poly_solve([3*cos(t)+sin(t)1=0],[t])

to\_poly\_solve: to\_poly\_solver.mac is obsolete; I'm loading to\_poly\_solve.mac instead.

4
(%o1) %union ([t = 2 %z11 + ], [t = 2 %z9 atan ( )])
2 3

Assoluessodadasporuniesdelistasdesolues,quepodemdependerdeparametrosinteiros%zNNN,reais%rNNNou
complexos%cNNN.Podemosreindexarestesparmetroscomnicedummies.

> nicedummies(%)

4
(%o2) %union ([t = 2 %z0 + ], [t = 2 %z1 atan ( )])
2 3

>
> float(%)

(%o3) %union ([t = 6.283185307179586 %z0 + 1.570796326794897], [t = 6.283185307179586 %z1 0.9272952180016122

VejasequalarespostadoMaxima,quandoseusaocomandosolve:

> solve([3*cos(t)+sin(t)1=0],[t])

(%o4) [sin (t) = 1 3 cos (t)]

Maisexemploscomto_poly_solve

> to_poly_solve([x*x1],[x])

(%o5) %union ([x = 1], [x = 1])

> to_poly_solve(x*(x1)=0,x)

(%o6) %union ([x = 0], [x = 1])

to_poly_solve,comoonomeindioca,usaumaalgoritmoquepassapelaconversonaformapolinomialdasequaesque
pretendemosresolver.

Quandoto_poly_solvenocapazdeencontrarsoluesexplicitas,entorespondecom%solve(...)

> to_poly_solve(x^k+2*x+1=0,x)

Nonalgebraic argument given to 'to\_poly'unable to solve

k
(%o7) %solve ([x + 2 x + 1 = 0], [x])

Porvezes,nestescasosumasubstituionosparmetrosdnossoluesexplicitas

> subst(k=2,%)

(%o8) %union ([x = 1])

Arespostadeto_poly_solvepodetambmincluiroperaeslgicascom`%and',`%or',ou`%if'
> to_poly_solve([a*cos(t)+b*sin(t)1=0],[t])

2
b a 2 + 1 1
2 2
(%o9) %union (%if ((i b a = 0) %or ( b a + 1 1#0) , [t = 2 %z26 i log (
i b a i b

> to_poly_solve(abs(x)=a,x)

(%o10) %union (%if (isnonnegative_p (a) , [x = a], %union ()) , %if (isnonnegative_p (a) , [x = a], %union ()))

> isnonnegative_p(22)isnonnegative_p(22)

(%o11) false

(%o12) true

> to_poly_solve([x^2+2*y^2=1,y=x+1/2],[x,y])

10 2 1 + 2 5 2 + 10 2 5 1
(%o13) %union ([x = ,y = ], [x = ,y = ])
6 6 6 6

> to_poly_solve([x^2+2*y^2=1,y=x^2+1/2],[x,y])







13 3 1 + 13 13 3 1 + 13 13 3
(%o14) %union ([x = ,y = ], [x = ,y = ], [x = ,y =
2 4 2 4 2

> to_poly_solve([x^2+y^2=1,y^2x^2=1/2],[x,y])

1 3 1 3 1 3 1 3
(%o15) %union ([x = ,y = ], [x = ,y = ], [x = ,y = ], [x = ,y = ])
2 2 2 2 2 2 2 2

> to_poly_solve([x^2+y^2=1],[y])

2 2
(%o16) %union ([y = 1 x ], [y = 1 x ])

Aopo'use_grobner=truedeveserusadaparaoscasosemqueoMaximanorespondesatisfatriamente

> to_poly_solve([x^2+y^2=2^2,(x1)^2+(y1)^2=2^2],[x,y])

(%o17) %union ()

> to_poly_solve([x^2+y^2=2^2,(x1)^2+(y1)^2=2^2],[x,y],

'use_grobner=true)

7 1 1 + 7 1 + 7 7 1
(%o18) %union ([x = ,y = ], [x = ,y = ])
2 2 2 2

2Alternativasapoly_solve

Segarantirmosquef(x)=0temumanciasoluorealnointervalo[a,b]Podemosencontraressaraz(umvaloraproximado)com
ocomandofind_root

> find_root(cos(x)x,x,0,1)

(%o19) 0.7390851332151607

Vermaisopesnomenuequation

> solve(x^3x+1=0,x)

1 1

1 1
3i 1 1
23 1
3
1 3 i 23 1
3
3 i 1
2 2 2
(%o20) [x = + ( ) ( ),x = ( ) ( ) +
1 3 3
2 2 2 2 2 2
23
3
2 32 2 32 23
1
3 ( 3
) 3 ( 3
2
23 2 23 2

> float(%)

(%o21) [x = 0.9869912062713542 (0.8660254037844386 i 0.5) 0.3377267509733919 (0.5 0.8660254037844386

Para,obtervaloresaproximadosderazesdepolinmios,temos

> realroots(x^3+x1=0)

22895121
(%o22) [x = ]
33554432

Notequeasoluoacimaumvaloraproximadoenoumasoluoracionalexacta

> realroots(cos(x))

(%o23) [cos (x) = 0]

> allroots(x^3+x1)

(%o24) [x = 0.6823278038280194, x = 1.161541399997252 i 0.3411639019140097, x = 1.161541399997252 i 0.3411639

> bfallroots(x^3+x1)

(%o25) [x = 6.823278038280194b 1, x = 1.161541399997252b0 i 3.411639019140097b 1, x = 1.161541399997252

3Clculoderectastangentesacurvas

Retomandooproblemadeencontrararectatangentea(x^2)/4+(y^2)/9=1quepassamdopeloponto(4,4)

> c(t):=[2*cos(t),3*sin(t)]/*parametrizao*/

(%o26) c (t) := [2 cos (t) , 3 sin (t)]

> define(dc(t),diff(c(t),t))/*derivada*/

(%o27) dc (t) := [2 sin (t) , 3 cos (t)]

> define(n(t),[dc(t)[2],dc(t)[1]])/*vectornormalacemt(nounitrio)*/

(%o28) n (t) := [3 cos (t) , 2 sin (t)]

> P:[4,4]

(%o29) [4, 4]

> c(t)P/*vectordirectordarectarquepassaporPec(t)*/

(%o30) [2 cos (t) 4, 3 sin (t) 4]

> (c(t)P).n(t)/*queremosrtangenteacortogonalan*/

(%o31) 2 sin (t) (3 sin (t) 4) + 3 cos (t) (2 cos (t) 4)

> ratsimp(%)

2 2
(%o32) 6 sin (t) 8 sin (t) + 6 cos (t) 12 cos (t)
> trigsimp(%)

(%o33) 8 sin (t) 12 cos (t) + 6

Podemosusarto_poly_solve,paraobterasrazes.

> to_poly_solve(8*sin(t)12*cos(t)+6=0,t)

2 2
9 43 3 343

log (( + ) + ( ) ) 343 3
26 13 13 26

26 13
(%o34) %union [t = 2 %z74 i i atan ], [t = 2
2
43 9

+
13 26

> nicedummies(%)$sol:ratsimp(%)

3 43 6 6 + 3 43
(%o36) %union ([t = 2 %z0 atan ( )], [t = 2 %z1 atan ( ) + ])

2 43 + 9 2 43 9

> %z0:0$%z1:0/*queremosassoluesentre0e2*%pi*/$
> sol:float(''sol)

(%o39) %union ([t = 0.5537238738589942], [t = 1.729729080954129])

> sol[1]

(%o40) (%union ([t = 0.5537238738589942], [t = 1.729729080954129]))


1

> args(sol)

(%o41) [[t = 0.5537238738589942], [t = 1.729729080954129]]

> args(sol)[1]

(%o42) [t = 0.5537238738589942]

rhsrighthandside

> t1:rhs(args(sol)[1][1])

(%o43) 0.5537238738589942

> t2:rhs(args(sol)[2][1])

(%o44) 1.729729080954129

> r1:parametric(P[1]+s*(c(t1)P)[1],P[2]+s*(c(t1)P)[2],s,6,5)

(%o45) parametric (4 2.298855611645846 s, 4 5.577574873796847 s, s, 6, 5)

> r2:parametric(P[1]+s*(c(t2)P)[1],P[2]+s*(c(t2)P)[2],s,5,2)

(%o46) parametric (4 4.316529003738769 s, 4 1.037809741587769 s, s, 5, 2)

> load(draw)$
set_draw_defaults(
dimensions=[500,300],
proportional_axes=xy,
axis_top=false,axis_bottom=false,
axis_left=false,axis_right=false,
grid=false,
xaxis=true,
xaxis_type=solid,
xaxis_width=1,
xaxis_color=black,
xtics_axis=true,
yaxis=true,
yaxis_width=1,
yaxis_type=solid,
yaxis_color=black,
ytics_axis=true,

line_width=2
)$

;; loading \#P"C:/Users/Fernando/maxima/binary/5\_37\_2/sbcl/1\_2\_7/share/draw/grcommon.fasl";; loading \#P"C:/U

> wxdraw2d(
xrange=[3,5],
yrange=[4,5],
parametric(2*cos(t),3*sin(t),t,0,2*%pi),
color=green,
r1,
color=red,
r2,
point_size=2,
point_type=filled_circle,
color=black,
points([P]),
label(["P",4.5,3.5])
)

(%t49)

(%o49)

>

CreatedwithwxMaxima.

Você também pode gostar