MaplePrimes Questions

Hi everybody,

Maybe it's more a warning than a true question ?

I have written a rather heavy-duty code in Maple 2015. A few years ago I faced strong problems of increases in memory. After some investigations I found there came from a procedure P in which a loop realizes a few tenth of calls to  fsolve.
This same procedure  P was itself called a large number of times.

To try to  fix them I inserted a forget(fsolve, initialize=true) command after the fsolve command.
At the end this didn't prove to be very efficient and I decided to rewrite some part of the code in a more efficient way. Basically the  procedure  P is now called only a few times but its inner loop is executed about 200 hundred times.
This new version of the code no longer presents memory size problems, while being more efficient from a computational time point of view.

Today procedure  P still contains the forget(fsolve, initialize=true) command (I had forgotten to remove it)

Now I keep developping this same code under Maple 2018.
The Maple 2015 and Maple 2018 versions both return the same results, but the procedure  P runs in about 20 times the time it runs in Maple 2015 (40 seconds instead of 2)
This comes from the 200 forget(fsolve, initialize=true) calls which consumme about  38 seconds.

With Maple 2015 these same 200 calls to forget(fsolve, initialize=true) only consumme 0.5 second:


As a cure I remove the forget(fsolve, initialize=true) command, plain and simple.

But maybe this misadventure could reveal an unseen behaviour of Maple 2018 ?

 

Hi

I'm using solve,and i want to quantify the dimensions of the solution spaces of the output. For example

solve([a+b, c+b])

produces a singular 1 dimensional object

solve([a+b, -b^2+d^2])

produces 2 objects with dimension 2

EDIT:
my intuition is that the simplest way of doing this is to create a counter for equations of the form
variable=variable
and to run it on each of the lists that solve might produce- so far this kind of thing is beyond me

 

I am trying to solve an equation with respect to the variable w. However, although there seems to be a solution (see plot indicating a root), Maple produces the wron solution (0, when P = 1/2 and d = 1/10):


 

equations := S-P*S*((ln(-2*d*w+P+d)-ln(P-d))*(P-d)/(-1+w)+(P+d)*(ln(-P-d)-ln(d*(2*w-1)-P))/w)/(2*d^2) = 0

S-(1/2)*P*S*((ln(-2*d*w+P+d)-ln(P-d))*(P-d)/(-1+w)+(P+d)*(ln(-P-d)-ln(d*(2*w-1)-P))/w)/d^2 = 0

(1)

variables := w

w

(2)

solutions := solve(equations, variables)

(1/2)*(P+d-exp(RootOf(-P^2*exp(_Z)*ln(1/(P+d))-P*d*exp(_Z)*ln(1/(P+d))+P^3*ln(1/(P+d))-P*d^2*ln(1/(P+d))-ln(P-d)*P^2*exp(_Z)+ln(P-d)*P*d*exp(_Z)-2*P*d*exp(_Z)*_Z+ln(P-d)*P^3-ln(P-d)*P*d^2+d*(exp(_Z))^2-2*P*d*exp(_Z)+P^2*d-d^3)))/d

(3)

eval({solutions}, [P = 1/2, d = 1/10])

{3-5*exp(RootOf(-25*(exp(_Z))^2+75*exp(_Z)*ln(5/3)+50*ln(2/5)*exp(_Z)+25*exp(_Z)*_Z+25*exp(_Z)-30*ln(5/3)-30*ln(2/5)-6))}

(4)

evalf({%})

{{0.}}

(5)

plot(eval(S*(-P*(-2*d*w+P+d)*ln(-2*d*w+P+d)+P*w*(P-d)*ln(P-d)-(-1+w)*(P*(P+d)*ln(P+d)-2*d^2*w))/(2*d^2*(-1+w)*w), {P = 1/2, S = 1, d = 1/10}), w = 0 .. 1)

 

``


 

Download MaplePrimes_03072018.mw

This pde used to be solved in 2018 as far as I know. Now it gives a strange new error

restart;
interface(showassumed=0);
pde :=  diff(u(x,t),t)+k*diff(u(x,t),x$2)+sin(2*Pi*x/L);
ic  :=  u(x,0)=f(x);
bc  :=  D[1](u)(0,t)=0, D[1](u)(L,t)=0;
sol :=  pdsolve({pde,ic,bc},u(x,t)) assuming L>0,t>0,k>0;

Error, (in assuming) when calling 'dsolve'. Received: 'found differentiated functions with same name but depending on different arguments in the given DE system: {F0_0(L), F0_0(x)}'

I am using  Physics:-Version();     MapleCloud version: 72

Do others get this erorr? Why does it show up now when it worked OK before?

update

Iam running on Linux. Here is screen shot

Hello, can someone help me please?

I have to find the minimum (x,y) over the domain [0;2Pi] of the following function

f(x,y):=1+8 cos(1/2 x-1/2 y) cos(1/2 x) cos(1/2 y) which i plotted to have an idea where its minimum is located.

plot3d(f(x,y),x=0..2Pi,y=0..2Pi)

 

I tried to use the command  ' minimize(f(x,y)) '

 

Thank you in advance,

best regards.

 

 Ps: the function normaly attains its minimum at (2Pi/3,-2Pi/3) and (-2Pi/3,2Pi/3).

Hello dear users!

