MaplePrimes Questions

Dear All,

I am facing some problems. This kind of error has been shown "Error, (in Engine:-Dispatch) badly formed input to solve: not fully algebraic"

eqn1 := {((1+1/beta).(diff(f(eta), eta, eta, eta))-(1+F[s]).((diff(f(eta), eta))^2)+(diff(f(eta), eta, eta)).f(eta)+M.(A-(diff(f(eta), eta)))-1/(R.D[a]).(diff(f(eta), eta)) = 0, diff(theta(eta), eta, eta)+4/3.N.(diff((1+(K-1).theta(eta))^3.(diff(theta(eta), eta)), eta)))+Pr.f(eta).(diff(theta(eta), eta))+(1+1/beta).Pr.Ec.((diff(f(eta), eta, eta))^2)+M.Ec.((diff(f(eta), eta)-A)^2) = 0, f(0) = 0, theta(0) = 1+alpha.(D(theta))(0), theta(10) = 0, (D(f))(0) = 1+(1+1/beta).lambda.(D(D(f)))(0), (D(f))(10) = 0};
;
sys1 := eval(eqn1, {A = 1, Ec = .2, K = 2.5, M = .5, N = .5, Pr = 6.5, R = 1, alpha = .5, beta = 2, lambda = .5, D[a] = .3, F[s] = 1});
sol1 := dsolve(sys1, numeric);
Error, (in Engine:-Dispatch) badly formed input to solve: not fully algebraic
with(plots);
t1 := odeplot(sol1, [eta, diff(f(eta), eta)], eta = 0 .. 10, numpoints = 65, thickness = 0, color = green, linestyle = solid);
plots[plots:-display]({t1})

MAXR.mw

If I have an equation:

-2*a[0]*((x^3*a[1] + 42)*diff(y(x), x, x) - 6*y(x)*x*a[1])*sqrt(-a[0]*(a[1]^2 + 3)) - 3*x^2*((1/3*a[1]^3 + a[0] + a[1])*x + (8*a[1]^2 + 24)*a[0])*diff(y(x), x, x)

I want to obtain a differential algebraic equation for y(x)without the parameters a[1] and a[0]. My idea is to first compute the derivative of U to get:

V:=-2*a[0]*(3*x^2*a[1]*diff(y(x), x, x) + (x^3*a[1] + 42)*diff(y(x), x, x, x) - 6*diff(y(x), x)*x*a[1] - 6*a[1]*y(x))*sqrt(-a[0]*(a[1]^2 + 3)) - 6*x*((1/3*a[1]^3 + a[0] + a[1])*x + (8*a[1]^2 + 24)*a[0])*diff(y(x), x, x) - 3*x^2*(1/3*a[1]^3 + a[0] + a[1])*diff(y(x), x, x) - 3*x^2*((1/3*a[1]^3 + a[0] + a[1])*x + (8*a[1]^2 + 24)*a[0])*diff(y(x), x, x, x)

Then, compute the resultant: resultant(U,V,a[0]). However, since a[0] is algebraic, we cannot compute the resultant directly. I want to substitute:

algsubs((−a[0](a[1]2+3))2=c2,U)

Then, eliminate c, a[0], and a[1] using the resultant. However, I find that this substitution command does not work. Is there a method to help eliminate the parameters a[0]and a[1]?

This expression is easy i think but i can't get any results with same shape  how i can simplify to the same equation in the paper

i am looking for equation 9 and every thing is clear how i can get

mp1.mw

Hello,

I'm having trouble updating an old Maple package to work with the latest version of Maple. In the package, there are several commands that modify predefined procedures and then rename them (see the example below). I need to save all these new procedures to a text file so I can further modify them and better understand their functionality. How can I achieve this?

d_remset := subs(`class`=`d_class`,`remseta`=`d_remseta`,`premas`=`d_premas`,op(`remset`)):

remset is a procedure previously defined.  

Many thanks.

Obs.: If you have a better idea on how to deal with the procdures, please let me know. 

Dear power users, I was wondering whether it is possible to import a xlsx file in such a way that the first row of the file is imported as column headers of the dataframe in Maple? Thank you in advance for any help given.

