MaplePrimes Questions

Hi all

 

Please, I'd like to clarify some basic points about performing computations in Maple 18. Up to now I have been doing some numeric calcs using matrices normally composed of 10 to 15 columns and 200 to 600 rows.

 

When doing the calcs with a matrix of ~200 rows, it is just ok but as the number of rows increase the calculation speed reduces significantly.

 

The data contained in each row is calculated within a loop cycle (i.e.: for i from 1 to 200 do ......).

 

The number of rows is controlled by a slider so when I drag the slider the calcs are automatically updated and the results shown graphically.

 

As I said it is too slow so I don't know if I should be looking into the option of doing calcs symbolically first? However you can't use symbolic notation when working with matrices. I still got a lot of calcs to do but prefer not to continue as it will only get slower so better to see if I can optimise speed.

 

Any comment is trully appreciated.

 

Regards

Cesar


m 18 cubacuhre integration fail, intergrand unknown

restartprintlevel = 3binomial(7, 2); with(StringTools); FormatTime(%c)with(LinearAlgebra); with(IntegrationTools)with(numapprox); with(OrthogonalSeries); LinearAlgebra:-HermitianTranspose(3-I*7)infolevel[`evalf/int`] := 4; pie = evalf(Pi)n = 1l = 0m = 0n1 = 1l1 = 0m1 = 0alpha = 5.8alpha1 = 4.2R = .5Theta = (1/6)*PiPhi = 3*Pi*(1/4)region := [r = 0 .. infinity, theta = 0 .. Pi, phi = 0 .. 2*Pi]r1 := proc (r, theta, phi, R, Theta, Phi) options operator, arrow; (r^2+R^2-2*r*R*(sin(theta)*sin(Theta)*cos(phi-Phi)+cos(theta)*cos(Theta)))^(1/2) end proc"coef:=(l1,l2,m1,m2)->(-1)^(l1-l2) (((4 *pie *(2 l1+1)!)/((2 l1-2 l2+1)!*(2 l2+1)!))*("
"(binomial(l1+m1,l2+m2)*binomial(l1-m1,l2m2))/(binomial(2* l1,2* l2)))())^(1/(2));NN:=(n,alpha)->((2 alpha)^(n+(1)/(2)))/(((2 n)!)^((1)/(2)));  "

integrand := sum(sum(R^(l1-l2)*SphericalY(l1-l2, m1-m2, Theta, Phi)*coef(l1, l2, m1, m2)*r^(2+l+l2)*SphericalY(l2, m2, theta, phi)*LinearAlgebra:-HermitianTranspose(SphericalY(l, m, theta, phi))*NN(n, alpha)*r^(n-l-1)*exp(-alpha.r)*NN(n1, alpha1)*r1(r, theta, phi, R, Theta, Phi)^(n1-l1-1)*exp(-alpha1*r1(r, theta, phi, R, Theta, Phi))*sin(theta), m2 = -l2 .. l2), l2 = 0 .. l1)

evalf(Int(integrand, region, 'epsilon' = 0.1e-3, 'method = _CubaCuhre'));
``NULL

binomial(7, 3)region4 := [x = 0 .. 10*Pi, y = 0 .. 10*Pi]

integrand4 := (cos(x)+(1/3)*sin(y))^6*(sin(y)-(1/3)*cos(x))^2

evalf(Int(integrand4, region4, 'epsilon' = 0.1e-3, 'method = _CubaCuhre'))

NULL

NULL

 

Download stovrlp2.mw

m 18 cubacuhre integration fail, intergrand unknown

 

 

Hi, as the title says I am animating an implicitplot and want a different color for each curve left by the trace. I realize it may be easier to build plot structures using seq and display(..,insequence=false) but I thought I should learn more Maple ha ha. Plus  it seems easier to implement.

 Forgot to say I use Maple 15

For equation sol[2][1]=constant A,

 

 

> animate(implicitplot, [sol[2][1] = A, x = -6 .. 15, y = -15 .. 15, numpoints = 10^5], A = -10 .. 10, trace = 2, frames = 20);

 

 

Hi all

