MaplePrimes Questions

In the C programming language the following code makes i = 1

real r;      integer i;      r = 1.9;         i = r;

How do I do the same in Maple?

During running my ws I faced with memory error as below, where as my system have enough memory (120GB)

Warning, Run: unable to set assignto result due to error:  Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc

Maple's help suggests :Software limits are imposed by the -T command-line argument, the datalimit argument to kernelopts and system imposed user limits (for example shell limits).
  But I could not understand how to increase software limit.

 

how to fix that?

find the fourier cosine and sine transform. Use your identites and integrals to eliminate all exponents.

piecewise function is {cosh(t) for 0 less or equal to t, t is less than 1,

                                   0 for 1is less than or equal to t.}

alpha+{6*RK[1]*alpha+2+(96/5)*R^2*K^2*alpha^2-(1/6)*R*alpha+64*R^3*K^3*alpha^3}*beta+{(24/5)*RK+44*R^2*K^2*alpha^3}*beta^2=0

i am currently using Maple 18, i have a problem on inserting 12 row by 12 column matrix and above is seem to be impossible. please can help or direct me on how to insert 12 row by 12 column matrix in maple. because my maple 18 seem to stop in 10 row by 10 column matrix.  thanks

Hi everybody.....

I want to obtain the roots of below equation, How? 

eq:=1+cos(beta)*cosh(beta)+.5720823799*beta*(cos(beta)*sinh(beta)-cosh(beta)*sin(beta))-0.1285578382e-1*beta^2*sin(beta)*sinh(beta)-0.9629800618e-4*beta^3*(cos(beta)*sinh(beta)+cosh(beta)*sin(beta))+0.1377259814e-4*beta^4*(1-cos(beta)*cosh(beta)) = 0

Tnx...

Dear users,

I have an issue with finding real part of a complex variable function. In calculating the real part I see two arguments and the plot is not smooth. How to get real part correct. The worksheet is attached.
 

``

 

 

##Toya complex variable method

``

restart;

stress_c:=-(1+1/nu_c)*k*p2*zeta_c/2;

-(1/2)*(1+1/nu_c)*k*p2*zeta_c

(1.1)

p2:=(c0_c-d_1c/k)*(z-a*(cos(alpha)+2*lambda*sin(alpha)))+(1-k)/k*a*(N_infty-T_infty)*exp(2*I*phi_c+2*lambda*(alpha-Pi))*((a*(cos(alpha)-2*lambda*sin(alpha)))/z-a^2/z^2)

(c0_c-d_1c/k)*(z-a*(cos(alpha)+2*lambda*sin(alpha)))+(1-k)*a*(N_infty-T_infty)*exp((2*I)*phi_c+2*lambda*(alpha-Pi))*(a*(cos(alpha)-2*lambda*sin(alpha))/z-a^2/z^2)/k

(1.2)

``

z := exp(I*theta)

exp(I*theta)

(1.3)

``

k := beta_c/(1+nu_c)

beta_c/(1+nu_c)

(1.4)

nu_c := (kappa2*mu+mu2)/(kappa*mu2+mu)

(kappa2*mu+mu2)/(kappa*mu2+mu)

(1.5)

d_1c := (N_infty+T_infty)*(1/2)

(1/2)*N_infty+(1/2)*T_infty

(1.6)

lambda := -evalf(ln(nu_c)/(2*Pi))

-.1591549430*ln((kappa2*mu+mu2)/(kappa*mu2+mu))

(1.7)

``

beta_c := mu*(1+kappa2)/(kappa*mu2+mu)

mu*(1+kappa2)/(kappa*mu2+mu)

(1.8)

zeta_c := ((z-a*exp(I*alpha))/(z-a*exp(-I*alpha)))^(I*lambda)/((z-a*exp(I*alpha))^.5*(z-a*exp(-I*alpha))^.5)

((exp(I*theta)-a*exp(I*alpha))/(exp(I*theta)-a*exp(-I*alpha)))^(-(.1591549430*I)*ln((kappa2*mu+mu2)/(kappa*mu2+mu)))/((exp(I*theta)-a*exp(I*alpha))^.5*(exp(I*theta)-a*exp(-I*alpha))^.5)

(1.9)

``

c0_c := G_c+I*H_c

G_c+I*H_c

(1.10)

G_c:=(0.5*(T_infty+N_infty)*(1-(cos(alpha)+2*lambda*sin(alpha))*exp(2*lambda*(evalf(Pi)-alpha)))-0.5*(1-k)*(1+4*lambda^2)*(N_infty-T_infty)*(sin(alpha))^2*cos(2*phi_c))/(2-k-k*(cos(alpha)+2*lambda*sin(alpha))*exp(evalf(2*lambda*(Pi-alpha))));

