Aixleft math

120 Reputation

5 Badges

1 years, 35 days
Singapore

MaplePrimes Activity


These are questions asked by Aixleft math

Hi, how to rsolve this recursive sequence auto? 

The manual calculation is taking the reciprocal of both sides of the equation, and then do some simple calculations to get the answer:1/(3·2^n-5).

restart; A := 'A'; A[n] := `assuming`([rsolve({A[1] = 1, A[n+1] = A[n]/(5*A[n]+2)}, A[n])], [n::posint]); A[n] := simplify(%); simplify(subs(n = 1, %))

Error, recursive assignment

 

A

 

Error, (in simplify/table) too many levels of recursion

 

Download ask_recrusive_sequence_of_A[n].mw

Hi, the below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Any answer and reply is welcome.

restart

The below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Error, missing operator or `;`

 

C := x^2/A^2+y^2/B^2-1

x^2/A^2+y^2/B^2-1

(1)

l := y = k*x+b

y = k*x+b

(2)

subs(l, C)

x^2/A^2+(k*x+b)^2/B^2-1

(3)

eq := collect(%, {x, x^2})

(1/A^2+k^2/B^2)*x^2+2*b*k*x/B^2+b^2/B^2-1

(4)

x1_plus_x2 := simplify(-coeff(eq, x)/coeff(eq, x^2))

-2*b*k*A^2/(A^2*k^2+B^2)

(5)

x1_by_x2 := simplify(coeff(eq, x, 0)/coeff(eq, x^2))

(-B^2+b^2)*A^2/(A^2*k^2+B^2)

(6)

x1 := solve(eq = 0, x)[1]; x2 := solve(eq = 0, x)[2]

-(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

 

-(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

(7)

subs(x1, l); subs(x2, l)
I don't know how to make it like y1=k*x1+b and y2=k*x2+b auto in this procedure.

Error, invalid input: subs received -(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, invalid input: subs received -(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, missing operator or `;`

 

y1_plus_y2 := simplify(k*x1_plus_x2+2*b)

2*b*B^2/(A^2*k^2+B^2)

(8)

y1_by_y2 := simplify(b*k*x1_plus_x2+k^2*x1_by_x2+b^2)

B^2*(-A^2*k^2+b^2)/(A^2*k^2+B^2)

(9)
 

 

Download ask_ellispe_and_straight_line.mw

Hi everyone! I solve this NLP and I wanna get the solution in terms of the desired parameters h1, h2, Could you tell me how to correct the code? 
 

solve({v1^2 = 2*g*(h-h1), (1/2)*g*t^2 = h2, v1*t+(1/2)*g*t^2 = h1}, h, parametric = full, parameters = {h1, h2})

piecewise(g*t^2-2*h2 = 0, piecewise(g*t^2+2*t*v1-2*h1 = 0, [{h = (1/2)*(g^2*t^2+2*g*t*v1+v1^2)/g}], g*t^2+2*t*v1-2*h1 <> 0, []), g*t^2+2*t*v1-2*h1 = 0, piecewise(g*t^2-2*h2 = 0, [{h = (1/2)*(g^2*t^2+2*g*t*v1+v1^2)/g}], g*t^2-2*h2 <> 0, []), And(g*t^2-2*h2 <> 0, g*t^2+2*t*v1-2*h1 <> 0), [])

(1)

NULL


 

Download Expression_of_NLP_with_desired_parameters.mw

Hi everyone, I just try a simple equivalent implicitplot3d code regarding Maple and matlab to see difference. First for Maple, I don't set grid, just input one random complicated function and displays "Warning, solutions may have been lost", while matlab doesn't, but it's figure cannot compare with maple's in terms of detail or beauty (just focused on this case). I wanna know why. Hope for your reply!
The Maple code is as below

NULL

restart

with(plots)

implicitplot3d(x^(2*z)+y^(-2*y^(-z))+exp(-.1*z^2) = 1)

Warning, solutions may have been lost

 

Warning, solutions may have been lost

 

 

NULL

Download implicitplot3d_solution_lost_try.mw

The orange font is equivalent matlab code and figure is attached.
% Define the function for implicit plotting

f = @(x, y, z) x.^(2*z) + y.^(-2*y.^(-z)) + exp(-0.1*z.^2) - 1;

% Use fimplicit3 for 3D implicit plotting

fimplicit3(f, [-2 2 -2 2 -2 2]);

% Set labels and title

xlabel('x');

ylabel('y');

zlabel('z');

title('Implicit 3D Plot of f(x, y, z) = 1');

Hi I wanna move the expressions except a^2 in the first term of p1 to after a^2 in the last term, and move the expressions except a^2+b^2 in the second term to after a^2+b^2 in the second-to-last term, etc., and achieve the reverse effect on p1 through  operation.

Maple code is as below (I add more letters in maple code compared to the above image)

with(ListTools)

p := map[scan = `+`](proc (x) options operator, arrow; x^3 end proc, [a, b, c, d, e, f, g, h, i, j, k])

[a^3, a^3+b^3, a^3+b^3+c^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3]

(1)

p1 := Reverse(p)

[a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3+k^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3+j^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3+i^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3+h^3, a^3+b^3+c^3+d^3+e^3+f^3+g^3, a^3+b^3+c^3+d^3+e^3+f^3, a^3+b^3+c^3+d^3+e^3, a^3+b^3+c^3+d^3, a^3+b^3+c^3, a^3+b^3, a^3]

(2)

nops(p1)

11

(3)
 

``

Download The_inverse_operation_of_map_on_the_elements_in_list.mw

1 2 3 4 5 Page 2 of 5