In matlab software we have a command namely fmincon which minimizes any linear/nonlinear algebric equations subject to linear/nonlinear constraints.

Now my question is that: what is the same command in maple?or how can we minimize linear/nonlinear function subject to linear/nonlinear constraints in maple?

thanks a lot

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hi all,
I need to find mina(w) then a=-1,0,1 and

w := piecewise((x-a)/t <= -10, 202*a-200*x-(202001/101)*t, (x-a)/t <= -910/101, 3*a-x-(1011/101)*t, (x-a)/t <= 910/101, 2*a-t, (x-a)/t <= 10, a+x-(1011/101)*t, 10 < (x-a)/t, -198*a+200*x-(202001/101)*t)

Also need to plot it, i think it should look like this 

Thanks

 

 

 

I am getting a complex solution for a physical quantity, how can I plot it. Should I plot the real part or modulus?

solution is,

C1*sqrt(4*tau^2*M^2*lambda^2+Q^2)*LegendreP((1/2*I)*sqrt(7)-1/2, I*sqrt(7), (2*I)*lambda*M*tau/Q)+C2*sqrt(4*tau^2*M^2*lambda^2+Q^2)*LegendreQ((1/2*I)*sqrt(7)-1/2, I*sqrt(7), (2*I)*lambda*M*tau/Q)

 

where C1 and C2 are integration constants.

Perhaps I am being daft, but to me the Physics package seems, quite surprisingly, to have trouble multiplying by a nonzero, non-square matrix. The test code

restart:
with(Physics):
Matrix(2,2,fill = 0) . Vector(2),
Matrix(2,2,fill = 1) . Vector(2),
Matrix(2,3,fill = 0) . Vector(3);
Matrix(2,3,fill = 1) . Vector(3);

produces the following output:

Error, (in Vector[column]) Matrix index out of range

i.e., the last expression cannot be evaluated; while the test code (where no loading of the Physics package is performed)

restart:
#with(Physics):
Matrix(2,2,fill = 0) . Vector(2),
Matrix(2,2,fill = 1) . Vector(2),
Matrix(2,3,fill = 0) . Vector(3),
Matrix(2,3,fill = 1) . Vector(3);

produces the following expected output:

PS: To be sure, I have from http://www.maplesoft.com/products/maple/features/physicsresearch.aspx downloaded the latest version (2014, March 19, 4:0 hours) of the Physics package for Maple 17 (the version I am running).

Please i don't want to convert from list to set then apply set minus and convert back because it loses its order and repititions.

 

so i want something that can for example do the following:

list_minus([1,2,4,6,2,1,3,6,2],[7,4,2,5,2]) = [1,6,1,3,6,2]

so it removes repititions from left and order is retained.

Hi all

I dont know why some Z1 appears on the screen and the code does not converge.
please help me
thanks alooooot


restart;
n:=3;
nn:=3;
m:=1;
BB:=1;
BINF:=5:
pr:=7;
digits:=10;
>
eq1:=diff(f(tau),tau$3)+((3/5)*f(tau)*diff(f(tau),tau$2))-(1/5)*(diff(f(tau),tau$1))^2+((2/5)*tau*diff(h(tau),tau$1))-((2/5)*h(tau))-BB*diff(f(tau),tau$1)=0;
eq11:=(1/pr)*diff(h(tau),tau$3)+(3/5)*f(tau)*diff(h(tau),tau$2)=0;

h(tau):=sum(p^i*h[i](tau),i=0..nn);
f(tau):=sum(p^i*f[i](tau),i=0..n);

 