(.5*(N_infty+T_infty)*(1-(cos(alpha)-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*sin(alpha))*exp(-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*(3.141592654-alpha)))-.5*(1-mu*(1+kappa2)/((kappa*mu2+mu)*(1+(kappa2*mu+mu2)/(kappa*mu2+mu))))*(.1013211835*ln((kappa2*mu+mu2)/(kappa*mu2+mu))^2+1)*(N_infty-T_infty)*sin(alpha)^2*cos(2*phi_c))/(2-mu*(1+kappa2)/((kappa*mu2+mu)*(1+(kappa2*mu+mu2)/(kappa*mu2+mu)))-mu*(1+kappa2)*(cos(alpha)-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*sin(alpha))*exp(-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*(3.141592654-1.*alpha))/((kappa*mu2+mu)*(1+(kappa2*mu+mu2)/(kappa*mu2+mu))))

(1.11)

H_c:=0.5*(1-k)*(1+4*lambda^2)*(-T_infty+N_infty)*(sin(alpha))^2*sin(2*phi_c)/(k*(1+(cos(alpha)+2*lambda*sin(alpha))*exp(2*lambda*(evalf(Pi)-alpha))));

.5*(1-mu*(1+kappa2)/((kappa*mu2+mu)*(1+(kappa2*mu+mu2)/(kappa*mu2+mu))))*(.1013211835*ln((kappa2*mu+mu2)/(kappa*mu2+mu))^2+1)*(N_infty-T_infty)*sin(alpha)^2*sin(2*phi_c)*(kappa*mu2+mu)*(1+(kappa2*mu+mu2)/(kappa*mu2+mu))/(mu*(1+kappa2)*(1+(cos(alpha)-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*sin(alpha))*exp(-.3183098860*ln((kappa2*mu+mu2)/(kappa*mu2+mu))*(3.141592654-alpha))))

(1.12)

##Input

alpha:=evalf(Pi/6)

.5235987758

(1.13)

phi_c:=alpha;

.5235987758

(1.14)

N_infty:=0;

0

(1.15)

T_infty:=1;

1

(1.16)

a:=1;nu2:=22/100;kappa2:=3-4*nu2;nu:=35/100;kappa:=3-4*nu;mu:=239/100;mu2:=442/10;

1

 

11/50

 

53/25

 

7/20

 

8/5

 

239/100

 

221/5

(1.17)

``

stress_c

-(9321/123167)*(((.5586916801-.5*(.8660254037-.1591549431*ln(123167/182775))*exp(-.8333333329*ln(123167/182775))+0.5946710490e-2*ln(123167/182775)^2)/(22817/11767-(717/11767)*(.8660254037-.1591549431*ln(123167/182775))*exp(-.8333333329*ln(123167/182775)))-(1.668336947*I)*(.1013211835*ln(123167/182775)^2+1)/(1+(.8660254037-.1591549431*ln(123167/182775))*exp(-.8333333329*ln(123167/182775)))-11767/1434)*(exp(I*theta)-.8660254037+.1591549431*ln(123167/182775))-(11050/717)*exp(1.047197552*I+.8333333328*ln(123167/182775))*((.8660254037+.1591549431*ln(123167/182775))/exp(I*theta)-1/(exp(I*theta))^2))*((exp(I*theta)+(-.8660254037-.5000000002*I))/(exp(I*theta)+(-.8660254037+.5000000002*I)))^(-(.1591549430*I)*ln(123167/182775))/((exp(I*theta)+(-.8660254037-.5000000002*I))^.5*(exp(I*theta)+(-.8660254037+.5000000002*I))^.5)

(1.18)

assume((1/6)*Pi < theta, theta < 2*Pi-(1/6)*Pi)

simplify(evalc(Re(stress_c)))

