Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I'm new to Maple, and i'm learnning Maple with basic commands(the version I use is Maple2019). But after I entered some commands, the results Maple gives me is not what I expected. For example:

When i enter abs(3+5*I), I hope get a $\sqrt{34}$, but Maple gives me a complex number:

abs(3 + 5*I);
                                                         -58                                                     -59  
       1.81847767202745 10    + 7.53238114626421 10    I
sin(0);
                                                        -116                                                    -116  
      2.73949338633639 10     + 2.73949338633639 10     I
sin(pi);
                                                        -116                                                    -116  
      2.73949338633639 10     + 2.73949338633639 10     I
abs(3 + 5*I);
                                                        -58                                                      -59  
       1.81847767202745 10    + 7.53238114626421 10    I

expand(cos(4*x) + 4*cos(2*x) + 3, trig);
                                                                          -231  
                 8. - 3.75241200689042 10     I
Why???

Should I set or define something or what?

Thank you!

Hello! 

I have been using maple not so long ago and I can’t always understand for myself what is the reason for the program not working.
In this case, I need to solve a system of second-order differential equations with respect to four variables. I don’t understand what’s wrong, do not judge strictly.

// 
restart;

m1 := 50;
m2 := 70;
R1 := 0.14;
R2 := 0.17;
O1C1 := 0.3;
alpha := 0.024;
a := 0.28;
b := 0.08;
c := 0.08;
M0 := 12;
k1 := 1.7;
k2 := 0.9;
Zb := -a;
Md := M0 - k1*diff(varphi(t), t);
Mc := -k1*diff(varphi(t), t)^2;

Ixz := 0;
Iyz := m1*O1C1*(b + c) + m2*R2^2/4*alpha;
Izz := m1(R1^2/2 + O1C1^2) + m2*R2^2/4*(alpha^2 + 2);

eqMx := -M*Yc*diff(varphi(t), t $ 2) - M*Xc*diff(varphi(t), t)^2 = Xa + Xb;
eqMy := M*Xc*diff(varphi(t), t $ 2) - M*Yc*diff(varphi(t), t)^2 = Ya + Yb;
eqIy := -Ixz*diff(varphi(t), t $ 2) + Iyz*diff(varphi(t), t)^2 = Zb*Yb;
eqIx := -Iyz*diff(varphi(t), t $ 2) - Ixz*diff(varphi(t), t)^2 = Zb*Xb;
eqMz := Izz*diff(varphi(t), t $ 2) = Md + Mc;
sys := {eqIx, eqIy, eqMx, eqMy};
dsolve({sys, varphi(0) = 0}, Xa, Xb, Ya, Yb);

Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them, received: { and so on }

//

I will be glad if you help me with this problem. if there are certain questions, you - ask, and I'll answer.
Here you can find the file: Курсовой_по_термеху_2.mw

I have an ordinary differential equation to be solved. when I give numeric values to B,H and L__1 (for example B=10,H=10,L__1=4), everything works fine and equations eq37a will be solved.

but when B,H and L__1 are symbolic parameters, dsolve give me this error " Error, (in dsolve) give the main variable as a second argument". and I don't know what it means.

is there any way to solve the ODE with symbolic B,H and L__1??

 

restart;

#B:=10;
#H:=10;
#L__1:=4;

eq0:=R__i=(1/2)*B+L__1;
eq01:=R__f=C+(1/2)*B+L__1;
eq02:=theta__1=arctan((H/2)/(B/2 + L__1));
eq03:=theta__2=Pi - arctan((H/2)/(B/2 - L__1));
eq43:= v__beta(r,theta,beta)= v__m(beta)*(1-(r^2/((R__max(theta,beta))^2)));
eq39:=R(beta)=R__i+2*beta*(R__f-R__i)/Pi;
eq39a:=simplify(subs([eq0,eq01], eq39));
eq38:=R__max(theta,beta)=R__max(theta,0)*(R(beta)/R__i);
eq41:=R__max(theta,0)=piecewise(theta<=rhs(eq02),(B/2+L__1)/cos(theta),theta<=rhs(eq03),(H/2)/sin(theta),rhs(eq03)<theta,(B/2-L__1)/cos(Pi-theta));
eq38a:= simplify(subs([eq41,eq39a,eq0], eq38));
eq44 := v__m(beta) = 1/(2*int((1 - r^2/R__max(theta, beta)^2)*r, [r = 0 .. R__max(theta, beta), theta = 0 .. Pi]));
eq44a:=simplify(subs(eq38a,eq44)) assuming B/L__1 >= 2 , H > 0 , B > 0 , L__1 > 0;
eq44b:= v__m(beta)= rhs(eq44a) * B * H;
eq47:=subs([eq44b,eq38a],eq43);