H1:= p*(diff(f(tau),tau$3)+((3/5)*f(tau)*diff(f(tau),tau$2))-(1/5)*(diff(f(tau),tau$1))^2+((2/5)*tau*diff(h(tau),tau$1))-((2/5)*h(tau))-BB*diff(f(tau),tau$1))+(1-p)*(diff(f(tau),tau$3)):
H11:= p*((1/pr)*diff(h(tau),tau$3)+(3/5)*f(tau)*diff(h(tau),tau$2))+(1-p)*(diff(h(tau),tau$3)):
>
eq2:=simplify(H1):
eq22:=simplify(H11):
eq3:=collect(expand(eq2),p):
eq33:=collect(expand(eq22),p):
eq4:=
convert(series(collect(expand(eq2), p), p, n+1), 'polynom');
eq44:=
convert(series(collect(expand(eq22), p), p, n+1), 'polynom');
for i to n do
s[i] := coeff(eq4, p^i) ;
print (i);
end do:
for i to nn do
ss[i] := coeff(eq44, p^i) ;
print (i);
end do:
s[0]:=diff(f[0](tau), tau$3);
ss[0]:=diff(h[0](tau), tau$3);
ics[0]:=f[0](0)=0, D(f[0])(0)=0, D(f[0])(BINF)=0;
icss[0]:=h[0](BINF)=0, D(h[0])(0)=1, D(h[0])(BINF)=0;

dsolve({s[0], ics[0]});
f[0](tau):= rhs(%);
#dsolve({ss[0], icss[0]});
h[0](tau):= -exp(-tau); #;rhs(%);

>
>
for i to n do
f[ii-1](tau):=convert(series(f[ii-1](tau), tau, nn+1), 'polynom');
h[ii-1](tau):=convert(series(h[ii-1](tau), tau, nn+1), 'polynom');
s[i]:=simplify((s[i]));
ics[i]:=f[i](0)=0, D(f[i])(0)=0, D(f[i])(BINF)=0;
dsolve({s[i], ics[i]});
f[i](tau):=rhs(%);
ss[i]:=(ss[i]);
icss[i]:=h[i](BINF)=0, D(h[i])(0)=0, D(h[i])(BINF)=0;
dsolve({ss[i], icss[i]});
h[i](tau):=rhs(%);

end do;

f(tau):=sum((f[j])(tau),j=0..n);
with(numapprox):

 

plot(diff(f(tau),tau),tau=0..5,color=blue,style=point,symbol=circle,symbolsize=7,labels=["tau","velocity"]);
plot(pade(diff(f(tau),tau), tau, [7, 7]),tau=0..5,color=blue,style=point,symbol=circle,symbolsize=7,labels=["tau","velocity"]);

 

 

x*(y+z)/x

convert any polynomial to Divide(Mult(x, Plus(y+z)), x)

 

Hi can you please help me? I want to write a program in Maple code, using the Newton-Raphson method, to solve the equation tan(x) −x-1=0 .  the approximate root is 1.5.
I tried doing this using a while loop to compare the last and current iterates, but something is not working.
so can you please help me do that?

Thanks

y = -x+sqrt(-5*x)

how to plot this in 2d or 3d graph

Hi,

What is the reason/Why: 

 

Error, (in dsolve/numeric/bvp) unable to achieve requested accuracy of 0.1e-5 with maximum 128 point mesh (was able to get 0.66e-1), consider increasing `maxmesh` or using larger `abserr`

Thanks for the help :)

I'm trying to plot the direction field of the second order differential equation x''=x'-cos(x) using dfieldplot: 

> with(DEtools); with(plots);
> f1 := (x, y) options operator, arrow; diff(x(t), t)-cos(x(t)) end proc;
/ d \
(x, y) -> |--- x(t)| - cos(x(t))
\ dt /
> dfieldplot([diff(x(t), t) = y(t), diff(y(t), t) = f1(x(t), y(t))], [x(t), y(t)], t = -2 .. 2, x = -2 .. 2, y = -2 .. 2);
Error, (in DEtools/dfieldplot) cannot produce plot, non-autonomous DE(s) require initial conditions.
>

The error I'm getting says I need initial conditions, but I wasn't provided with any. Is there another way to plot this? Sorry if this is dumb question, but I've only ever plotted first order equations.

The equation

x^7+14*x^4+35*x^3+14*x^2+7*x+88 = 0

has the unique real root

x = (1+sqrt(2))^(1/7)+(1-sqrt(2))^(1/7)-(3+2*sqrt(2))^(1/7)-(3-2*sqrt(2))^(1/7).

Here is its verification:

Is it possible to find that in Maple? I unsuccessfully tried the solve command with the explicit option.

 

 

 

First 1449 1450 1451 1452 1453 1454 1455 Last Page 1451 of 2434