-0.8815855810e-10*((((1.000000000*cos(theta)^7+(0.5294827753e-2+.5671599115*sin(theta))*cos(theta)^6-4.533186669*cos(theta)^5+(-11.80630620+4.886343937*sin(theta))*cos(theta)^4+3.402782742*cos(theta)^3+(9213180122.+0.9866808100e-1*sin(theta))*cos(theta)^2+(-0.1055437876e11+0.1595769608e11*sin(theta))*cos(theta)-5794103792.*sin(theta)+1760041721.)*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-.5600908440*cos(theta)^7+(0.6523625301e-2+1.134319823*sin(theta))*cos(theta)^6+4.644568297*cos(theta)^5+(-0.2905669688e-1+10.20004207*sin(theta))*cos(theta)^4-0.1774243515e-1*cos(theta)^3+(0.1595769609e11-9.082306669*sin(theta))*cos(theta)^2+(-7023191163.-9213180109.*sin(theta))*cos(theta)-3154310102.*sin(theta)-7408031461.)*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037)))*cos(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))+(-.5600908440*cos(theta)^7+(1.134319823*sin(theta)+0.4756356038e-2)*cos(theta)^6+4.644568284*cos(theta)^5+(11.37920491*sin(theta)-0.2640575516e-1)*cos(theta)^4-0.1774243890e-1*cos(theta)^3+(-11.39571957*sin(theta)+0.1595769607e11)*cos(theta)^2+(-9213180108.*sin(theta)-7023191160.)*cos(theta)-7408031458.-3154310086.*sin(theta))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-1.000000000*cos(theta)^7+(-.5671599115*sin(theta)-0.5294826902e-2)*cos(theta)^6+4.531921682*cos(theta)^5+(-4.886343941*sin(theta)+11.76153292)*cos(theta)^4-3.358186195*cos(theta)^3+(-0.9866807692e-1*sin(theta)-9213180122.)*cos(theta)^2+(-0.1595769609e11*sin(theta)+0.1055437877e11)*cos(theta)-1760041726.+5794103798.*sin(theta))*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037)))*cos(0.314104002e-1*ln(1492820323.-1292820323.*cos(theta)+746410161.*sin(theta))-0.314104002e-1*ln(-1292820322.*cos(theta)-746410161.4*sin(theta)+1492820322.))+(((-.5600908440*cos(theta)^7+(1.134319823*sin(theta)+0.4756356038e-2)*cos(theta)^6+4.626658979*cos(theta)^5+(-0.2905667760e-1+10.24488508*sin(theta))*cos(theta)^4-.1341529536*cos(theta)^3+(0.1595769608e11-9.127079936*sin(theta))*cos(theta)^2+(-7023191161.-9213180109.*sin(theta))*cos(theta)-3154310089.*sin(theta)-7408031435.)*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-1.134319823*cos(theta)^7-.5671599115*sin(theta)*cos(theta)^6+4.531921682*cos(theta)^5+(11.80860365-4.107288978*sin(theta))*cos(theta)^4-3.402959469*cos(theta)^3+(-9213180123.+0.1774243833e-1*sin(theta))*cos(theta)^2+(0.1055437876e11-0.1595769608e11*sin(theta))*cos(theta)+5794103807.*sin(theta)-1760041748.)*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037)))*cos(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))+(-1.000000000*cos(theta)^7-.5671599115*sin(theta)*cos(theta)^6+4.537223485*cos(theta)^5+(-4.886343950*sin(theta)+11.80860366)*cos(theta)^4-3.358186195*cos(theta)^3+(-0.9866807250e-1*sin(theta)-9213180123.)*cos(theta)^2+(0.1055437876e11-0.1595769608e11*sin(theta))*cos(theta)-1760041739.+5794103821.*sin(theta))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(.5600908440*cos(theta)^7+(-1.134319823*sin(theta)-0.4756356038e-2)*cos(theta)^6-4.644554360*cos(theta)^5+(-10.21771474*sin(theta)+0.2905668928e-1)*cos(theta)^4+0.1774243685e-1*cos(theta)^3+(9.082306650*sin(theta)-0.1595769608e11)*cos(theta)^2+(9213180109.*sin(theta)+7023191165.)*cos(theta)+7408031453.+3154310085.*sin(theta))*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037)))*sin(0.314104002e-1*ln(1492820323.-1292820323.*cos(theta)+746410161.*sin(theta))-0.314104002e-1*ln(-1292820322.*cos(theta)-746410161.4*sin(theta)+1492820322.)))/((-sin(theta)+2.-1.732050807*cos(theta))^(1/4)*(sin(theta)+2.-1.732050807*cos(theta))^(1/4))

(1.19)

plot(%, theta = (1/6)*Pi .. 2*Pi-(1/6)*Pi)

 


 

Download Toya_complexPlot2.mw

Hi all, how to get name file  in directory?

Example. I have  and I want call then return

["equals", "function", "polynomial", "viete"]

or

["equals.txt", "function.txt", "polynomial.txt", "viete.txt"]

Thank you very much.

Dear authors,
How to solve this ode problem.

Download link ode.mw

In this problem the boundary condition is

Note: F=g in our problem.

eta approaches N.

Thank you.

 

