Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 27 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

With the specified initial conditions, y=0 is the complete solution. This is considered a linear ODE, by the way.

If you change the initial conditions to y(0)=1, D(y)(0)=0 and give the commands

ode:= x^2*diff(y(x), x$2) + x*diff(y(x), x) + x^2*y(x) = 0:
Order:= 11: #One more than the order of series that you need
dsolve({ode, y(0)=0, D(y)(0)=0}, y(x), type= series);

then you get

Add a table Color and add the color and legend options to the plot. Like this

(I had to add the tickmarks option to correct an unrelated bug.) Also add the variable Color to the list of locals. You can do the same with the option linestyle. The resulting plot is

And here's the updated worksheet: Equações_H,_S_e_G_(.mw

That a rather impressive thing you did with the try statements.

By adding the options abserr= 1e-4, relerr= 1e-4, minstep= .01 to the dsolve command, I was able to get the same plot that you showed in your link.

With the following changes, I get the plot in one minute. The most important change is making the interval of integration finite.

f:= x-> 1/(1+x^2):
u:= x-> Int(exp(-(x-xi)^2)*f(xi), xi= -infinity..infinity, digits= 5):
IntegrationTools:-Change(u(x), xi= tan(tau)):
u:= unapply(%, x);

plot(u, -10..10, numpoints= 50);

The command implicitdiff can also be used in the parametric case. Suppose that you have parametric equations x = cos(t), y = sin(t). If you want dy/dx, the command is

implicitdiff({x=cos(t), y=sin(t)}, {y,t}, y, x);

If you want d^2y/dx^2, it's

implicitdiff({x=cos(t), y=sin(t)}, {y,t}, y, x, x);

These results can be simplified, of course.

Since you mentioned polar plotting in your title, here's how to do both of your examples as polar plots:

plot(a*tan*~[1,-1], -Pi/2..Pi/2, coords= polar, colour= red);

plot(a^3*cos^3*sin^2, -Pi..Pi, coords= polar, colour= red);

It boils down to Maple's failure to simplify  arccos(x)+arcsin(x)  to Pi/2. But,

convert(arccos(x)+arcsin(x), arcsin(x));

So,

simplify(convert(eq1 - eq2, arcsin));

0

It is not clear what is meant by the eleventh coefficient. Does it mean the coefficient of (x-Pi)^11? That is 0---this series has no (nonzero) odd powers. Is the constant term (the coefficient of (x-Pi)^0) considered a[0] or a[1]? Does it mean the eleventh nonzero coefficient?

Once you answer those questions, the command coeftayl can be used to extract just the desired coefficient without giving you the whole series. If you want the eleventh nonzero coefficient, it is the coefficient of (x-Pi)^20:

coeftayl(exp(-(x-Pi)^2), x=Pi, 20);

which is 1/10!

Simply factor(a)

Unfortuately, the equals sign (=) cannot be used to test equality of Vectors and Matrices. You need to use LinearAlgebra:-Equal instead. So change (s7 = e) to LinearAlgebra:-Equal(s7, e), and likewise for the rest.

You can use ormap to condense your compound if...elif...end if to a single condition:

if ormap(LinearAlgebra:-Equal, [e,f,g,h], s7) then
     print("Synchronising")
else
     print("Not Synchronising")
end if;

By using `if` and cat this can be reduced to a single line:

print(cat(`if`(ormap(LinearAlgebra:-Equal, [e,f,g,h], s7), "", "Not "),"Synchronising"));

Problem 1 must be a trick question or you transcibed something wrong. There is no square root of 2 modulo 3 (2 is not a quadratic residue modulo 3), so there are also none modulo 3^8. The p-adic Newton-Hensel formula only works if you start with an exact solution modulo the prime base. Roots will confirm that there is no solution. Roots will also give you the solution to problem 2, but clearly the problem was intended to be done with 5-adic lifting (625 = 5^(2^2)).

Roots(x^2-2) mod 3^8;
                               []
Roots(x^3-2) mod 625;
                           [[303, 1]]

Go to the Maple Applications Center and get the paper and worksheet that I wrote on p-adic Newton-Hensel lifting.

Here is the answer to problem 2 via 5-adic lifting:

f:= x-> x^3-2:
Roots(f(x)) mod 5;
                            [[3, 1]]
3 - f(3)/D(f)(3) mod 5^(2^1);
                               3
3 - f(3)/D(f)(3) mod 5^(2^2);
                              303

Is there a chance that you've made an assumption twice or that you've made a second, different assumption on the same variable? Both can have that undesirable effect. Observe:

restart:
assume(m>0); expr:= m^2; assume(m>0);

subs(m=1, expr);

The same thing would happen if I made the second assumption different from the first, as long as it still involved m.

Addressing your first problem, the primitive 4th roots of unity modulo 29: The inert mod command Roots will compute all the roots of a polynomial. We apply it to the polynomial x^p - 1. Then we select the roots whose order modulo 29 is p.

PrimitiveRootsOfUnity:= proc(p::posint, r::And(posint, Not(identical(1))))
local x;
     select(z-> numtheory:-order(z,r)=p, map2(op, 1, Roots(x^p-1) mod r))[]
end proc:

PrimitiveRootsOfUnity(4,29);
                            12, 17

Since there are only two, it is obvious that one is the inverse of the other.
1/12 mod 29;
                               17

It is very easy to convert any CURVES in a plot into POLYGONS. Afterall, a CURVES structure is just a finite collection of points. Addressing your problem, plotting a segment of circle: Any arc of circle determines a segment of circle, right? The following procedure uses the same arguments as plottools:-arc and converts the structure to a polygon.

CircleSegment:= (C::[realcons, realcons], R::positive, AB::range(realcons))->
     plots:-polygonplot(op(plottools:-arc(C, R, AB)), scaling= constrained, _rest):

Example of use (center = [0,0], radius= 1, from 0 to 1 radians):

CircleSegment([0,0], 1, 0..1, color= green);

restart:

Define the general Newton-Raphson operator. This is an operator-valued operator which returns the Newton iteration operator for its input operator.
NR:= f-> (z->z) - f/D(f):

Apply it to our problem:
N:= NR(z-> z^2+1):

Verify that this gives the expected N:
simplify(N(z));

Note that the imaginary unit in Maple is capital I.
T:= z-> (z-I)/(z+I):

Show that T(N(z)) = T(z)^2. (Eq. 1)
T(N(z)) - T(z)^2;

simplify(%);
                               0

Verify that T(N^2(z)) = T(z)^4. Note that here N^2(z) = N(N(z)). In Maple this can also be expressed as (N@@2)(z). You must not enter this as N^2(z). Rather than getting an error message, you'll just get something wrong.
simplify(T((N@@2)(z)) - T(z)^4);
                               0

Q1) What will be the general result?  
Ans: I guess that this means to guess at the answer to Q2 based on the above.

Q2) T(N^k(z)) is what power of T(z)?
Ans: T((N@@k)(z)) = T(N((N@@(k-1))(z))) = T((N@@(k-1))(z))^2, by (Eq. 1) with (N@@(k-1))(z) substituted for z. It follows by induction that T((N@@k)(z)) = T(z)^(2^k). So the answer is 2^k.

Q3) What is T(N^3(z))?
Ans: By the answer to Q2, it is T(z)^8. Verify that:
simplify(T((N@@3)(z)) - T(z)^8);
                               0

First 332 333 334 335 336 337 338 Last Page 334 of 395