MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

How to solve the equation
2^(sin(x)^4-cos(x)^2)-2^(cos(x)^4-sin(x)^2) = cos(2*x)
symbolically? The solve command produces a weird answer. Evalfing all its values, one sees
0.7853981634, -0.7853981634, 2.356194490, -2.356194490,

1.570796327 - 1.031718534 I, -1.570796327 + 1.031718534 I,

1.570796327 + 1.031718534 I, -1.570796327 - 1.031718534 I,

0.7853981634, -0.7853981634, 2.356194490, -2.356194490,

1.570796327 - 1.031718534 I, -1.570796327 + 1.031718534 I,

1.570796327 + 1.031718534 I, -1.570796327 - 1.031718534 I


The identify command
interprets the real solutions on -Pi..Pi as -3*Pi/4, -Pi/4, Pi/4, 3*Pi/4
(for example,
identify(2.356194490);

3*Pi/4 ).
Is it possible to obtain these with Maple in a simpler way?

PS. Mathematica 10 does the job.

Why this simplifes:

z1:=n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z1);

But when adding an extra term to z1, it no longer simplfies the above any more:

z2 := cos(x)^(n-1)*sin(x)+n*(Int(cos(x)^(n-2), x))-(Int(cos(x)^(n-2), x));

simplify(z2);

You can see the second term, which is z1, was not simplfied any more.

Why? And how would one go about simplifying z2 such that the second term gets simplfies as with z1, but while using z2 expression. It seems simplify stopped at first term and did not look ahead any more?

Maple 18.02, windows.

Hello people in mapleprimes,

 

I have a question of labels of equations.

For example, suppose that there is a following description in a worksheet.

>2*x+y=5;

  2*x+y=5   (1)

>3*x+y=6;

  3*x+y=6   (2)

>solve({(1),(2)},{x,y});

 {x=1,y=3}          (3)

subs((3),100+x+100*y)

    400   

 

And, when I moved (2) to the next to (1) with dragging, and then, clicked !!! to execute it, then the worksheet 

changes as follows, which is wrong as accompanying ??

>2*x+y=5;3*x+y=6;

  2*x+y=5

 3*x+y=6   (1)

>solve({(1),??},{x,y})

{x = x, y = -3*x+6}          (2)

>subs({(1),??},100*x+100*y)

-200*x+600

 

Do you know some good way for ?? not to appear in the above sitiation.

I will appreciate when you tell me some measures about this.

 

Best wishes.

 

taro

 

 

 

 

 

 

Hi 

I'm having a problem with the statements inside a for-loop somehow being read in a different way than outside the loop. 

I've defined some functions earlier, and then I need to perform an integration using these functions, while I change one variable a little for each loop of the for-loop. 

The problem is that IN the for-loop, I get the same value from my integration for all loops. But when I execute the exsact same code OUTSIDE of the loop, I get the correct values, which are changing whenever i change the one variable. 

Here is the loop:

for i from 0 to 42 do

rotorshift := evalf[6](2*((1/180)* *Pi*((1/2)*Ø[gap]))/N[m]-1/2*(tau[p]-tau[s]));

PMmmf_func := x-> proc (x) if type(x-rotorshift, nonnegative) then if type(trunc((x-rotorshift)/tau[p]), odd) = true then -H[c]*l[m] else H[c]*l[m] end if else if type(trunc((x-rotorshift)/tau[p]), odd) = true then H[c]*l[m] else -H[c]*l[m] end if end if end proc

B[g] := proc (x) -> 1000*mu[0]*(PMmmf_func(x)+MMF_func(x))/d[eff, stator](x) end proc;

Flux(i+1) := (int(B[g](x), 0 .. tau[s])+int(B[g](x), 3*tau[s] .. 4*tau[s])+int(B[g](x), 6*tau[s] .. 7*tau[s])+int(B[g](x), 9*tau[s] .. 10*tau[s]))*10^(-3)*L[ro];

end do;

And for all the values in the "Flux" vector, I get the same value. But when I remove the loop, and change the value of manually, I get the correct (changing) values of flux!! 

Any ideas why this may be? This is really dricing me nuts. I've spent the beter part of the day on this, and I just can't seem to find a workaround, much less a reason for this behaviour.

many thanks!

I have generated an 8x8 Jacobian, containing a few variables and several zeros as elements. I would like to translate this to LaTeX code. How can I first simplify what I have, to make it tractable?

Here is the Maple code:

eq_1 := Lambda-mu*S-(beta*(H+C+C1+C2)*S+tau*(T+C)*S)/(S+T+H+C+C1+C2+C1M+C2M);
eq_2 := (-beta*(H+C+C1+C2)*T+tau*(T+C)*S)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[T])*T;
eq_3 := (beta*(H+C+C1+C2)*S-tau*(T+C)*H)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[A])*H;
eq_4 := (beta*(H+C+C1+C2)*T+tau*(T+C)*H)/(S+T+H+C+C1+C2+C1M+C2M)-(mu+mu[T]+mu[A]+lambda[T])*C;
eq_5 := lambda[T]*C-(mu+mu[A]+rho[1]+eta[1])*C1;
eq_6 := rho[1]*C1-(mu+mu[A]+rho[2]+eta[2])*C2;
eq_7 := eta[1]*C1-(mu+rho[1]+gamma)*C1M;
eq_8 := eta[2]*C2+rho[1]*C1M-(mu+rho[2]+gamma*rho[1]/(rho[1]+rho[2]))*C2M;
J := VectorCalculus:-Jacobian([eq_1, eq_2, eq_3, eq_4, eq_5, eq_6, eq_7, eq_8], [S, T, H, C, C1, C2, C1M, C2M]);

JQDFE := eval(J, [S = Lambda/(beta-mu[A]), T = 0, H = Lambda*(beta/(mu+mu[A])-1)/(beta-mu[A]), C = 0, C1 = 0, C2 = 0, C1M = 0, C2M = 0]);

Thanks.

Hi,

I am trying to interpolate a set of arbitrary numbers including real ones like Pi and plot them using ArrayInterpolate. This does not work. Is there a simple way around this?

Thank you.

I have a statement:

print(plots[display](seq(colr2[i],i=1..numplayers, xtickmarks=0,axes=NONE,view=[0..5*numplayers,0..1])):

which outputs a horizontal display of the various "colors" of the players, and it does so.

    However, the height of the output is quite big and makes the output look "chunky".  Inserting the option "scaling=constrained" makes the width of the output much narrower - but there is a bounding box of the output (which is not actually displayed.)  It is displayed when the mouse cursor is clicked on the display.  I was hoping the view= [..] option would provide a solution, but this does not alter the exterior bounding rectangle.

  Is there any means of modifying the dimensions of the rectangular display through Maple code?

Thanks,

   David

Hi,

I use the VectorCalculus package to calcutate derivative formula for geometric functions, and met difficulity simplifying the result expression.

For example, I define some vectors P, S, V like below:

P:=<Px, Py, Pz>, S:=<Sx, Sy, Sz>, V:=<Vx, Vy, Vz>

then define an intermediate variable Q:=P - S,

then define a function d:= sqrt(DotProduct(Q, Q)-(DotProuct(Q,V))^2)

by calculating the function's derivative w.r.t Px I got a very complex result expression:

dpx:=1/2 * (2Px - 2Sx - 2 ( (Px - Sx) Vx + (Py - Sy) Vy + (Pz - Sz)Vz )Vx ) / (sqrt( (Px-Sx)^2 + (Py-Sy)^2 + (Pz-Sz)^2 - .....)

 

Apparently this expression can be simplified by substituting its sub-expression with pre-defined variables like Q and d.

I know I can use subs, eval, and subsalg to do it manually:

subs(1/(sqrt( (Px-Sx)^2 + (Py-Sy)^2 + (Pz-Sz)^2 - .....) = 1/dv, dfdpx)

subs((Px - Sx) Vx + (Py - Sy) Vy + (Pz - Sz)Vz = dotproduct_q_v, dfdpx)

and I can get a simplified expression like this:

(qx-dotproduct_q_v*vx)/d

 

But it's like my brain does the simplification first, and Maple only does the text substitution for me.

Is there any way to do it automatically?

 

Thanks,

-Kai

 

Hi i 2 questions. all pertaining to solving a systems of equations mod 2

First if i have a large set of equations, 11^3 equations in 11 unknowns and i want maple to give me ALL solutions mod 2 how can i do that? Maples msolve is loosing solutions.

Second suppose i want all unique solutions that say 6 of the variables can have but dont care what the solution to the other variables are as long as it is a solution. 

mini example:

say x=1,y=1,z=1 is a solution as well as x=1,y=1,z=0, i just want to know about x=1,y=1.

 

I have produded a 3D plot where I have used the graphic's lighting->user GUI to set the light color, direction, and ambient lighting to my liking.

 

I would like to save the lighting parameters so that I can reproduce the identical lighting in other plots.  I see no way of reading off the lighting parameters from the GUI.  I tried to "lprint(myplot)" to see if it contains that information but apparently it doesn't.

So my question is: Is there a way to retrieve the lighting parameters from a 3D plot?

 

--

Rouben Rostamian

I experienced strange operation of "union" for sets of vectors.

Mt1:=Matrix(2, 4, [[ 0,1, 0, 0], [ 0,  0,  1, 1]]); Ms := Vector[column](4, [8,4,2,1]); St1 := {}:

St1:= `union`(St1, {Mt1 . Ms});

I am surprised, because each execution of union adds new and the same vector <4 | 3> to set St1:

1

But after copying any set in the clipboard and pasting the set St1 has only one instance of vector <4 | 3>:

2

What does it mean?

How to solve the system
{sqrt((x-1)^2+(y-5)^2)+(1/2)*abs(x+y) = 3*sqrt(2), sqrt(abs(x+2)) = 2-y}
over the reals symbolically? Of course, with Maple. Mathematica does the job.

Hi everyone,

 

I have a question regarding the use of the applyrule function. I have an expression that contains a polynomial. The expression looks something like:

 

Y := (a0 + a_1*x + a_2*x^2 + ... a_n*x^n)*f(y) + b_0 + b_1*x + b_2*x^2 + ... b_n*x^n)*g(y):

 

I would like to express this as y(x) = P_1*f(y) + P_2*g(y).

 

So far I have tried applyrule([a0 + a_1*x + a_2*x^2 + ... a_n*x^n = P_1, b_0 + b_1*x + b_2*x^2 + ... b_n*x^n) = P_2],Y):

 

This doesn't seem to work. Any suggestions?

 

 

 

 

I want to solve maximize of equation,but the maximize failed to solve it,who can help me.thanks.

c[1] := (1/8)*w*{(1/((x+y+z)^2+1))^(3/2)+(1/((x+y)^2+1))^(3/2)+(1/((x+z)^2+1))^(3/2)+(1/((y+z)^2+1))^(3/2)+(1/(x^2+1))^(3/2)+(1/(y^2+1))^(3/2)+(1/(z^2+1))^(3/2)+1}+(1/8)*{x/((x+y+z)^2+1)+x/((x+y)^2+1)+x/((x+z)^2+1)+x/(x^2+1)}:

c[2] := (1/8)*w*{(1/((x+y+z)^2+1))^(3/2)+(1/((x+y)^2+1))^(3/2)+(1/((x+z)^2+1))^(3/2)+(1/((y+z)^2+1))^(3/2)+(1/(x^2+1))^(3/2)+(1/(y^2+1))^(3/2)+[1/(z^2+1)]^(3/2)+1}+(1/8)*{y/((x+y+z)^2+1)+y/((x+y)^2+1)+y/((y+z)^2+1)+y/(y^2+1)}:

t[1] := diff(c[1], x);

(1/8)*w*{-(3/2)*(1/((x+y+z)^2+1))^(1/2)*(2*x+2*y+2*z)/((x+y+z)^2+1)^2-(3/2)*(1/((x+y)^2+1))^(1/2)*(2*x+2*y)/((x+y)^2+1)^2-(3/2)*(1/((x+z)^2+1))^(1/2)*(2*x+2*z)/((x+z)^2+1)^2-3*(1/(x^2+1))^(1/2)*x/(x^2+1)^2}+(1/8)*{1/((x+y+z)^2+1)-x*(2*x+2*y+2*z)/((x+y+z)^2+1)^2+1/((x+y)^2+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^2+1)^2-(3/2)*(1/(x^2+2*x*y+y^2+1))^(1/2)*(2*x+2*y)/((x+y)^2+1)^2-(3/2)*(1/(y^2+2*y*z+z^2+1))^(1/2)*(2*y+2*z)/((y+z)^2+1)^2-3*(1/(y^2+1))^(1/2)*y/(y^2+1)^2)+(1/8)*{y/((x+y+z)^2+1)+y/((x+y)^2+1)+y/((y+z)^2+1)+y/(y^2+1)}

(6)

"#"Iwant to maximize the equation (5)and (6),under the conditon of x,y,z are negative or positive at the same time.

 

NULL

 

Download maximize.mw

1 2 3 4 5 6 7 Last Page 1 of 1094