If I let Maple computer the integral of tan(x), it gets

Int(tan(x), x)=int(tan(x),x), which is the same result as many other softwares get.

However, if I do integral of tan(2*x), it becomes

Int(tan(2*x), x)=(1/4)*ln(1+tan(2*x)^2), instead of -(1/2)*ln(cos(2*x)). The latter form should make more sense considering what Maple gives for tan(x).

In fact, Maple alwys gives the anwer ln(1+tan(n*x)^2)/(2*n) (1) as the integral for tan(n*x) when n>=2. While this is also an indefinite integral of tan(n*x), it is not exactly the equivalent of -(1/n)*ln(cos(n*x)) (2), which is the form Maple gives for integral of tan(x). Expression (2) sometimes evaluates to complex values while (1) only evaluates to real values. It seems that for integral of tan(2x) Maple tries to find the antiderivative that always evaluates to real values, but for tan(x) Maple is happy with -ln(cos(x)), whose value may be complex.

Is there a reason why Maple does this? And is there any way to change the way Maple computes indefinite integrals?

I am trying to put a number of related 2-d plots into a 3-d frame so I can see them stacked up in the third dimension (which follows a parameter) and rotate things around.

The way I once did this successfully was to create the 2-d plots and then use plottools:-transform to move the individual plots in the third dimension, like so:

plt:=plot(something);

tr:=plottools:-transform((x,y) -> [x,2,y]); # the "2" gets changed for the other plots (not shown here).

plots:-display(tr(plt));

The only effect I can get is that the GUI gets confused and I have to close and reload the sheet to get it back again. I have a (complicated) sheet where this actually works, but I am not able to make it work even in the small example I am posting below.

Any hint of where I am going off trail is appreciated. Incidentally, this problem is what led to the corrupted sheet I had maybe a week ago.

Thanks,

Mac Dude.

display3d.mw

 

I unprotect the GAMMA, but still receives error:

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.


 

NULL

restart

II := 2

2

(1)

JJ := 2

2

(2)

N := 2:

unprotect(GAMMA):

q := max(II+1, JJ+1):

M := 5:

seq(seq(seq(assign(GAMMA[i, j, r], a*`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r]), i = 0 .. q), j = 0 .. q), r = 1 .. N):

a := .2:

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc:
``

`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M):

f1 := RandomArray(II+1, JJ+1):

for m to M do `&Gamma;m`[1, m] := f1; `&Gamma;m`[2, m] := f2; `&Gamma;m`[3, m] := f3; `&Gamma;m`[4, m] := f4; `&Gamma;m`[5, m] := f5; `&Gamma;m`[6, m] := f6 end do:

unprotect(`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`):

for m to M do `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Gamma;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Gamma;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Gamma;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Gamma;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Gamma;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Gamma;m`[6, m], [0 .. II, 0 .. JJ]) end do:

UP := proc (s, GAMMA, N, M, a, b, II, JJ) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

Grid:-Seq(UP(s, GAMMA, N, M, a, b, II, JJ), s = 1 .. 2)

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

UP(1, GAMMA, N, M, a, b, II, JJ), UP(2, GAMMA, N, M, a, b, II, JJ)

(3)

NULL


 

Download soal.mw

 

What is the problem?

 

Hi, I'm investigating an equation of motion, and I'm attempting to plot t against different values of thetabn. I have acquired a list of my data points (in the real domain) of the form [thetabn1, t1], [thetabn2, t2] ... etc. But I am struggling to figure out how to plot it. Using dataplot gives me a graph but it is incorrect. I would like a scatterplot, ideally once I have refined my range of thetabn I would like to be able to join it up with a line to create a nice looking plot. Also any improvements to my method would be appreciated. v[i], thetavn and omegac are set variables and s[n] is my function which I am setting equal to zero, and solving for t.

 

with(RealDomain);
v[i] := 145000;
thetavn := (1/6)*Pi;
omegac := .1;
s[n] := v[i]*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac);
for thetabn from evalf((1/100)*Pi) by evalf((1/100)*Pi) to evalf(Pi) do assign('result', [op(result), [thetabn, solve(v[i]*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac) = 0, t)]]) end do;
dataplot(result);

 

Hello, I need to figure out what theta is through this matrix:

https://imgur.com/RldbcJD

Should I use a solve command for this?

MY worksheet have more than 100 parameters, now I want to use all of the parameters within a procedure, is there any easy way to introduce all these paramaters to proc without mentioning them in parentheses one by one proc(x,y,z,...)?

2 3 4 5 6 7 8 Last Page 4 of 1688