eq0 := R__i = (1/2)*B+L__1

 

eq01 := R__f = C+(1/2)*B+L__1

 

eq02 := `&theta;__1` = arctan(H/(2*((1/2)*B+L__1)))

 

eq03 := `&theta;__2` = Pi-arctan(H/(2*((1/2)*B-L__1)))

 

eq43 := `v__&beta;`(r, theta, beta) = v__m(beta)*(1-r^2/R__max(theta, beta)^2)

 

eq39 := R(beta) = R__i+2*beta*(R__f-R__i)/Pi

 

eq39a := R(beta) = (1/2)*B+L__1+2*beta*C/Pi

 

eq38 := R__max(theta, beta) = R__max(theta, 0)*R(beta)/R__i

 

eq41 := R__max(theta, 0) = piecewise(theta <= arctan(H/(2*((1/2)*B+L__1))), ((1/2)*B+L__1)/cos(theta), theta <= Pi-arctan(H/(2*((1/2)*B-L__1))), H/(2*sin(theta)), Pi-arctan(H/(2*((1/2)*B-L__1))) < theta, -((1/2)*B-L__1)/cos(theta))

 

eq38a := R__max(theta, beta) = (Pi*(B+2*L__1)+4*beta*C)*piecewise(theta <= arctan(H/(B+2*L__1)), (B+2*L__1)/cos(theta), theta <= Pi-arctan(H/(B-2*L__1)), H/sin(theta), Pi-arctan(H/(B-2*L__1)) < theta, (-B+2*L__1)/cos(theta))/(2*Pi*(B+2*L__1))

 

eq44 := v__m(beta) = 2/(int(R__max(theta, beta)^2, theta = 0 .. Pi))

 

eq44a := v__m(beta) = 2*Pi^2*(B+2*L__1)^2/(H*(B*Pi+4*C*beta+2*L__1*Pi)^2*B)

 

eq44b := v__m(beta) = 2*Pi^2*(B+2*L__1)^2/(B*Pi+4*C*beta+2*L__1*Pi)^2

 

v__beta(r, theta, beta) = 2*Pi^2*(B+2*L__1)^2*(1-4*r^2*Pi^2*(B+2*L__1)^2/((Pi*(B+2*L__1)+4*beta*C)^2*piecewise(theta <= arctan(H/(B+2*L__1)), (B+2*L__1)/cos(theta), theta <= Pi-arctan(H/(B-2*L__1)), H/sin(theta), Pi-arctan(H/(B-2*L__1)) < theta, (-B+2*L__1)/cos(theta))^2))/(B*Pi+4*C*beta+2*L__1*Pi)^2

(1)

eq37:=diff(v__r(r, theta, beta),r)*r*(R__f-r*cos(theta))+v__r(r,theta,beta)*(R__f-2*r*cos(theta))+r*diff(v__beta(r,theta,beta),beta)=0;
eq37a:=simplify(expand(subs(eq47, eq37)));

eq37 := (diff(v__r(r, theta, beta), r))*r*(R__f-r*cos(theta))+v__r(r, theta, beta)*(R__f-2*r*cos(theta))+r*(diff(`v__&beta;`(r, theta, beta), beta)) = 0

 

(-2*(Pi*(B+2*L__1)+4*beta*C)^2*((1/2)*(Pi*(B+2*L__1)+4*beta*C)^3*(r*cos(theta)-R__f)*r*(diff(v__r(r, theta, beta), r))+(Pi*(B+2*L__1)+4*beta*C)^3*(r*cos(theta)-(1/2)*R__f)*v__r(r, theta, beta)+8*C*r*Pi^2*(B+2*L__1)^2)*piecewise(theta <= arctan(H/(B+2*L__1)), (B+2*L__1)/cos(theta), theta <= Pi-arctan(H/(B-2*L__1)), H/sin(theta), Pi-arctan(H/(B-2*L__1)) < theta, (-B+2*L__1)/cos(theta))^2+128*C*r^3*Pi^4*(B+2*L__1)^4)/((Pi*(B+2*L__1)+4*beta*C)^5*piecewise(theta <= arctan(H/(B+2*L__1)), (B+2*L__1)/cos(theta), theta <= Pi-arctan(H/(B-2*L__1)), H/sin(theta), Pi-arctan(H/(B-2*L__1)) < theta, (-B+2*L__1)/cos(theta))^2) = 0