Hope you would be fine. I want to fine the roots of the following cubic equation

u^3+u*d[1]+d[0];

when the discriment is zero, positive and negative. I am waiting your positive response. Thanks

 

@acer @Carl Love @Kitonum @Preben Alsholm

I want to calculate and reproduce this question  in Maple.

with(Optimization):

f := (x, y) -> op(1, NLPSolve(sin(a*x*y), a = 1 .. 5));

int(`if`(f(x, y) > 0, 1, 0), [x = 0 .. 1, y = 0 .. 1], numeric);

# 0 

,but I FAIL.

It should give me: 0.922105

 

Thanks.

I have three columns of data (real numbers) in Excel that have about one thousand rows and I wish to plot their relationships in Maple. The source data simply comprises three columns of numbers and so, are not ordered in triples, [x,y,z]. Does anyone know of a simple routine available that allows me to import the raw data and output a 3-D wire / solid plot in Maple?

Thank you! 

a1:=odeplot(p,[t,x(t)],0..5,color=black,thickness=2):

a2:=plot((2/125)*t^3-(3/25)*t^2+t+1,t=0..5,color=red,style=point,thickness=4):
display(a1,a2,labels=[x1,x2]);
Error, (in plots:-display) expecting plot structure but received: a1
 

I have an explicit mathematical expresssion in the form

m = f[1](x,y)*A + f[2](x,y)*B + f[3](x,y)*C

I wonder if it is possible to use the collect function on the vector z = [A,B,C]^T and write the resulting expression as the dot product

m = f^T.z 

Basically, I am interested in obtaining the vector f = [f[1](x,y),f[2](x,y),f[3](x,y)]^T as a Maple variable in closed-form.

 

Thank you in advance for your help.

 

Marco

I'm referancing the maple help page: https://www.maplesoft.com/support/help/maple/view.aspx?path=Groebner in my thesis, but I am not sure what fields to include, and what to put in them- particularly for the year.

I'm a newbie.I am trying to solve a differential equation symbolically.But I'm having  a\some problem.

First 3 lines works fine....but 4th line gives no output...

Secondly How I'm supposed to simplify the output of 3rd line

 

1.>ode := P*(diff(y(x), x, x))+diff( K(x)*(diff(y(x), x, x)), x, x ) = 0

2.>ics := y(0) = 0, y(L) = 0, ((D@@2)(y))(0) = 0, ((D@@2)(y))(L) = 0

3.>dsolve(ode, y(x))

3rd lines output--y(x) = _C2*x+_C1+Int(DESol({diff(_Y(x), x, x)+2*(diff(K(x), x))*(diff(_Y(x), x))/K(x)+(P+diff(K(x), x, x))*_Y(x)/K(x)}, {_Y(x)}), [x, x]) 

 

4.>dsolve({ics,ode},y(x))

5.>

4th lines gives no output.After hitting "Enter",I get a new line in my Worksheet(line 5).Why..can anyone explain please?

 

I want to match   a*x^b only if "a" and "b" are both not the symbol "y"

Therefore 5*x^y should fail to match, but this below matches.

restart;
expr:=5*x^y;
if patmatch(expr,conditional(a::anything*x^(b::anything),(a<>y and b<>y)),'la') then
   print("it matched, why??");
   map(assign,la):
   print("a = ",a, " b=",b);
fi;

it gives

                      "it matched, why??"
                      "a = ", 5, " b=", y

What did I do wrong? is my conditional wrong above?

 

I was working through some example problems and came across this statement.  Actually comparing Sympy results to Maple. (I prefer Maple).

"Calculate the volume integral of f(...) over the sphere of radius r"

I can solve the problem, but, got hung up on the exact meaning of the problem statement.

Tom Dean

restart
with(VectorCalculus):
with(LinearAlgebra):

## http://www.acme.byu.edu/wp-content/uploads/2017/08/Sympy.pdf
## Problem 7

f := proc(x, y, z)
    (x^2 + y^2 + z^2)^2
end proc;

(M, d) := Jacobian([rho*sin(phi)*cos(theta),
                    rho*sin(phi)*sin(theta),
                    rho*cos(phi)],
                   [rho, phi, theta],
                   'determinant' );
abs(d);
simplify(%);

eqn := f(rho*sin(phi)*cos(theta), rho*sin(phi)*sin(theta), rho*cos(phi));
eqn := eqn * abs(simplify(d));

soln := int(eqn,[rho=0..r,theta=0..2*Pi,phi=0..Pi]);
subs(r=3, soln);

 

How I can convert Root Of to conventional form?

Thanks

root_of.mw
 

Q1 := x*(x-delta)*(1-x)*(x+y)-alpha*x*y; Q2 := beta*x*y-Zeta*y*(x+y); SOLL := solve({Q1, Q2}, {x, y})

{x = 0, y = 0}, {x = 1, y = 0}, {x = delta, y = 0}, {x = RootOf(beta*_Z^2+(-beta*delta-beta)*_Z-alpha*Zeta+alpha*beta+delta*beta), y = -RootOf(beta*_Z^2+(-beta*delta-beta)*_Z-alpha*Zeta+alpha*beta+delta*beta)*(Zeta-beta)/Zeta}

(1)

``


 

Download root_of.mw

 

First 802 803 804 805 806 807 808 Last Page 804 of 2427