intersections := proc(P, Q, T)
local R, W, w, t, a, b, sol, buff, v;
sol := NULL;
if T = Y then W := X; else
W := Y; end if;
R := resultant(P, Q, T);
print(`Résultant :`); print(R);
w := fsolve(R, W); t := NULL;
for v in [w] do t := t, fsolve(subs(W = v, P), T); end do;
for a in {w} do for b in {t} do if T = Y then
buff := abs(subs(X = a, Y = b, P)) + abs(subs(X = a, Y = b, Q));
printf(`X=%a,   Y=%a   --->  %a\\n`, a, b, buff); if buff < 1/100000000 then sol := sol, [a, b]; end if;
else buff := abs(subs(X = b, Y = a, P)) + abs(subs(X = b, Y = a, Q));
printf(`X=%a,   Y=%a   --->  %a\\n `, a, b, buff); if buff < 1/100000000 then sol := sol, [b, a]; end if; end if; end do; end do; printf(`Nombre de solutions :  %a\\n`, nops({sol})); print({sol}); end proc:
intersections(X^2 + Y^2 - 1, X - Y, X);
X=-.7071067812,   Y=-.7071067812   --->  0.\n 
I do not wish to find \n in the answer

Here is another ode solution by Maple, I am not able to get zero from odetest. 

If someone could come up with a trick or method to verify this, that will be great. I tried all sort of assumptions and not able to get zero. Even coulditbe() could not give zero. 

It is a Chini ode and also homogeneous, `class G`.

Solving using either method, odetest do not returns zero.  There are no initial conditions. I am sure the solutions are correct, but odetest need some help or may be this requires different method to verify not using odetest?

Worksheet below.

 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1796 and is the same as the version installed in this computer, created 2024, August 29, 14:22 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

ode:=diff(y(x),x) = a*x^(n/(1-n))+b*y(x)^n;
DEtools:-odeadvisor(ode,y(x));

diff(y(x), x) = a*x^(n/(1-n))+b*y(x)^n

[[_homogeneous, `class G`], _Chini]

maple_sol:=dsolve(ode,y(x),[Chini],useInt,implicit); #explicit makes it take very long time
 

Intat(1/(_a^n/(b^(-n-1)*(a*x^(-n/(-1+n)))^(-2*n+1)*(-x^(-n/(-1+n)-1)*a*n*b/(-1+n))^n*n^(-n))-_a+1), _a = -y(x)/((-1+n)*x*a*x^(-n/(-1+n))))-(Int(-1/((-1+n)*x), x))+c__1 = 0

residual:=odetest(maple_sol,ode); #how to show this is zero?

n^n*(-y(x)*x^(1/(-1+n))/(a*(-1+n)))^n*(a*x^(-n/(-1+n)))^(2*n)*(-a*b*n*x^(-2*n/(-1+n)+1/(-1+n))/(-1+n))^(-n)*b^(n+1)-b*y(x)^n

coulditbe(residual=0) assuming real;

FAIL

#now solving as homog. (which gives simpler looking solution

maple_sol:=dsolve(ode,y(x),[homogeneous]);

Int(x^(n/(-1+n))/((b*x*(-1+n)*_a^n+_a)*x^(n/(-1+n))+a*x*(-1+n)), _a = _b .. y(x))-c__1 = 0

residual:=odetest(maple_sol,ode); #how to show this is zero?

-b*y(x)^n*n/(-1+n)-x^(-1-1/(-1+n))*a*n/(-1+n)+b*y(x)^n/(-1+n)+x^(-1-1/(-1+n))*a/(-1+n)-y(x)/(x*(-1+n))

coulditbe(residual=0) assuming real;

FAIL

 


 

Download challenge_odetest_sept_1_2024.mw

 

how to evaluate summation upto infinity in maple including exponential function too if it is possible or we can evaluate it upto finite number of terms?. kindly explain with example

Ive been wondering what i can use this for and where maybe it has been overlooked ,if any one has any ideas im really interested, that pi^ cubed

360°/rad/pi^2

 

I

What is the correct syntax in Maple to do integration of variables on 

So that the new integration variable is using the mapping    u=y*x^(1/3) so that the result is 