(2)

bc:=v__r(rhs(eq38a),theta,beta)=0;

bc := v__r((Pi*(B+2*L__1)+4*beta*C)*piecewise(theta <= arctan(H/(B+2*L__1)), (B+2*L__1)/cos(theta), theta <= Pi-arctan(H/(B-2*L__1)), H/sin(theta), Pi-arctan(H/(B-2*L__1)) < theta, (-B+2*L__1)/cos(theta))/(2*Pi*(B+2*L__1)), theta, beta) = 0

(3)

sol3:=simplify(dsolve([eq37a,bc], v__r(r, theta,beta)));

Error, (in dsolve) give the main variable as a second argument

 

NULL


 

Download Mechrect.mw

I use transition matrix guess the next note of Happy birthday, but it tends to the same note in the final few notes

what is wrong?

why?

 

restart;
with(LinearAlgebra):
with(AudioTools):

MK := proc(f::numeric)
AudioTools:-Create(duration=0.5,rate=44100,x->evalhf(sin(x*2*Pi*f/44100))):
end proc:

C4 := 261.62:
D4 := 293.67:
E4 := 329.63:
F4 := 349.23:
G4 := 392.00:
A4 := 440.00:
B4 := 493.88:
C5 := 523.25:

initstate := Matrix([[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,3,2,0,1,1],[0,0,2,0,0,0,0],[0,0,1,0,0,0,0],[0,0,1,0,1,0,0],[0,0,0,0,0,1,0]]);
statetemp := []:
for i from 1 to op(1,initstate)[1] do
if add(x, x in initstate[i]) = 0 then
statetemp := [op(statetemp), [0,0,0,0,0,0,0]]
else
statetemp := [op(statetemp), initstate[i]/add(x, x in initstate[i])]
end if:
od:
state := Matrix(7,7);
for i from 1 to op(1,initstate)[1] do
for j from 1 to op(1,initstate)[2] do
state(i,j) := statetemp[i][j];
od;
od;
state := MatrixMatrixMultiply(state, state);
member(max(state[3]),state,'pos');
member(max(state),state,'pos');
pos;
music := [A4,B4,C4,D4,E4,F4,G4];
song := [C4,C4,D4,C4,F4,E4,C4,C4,D4,C4,G4,F4,C4,C4]:
song := [op(song), music[pos[1]]];
for i from 1 to 10 do
state := MatrixMatrixMultiply(state, state);
member(max(state[pos[2]]),state,'pos');
member(max(state),state,'pos');
song := [op(song), music[pos[1]]];
od:
HappyBirthday:=Create(Vector(map(MK,song))):
Write("C:\\Users\\secret\\Documents\\HappyBirthday.wav",HappyBirthday);
 

Hello

I know that anames( 'user' ) recovers the contents of the workspace but I wonder whether it would be possible to recover only the contents of each m-file read within a worksheet.  

Many thanks

Ed

 

Dear All,

I have the following differential equation:

(diff(lambda(t), t) = lambda(t)*(rho - A*beta*h^(1 - beta + a)/(A*h^(1 - beta + a)*t*(1 - beta) + k^(1 - beta))))     (1)

where rho, A, beta, a, h and k, are known parameters. Note, that all of them are positive and parameters rho, beta and a are less than one.

When solving this equation by dsolve, I get:

lambda(t) = _C1*exp(rho*t)*(A*h^(1 - beta + a)*t*beta - A*h^(1 - beta + a)*t - k^(1 - beta))^(beta/(-1 + beta))    (2)

which when substituting, for instance, beta=0.3 into the obtained solution, transforms into:

lambda(t) = _C1*exp(rho*t)/(-0.7*A*h^(0.7 + a)*t - k^0.7)^0.4285714286                                                                (3)

However, if I already have put beta=0.3 into the original differntial equation (see (1)) and solve it, I receive:

lambda(t) = _C1*exp(rho*t)/(10*k^(7/10) + 7*A*h^(7/10 + a)*t)^(3/7)                                                                       (4)

Clearly, the resultant solutions in (3) and (4) are quite different since the solution of (3) is any complex number and in (4) it is a real number. Note, that when solving the differential function (1) numerically, there exists a solution for any value of beta.

