Rouben Rostamian

MaplePrimes Activity


These are questions asked by Rouben Rostamian

This also looks like an applyrule bug.

restart;

kernelopts(version);

`Maple 2021.2, X86 64 LINUX, Nov 23 2021, Build ID 1576349`

double_angle_rule := [
        sin(x::name/2)*cos(x::name/2) = 1/2*sin(x),
        sin(x::name/2)^2 = 1/2*(1-cos(x)),
        cos(x::name/2)^2 = 1/2*(1+cos(x))
];

[sin((1/2)*x::name)*cos((1/2)*x::name) = (1/2)*sin(x), sin((1/2)*x::name)^2 = 1/2-(1/2)*cos(x), cos((1/2)*x::name)^2 = 1/2+(1/2)*cos(x)]

C := < cos(1/2*u)*sin(1/2*u), cos(1/2*u)^2 >;

Vector(2, {(1) = cos((1/2)*u)*sin((1/2)*u), (2) = cos((1/2)*u)^2})

This application fails. Why?

applyrule~(double_angle_rule, C);

Error, dimension bounds must be the same for all container objects in an elementwise operation

Download applyrule-bug2.mw

 

This looks like a bug to me but please correct me if it is not.

restart;

kernelopts(version);

`Maple 2021.2, X86 64 LINUX, Nov 23 2021, Build ID 1576349`

half_angle_rule := [
        sin(x::name) = 2*sin(x/2)*cos(x/2),
        cos(x::name) = 1 - 2*sin(x/2)^2
];

[sin(x::name) = 2*sin((1/2)*x)*cos((1/2)*x), cos(x::name) = 1-2*sin((1/2)*x)^2]

In this example, Maple applies the rule to the first element only.
It should apply to both.

A := < sin(u), sin(u) >;
applyrule~(half_angle_rule, A);

Vector(2, {(1) = sin(u), (2) = sin(u)})

Vector[column](%id = 36893628627946684772)

In this example, Maple applies the rule to the second element only.
It should apply to both.

B := < cos(u), cos(u) >;
applyrule~(half_angle_rule, B);

Vector(2, {(1) = cos(u), (2) = cos(u)})

Vector[column](%id = 36893628627946688132)

Download applyrule-bug1.mw

 

While solving an exercise in class, I ran into the following interesting solution of a transcendental equation.  It was not intentionally designed to be like this.

restart;
eq := 2*exp(-2*t) + 4*t = 127:
fsolve(eq, t=0..infinity);
                         31.75000000

The solution looks like a rational number while it was expected to be transcendental.  Let's increase the number of digits:

Digits := 20:
fsolve(eq, t=0..infinity);
Digits := 10:
                     31.750000000000000000

Let's make it even more accurate:

Digits := 29:
fsolve(eq, t=0..infinity);
Digits := 10:
                 31.750000000000000000000000000

And even more:

Digits := 40:
fsolve(eq, t=0..infinity);
Digits := 10:
           31.74999999999999999999999999986778814353

Is there a deep reason why the solution is so close to being a rational or is it just a coincidence?

 

I may be misunderstanding the documentation of implicitplot.  Can someone set me straight?

This is extracted from the implicitplot's help page:

implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x);

The plotting range is limited to y ≤ x, as intended.  Let us verify that it does the right thing:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x, color=red),
	plot(x, x=0..2, color=blue)
);

Yes, indeed it does.

Now let us try limiting the plotting range to y ≤ 1 − x2. Here is what we get:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. 1-x^2, color=red),
	plot(1-x^2, x=0..2, color=blue)
);

I expected the red curve to lie entirely below the blue curve but it doesn't. Am I misunderstanding implicitplot?

Download worksheet: mw.mw

I need to calculate dozens of piecewise-defined  (but elementary) definite integrals of the following kind. Maple returns them unevaluated. Is there a trick to force evaluation? 

restart;
u := piecewise(0 <= x and 0 <= y and y <= x, x-1, 0 <= x and 0 <= y and x <= y, x, 0);
v := piecewise(0 <= x and 0 <= y and y <= x, x-1, y <= 0 and 0 <= x and -x <= y, x-1, 0);
plot3d(u*v, x=-1..1, y=-1..1);
# integrating over (0,1)x(0,1) works
int(u*v, x=0..1, y=0..1);
# but integrating over (-1,1)x(-1,1) returns unevaluated.
# How to force evaluation on (-1,1)x(-1,1)?
int(u*v, x=-1..1, y=-1..1);

integration-problem.mw

 

3 4 5 6 7 8 9 Last Page 5 of 17