The problems seems is that there is no option to tell Maple what the new integration variable is. So it does not know it should be y or x?

I looked at help and all my tries failed. Below is worksheet and also examples from another software as reference. The other software has argument to tell change of variable what is the new integration variable should be. But in Maple, there is no such option.,  Does this mean in Maple change of integration variables only works when the right hand side of the transformation has only one symbol and not two or more? i.e. this works   u=y, but not u=y*x

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

T:=Student:-MultivariateCalculus;
e:=Int(1/(3*u^4 + u + 3),u);
T:-ChangeOfVariables(e,[u=y*x^(1/3)]);
T:-ChangeOfVariables(e,[y=u*x^(-1/3)]);

Student:-MultivariateCalculus

Int(1/(3*u^4+u+3), u)

Error, (in Student:-MultivariateCalculus:-ChangeOfVariables) unable to complete the change-of-variables operation

Error, (in Student:-MultivariateCalculus:-ChangeOfVariables) unable to complete the change-of-variables operation

Student[Calculus1][IntTutor](); #did not help either

 

 

Download change_of_variables_integration_august_31_2024.mw

I searched help and see nothing specific to change of variable for integration, so I assumed the above is the command to use. Am I using the wrong command for integration change of variables in Maple?

For reference, I need to duplicate this in Maple:

Dear All,
My group recently published a DAEsolver in Maple, https://mapletransactions.org/index.php/maple/article/view/16701
This solver is very competive compared to existing large scale DAE solvers (even in other languages) by performing symbolic calculation for analytical Jacobian (including sparsity pattern), and by using parallel sparse direct solver (PARDISO).

The code and paper use ListTools. If the attached procedure can be made threadsafe and parallelized, then the resulting DAEsolver is publishable and will be better than most solvers (from any language) today. We welcome collaborations and suggestions. The code works for N = 40, but kernel connection is lost for higher values of N and it is not stable.

thanks

Dr. Venkat Subramanian
PS, for the specific problem, it is trivial to write the Jacobian and residue in a for loop that can be run in parallel (and it helps us to solve > 1 Million or more DAEs), but the attached code (makeproc) helps in solving DAEs resulting from sophisticated discretization approaches for PDEs without user input.

 

NULL

restart:

Digits:=15;

15

makeproc:=proc(n0,nf,Nt,Eqode::Array,Vars::list,Vars1::list,Equation::Array,j11::Matrix(storage=sparse))
local i,j,LL,LL2,L,i1,varsdir,varsdir1,node,eqs;

for i from n0 to nf do
eqs:=rhs(Eqode[i]):
L:=indets(eqs)minus{t};#print(L);
if nops(L)>0 then
LL := [seq(ListTools:-Search(L[j], Vars),
             j = 1 .. nops(L))];
 LL2 := ListTools:-MakeUnique(LL);
if LL2[nops(LL2)] = 0 then
             LL := [seq(LL2[i1], i1 = 1 .. nops(LL2) - 1)];
         end if;
         if LL2[1]= 0 then LL:=[seq(LL2[i1],i1=2..nops(LL2))]: end:#print(1,LL);
varsdir:=[seq(Vars[LL[i1]]=0.5*uu[LL[i1]]+uu_old[LL[i1]],i1=1..nops(LL))];
else varsdir:=[1=1]:end:

Equation[i]:=uu[i]-deltA*subs(varsdir,t=tnew,eqs):#print(i,Equation[i]);
        L := indets(Equation[i]);
        LL := [seq(ListTools:-Search(L[j], Vars1),j = 1 .. nops(L))];
        LL2 := ListTools:-MakeUnique(LL);
        if LL2[nops(LL2)] = 0 then
            LL := [seq(LL2[i1], i1 = 1 .. nops(LL2) - 1)];
        end if;
        if LL2[1]= 0 then LL:=[seq(LL2[i1],i1=2..nops(LL2))]: end:
        
        for j to nops(LL) do
            j11[i, LL[j]] := diff(Equation[i], uu[LL[j]]);
        end do;
 
od:
end proc:

CodeTools[ThreadSafetyCheck](makeproc);

0, 1

#infolevel[all]:=10;

 

N:=40;h:=1.0/N:

40

with(Threads[Task]):