I also have tried to rename beta (supposing that maybe beta is any protected name) but the result remains the same. Also note, that if such manipulation is done with any other parameters, the solutions (3) and (4) are the same.

I will be thankful for any clarification regarding this issue. 

Thanks in advance,

Dmitry

 

https://www.maplesoft.com/applications/view.aspx?SID=3938&view=html

i find this example

how to write piano note A and B frequency music to wave file?

how to convert a function to transition matrix?

how to convert a differential system to transition matrix?

 

Hi everybody and thank you all in advanced.

I tried this:

  1. convert([a,b],`*`) # this worked
  2. convert([a,b],`/`) # this gives an error
  3. map(`/`,a,b) # this worked

Questions:

  1. How can I make code for point (2) work? Apparently `/` is not an option for convert.
  2. I was looking for a function that divide two symbols, something like divide(a,b) and outputs a/b for some simple
  3. programing purposes but find no one. (a,b) could be numbers, could be trig functions or polynomials.

    Of course, you can just input a/b or lis[i]/lis[i+n], but a knowledgeable answer to this will cast light over Maple’s ways and my wrong ways.

Let be the sequence (an) so that a1 = 1, a(n+1) = 5*a(n) + sqrt(k*a(n)^2 -8), for all n >=1. I know that, the answer is k = 24.  How can I choice number k so that the sequence is an integer sequence?

I am trying to export the data list to .dat but i received that error. New with coding and Maple.

restart;
a := sin(x^(1/3))+sin(x)^(1/3);
                      / (1/3)\         (1/3)
                   sin\x     / + sin(x)     
b := diff(a, x);
                     / (1/3)\                
                  cos\x     /      cos(x)    
                  ----------- + -------------
                      (2/3)             (2/3)
                   3 x          3 sin(x)     
output := fopen("Ospino.dat", WRITE);
for x by .5 to 50 do fprintf(output, "%f\t %f\t \n", x, b) end do;
Error, (in fprintf) number expected for floating point format
fclose(output);
 

add(q[k],k=1..5)

 

I'd like to be able to display a general result such as

q_1 + q_2 + ... + q_n

 

ideally maple would do all the special stuff for me, e.g., somehow I could do

add(q[k],k=1..2..n)

but I can't even seem to get a nice output manually that doesn't involve a lot of printing code.

Hi

Can maple compute the following integral

Integral ( z^(-0.5), z in M) where  M is the lower half-unit circle from +1 to -1

Many thanks

 

How I can apply the condition or assuming (a>0) in ?

I want to have a plot according to the attached figure.

restart; A5 := 2.4821; A3 := .8417; A4 := -.1384; K := 0.3e-2; `&sigma;&sigma;` := (9*A3*A5*a^2-10*A4^2*a^2)/(24*A3^(3/2))+K/(2*a*A3^(1/2))

2.4821

 

.8417

 

-.1384

 

1.004210973*a^2+0.1634980569e-2/a

(1)

NULL

solve(sigma = 1.004210973*a^2+0.1634980569e-2/a, a)

solve(sigma = 1.004210973*a^2-0.1634980569e-2/a, a)

plot({1.079801433*10^(-25)*(-6.465854665*10^71+1.058832302*10^46*sqrt(-2.057991547*10^56*sigma^3+3.729044048*10^51))^(1/3)+3.074042610*10^24*sigma/(-6.465854665*10^71+1.058832302*10^46*sqrt(-2.057991547*10^56*sigma^3+3.729044048*10^51))^(1/3), 1.079801433*10^(-25)*(6.465854665*10^71+1.058832302*10^46*sqrt(-2.057991547*10^56*sigma^3+3.729044048*10^51))^(1/3)+3.074042610*10^24*sigma/(6.465854665*10^71+1.058832302*10^46*sqrt(-2.057991547*10^56*sigma^3+3.729044048*10^51))^(1/3)}, sigma = -.2 .. .2)

 

``


 

Download plot 

Normally the wheel mouse will scroll a file like it does in just about every other program... but when the mouse is over a code edit region it does nothing ;/ As one is scrolling with the wheel and a code edit region pops up this breaks the flow and requires hoops, I don't like hoops!

 

Seems most mouse funcitons do not work well in the region. Just trying to select and drag doesn't scroll the region.

First 498 499 500 501 502 503 504 Last Page 500 of 2097