Eqs:=Array(1..N,1..N):

for i from 1 to N do for j from 1 to N do
if i = 1 then left:=0: else left:=(c[i,j](t)-c[i-1,j](t))/h:end:
if i = N then right:=-0.1: else right:=(c[i+1,j](t)-c[i,j](t))/h:end:
if j = 1 then bot:=0: else bot:=(c[i,j](t)-c[i,j-1](t))/h:end:
if j = N then top:=-0.1: else top:=(c[i,j+1](t)-c[i,j](t))/h:end:
Eqs[i,j]:=diff(c[i,j](t),t)=(right-left)/h+(top-bot)/h-c[i,j](t)^2:
od:od:

 

eqs1:=Array([seq(seq(Eqs[i,j],i=1..N),j=1..N)]):

ics:=[seq(seq(c[i,j](t)=1.0,i=1..N),j=1..N)]:

Vars:=[seq(seq(c[i,j](t),i=1..N),j=1..N)]:

Vars1:=[seq(uu[i],i=1..N^2)]:

Equation:=Array(1..N^2):j11:=Matrix(1..N^2,1..N^2,storage=sparse):eqs:=copy(Equation):

CodeTools:-Usage(makeproc(1,N^2,N^2,eqs1,Vars,Vars1,Equation,j11));

memory used=21.47MiB, alloc change=24.99MiB, cpu time=235.00ms, real time=231.00ms, gc time=62.50ms

1-deltA*(-1600.00000000000-.50*uu[1600]-1.0*uu_old[1600])

j11[5,5];

1-deltA*(-2400.00000000000-.50*uu[5]-1.0*uu_old[5])

#Equation[1];

makeprocDistribute := proc(i_low, i_high,Nt,Eqode::Array,Vars::list,Vars1::list,Equation::Array,j11::Matrix(storage=sparse))
local i_mid;
if 200 < i_high - i_low then
#if i_low > 250 then
#i_mid := floor(1/2*i_high - 1/2*i_low) + i_low;
i_mid:=iquo(i_low+i_high,2):
Continue(null,
Task = [makeprocDistribute, i_low, i_mid,Nt,Eqode,Vars,Vars1,Equation,j11],
Task = [makeprocDistribute,i_mid + 1, i_high,Nt,Eqode,Vars,Vars1,Equation,j11]);
else
makeproc(i_low, i_high,Nt,Eqode,Vars,Vars1,Equation,j11); end if;
end proc:

j11[5,5];

1-deltA*(-2400.00000000000-.50*uu[5]-1.0*uu_old[5])

N^2;

1600

NN:=N^2;

1600

Equation:=Array(1..N^2):j11:=Matrix(1..N^2,1..N^2,storage=sparse):

CodeTools:-Usage(Start(makeprocDistribute,1,NN,NN,eqs1,Vars,Vars1,Equation,j11)):

memory used=22.01MiB, alloc change=239.31MiB, cpu time=985.00ms, real time=241.00ms, gc time=1.61s

j11[5,5];

1-deltA*(-2400.00000000000-.50*uu[5]-1.0*uu_old[5])

 

NULL


 

Download makeproctest.mw
 

NULL

 

I analyzed the kinetic equation of the system and got this formula. I want to realize the sweep frequency analysis of the kinetic function by changing the size of omega2, but I don't know how to write a program. Want to ask for help

solve831.mw

In the attached file I would like to use the functions "Gradient" and "Hessian". Hessian should also calculate the determinant and check positive definiteness. I was unable to do that. Other questions for me as a beginner are:
How are the long brackets and the > sign on the left edge created? What does a semicolon at the end of the command mean? How is a 3D plot created? What does "restart" mean?

Regards, Alfred_FAF_20240831.mwAF_20240831.mw

 In the calculation process, I selected (num=5). How can I detect the maximum value of num to ensure the series solution would be converged?

seried.mw

If there any way to make text  parallel to a line in textplot3d.

display(line([1,2,3],[4,5,-2],linestyle=longdash),
        point([2.5,3.5,0.5]),
        textplot3d([2.5,3.5,0.5,"not aligned"]))
First 76 77 78 79 80 81 82 Last Page 78 of 2427