MaplePrimes Questions

Dear Users,

I hope everyone here is fine. I want to extract dat file from the attached contour plot file. Please help me to resolve this issue. Many thanks in advance

Dat_file.mw

restart:
PDEtools[declare](f(x), prime = x):
PDEtools[declare](Theta(x), prime = x):
PDEtools[declare](Phi(x), prime = x):
N := 4; M := .1; Kp := .1; Gr := 0.1e-1; Gc := 0.1e-1; Pr := 1; S := 0.1e-1; Sc := .78; Kc := 0.1e-1; La := 1
f (x):=  sum((p^(i))*f [i] (x), i = 0 .. N) ;
Theta(x):=  sum((p^(i))*Theta[i] (x), i = 0 .. N) ;
Phi(x):= sum((p^(i))*Phi [i] (x), i = 0 .. N);
HPMEq1 := (1-p)*(diff(f(x), x, x, x))+p*(diff(f(x), x, x, x)+(1/2)*(diff(f(x), x, x))*f(x)-(M^2+Kp)*(diff(f(x), x)-La)+Gr*Theta(x)+Gc*Phi(x))
HPMEq2 := (1-p)*(diff(Theta(x), x, x))/Pr+p*((diff(Theta(x), x, x))/Pr+(1/2)*(diff(Theta(x), x))*f(x)+S*Theta(x))
HPMEq3 := (1-p)*(diff(Phi(x), x, x))/Sc+p*((diff(Phi(x), x, x))/Sc+(1/2)*(diff(Phi(x), x))*f(x)+Kc*Phi(x))
for i from 0 to N do equ[1][i] := coeff(HPMEq1, p, i) = 0 end do
for i from 0 to N do equ[1][i] := coeff(HPMEq2, p, i) = 0 end do
for i from 0 to N do equ[1][i] := coeff(HPMEq3, p, i) = 0 end do
cond[1][0] := f[0](0) = 0, (D(f[0]))(0) = 0, Theta[0](0) = 1, Phi[0](0) = 1, Theta[0](5) = 0, Phi[0](5) = 0, (D(f[0]))(5) = 1; for j to N do cond[1][j] := f[j](0) = 0, (D(f[j]))(0) = 0, Theta[j](0) = 0, Phi[j](0) = 0, Theta[j](5) = 0, Phi[j](5) = 0, (D(f[j]))(5) = 0 end do
for i from 0 to N do pdsolve({cond[1][i], equ[1][i]}, f[i](x)); f[i](x) := rhs(%) end do
f(x) := evalf(simplify(sum(f[n](x), n = 0 .. N))); convert(f(x), 'rational'); subs(x = 1, diff(f(x), x))

Please rectify the error
Thank you

Error, (in PD/PD) too many levels of recursion

Maple Input:
restart; with(RealDomain); log[2](x^2 - 6*x) = 3 + log[2](1 - x); Maple returns as solution
ln\x - 6 x/ ln(1 - x) ------------ = 3 + --------- ln(2) ln(2) "(->)" [[x = 2], [x = -4]]
Is the solution x = 2 correct?

Substituting x=2 into the original Function Maple returns correct: log[2](2^2 - 6*2);

undefined and log[2](1 - 2).; undefined. So x =2 should not be a solution of this function.

Hi,

I am trying to automatically combine plots that I created with an index: ex. IP[i] := plot(...

I can combine them manually, but the maximum value of i can be almost any number greater than 1, and I don’t want to edit things all the time. i can also be very big. I have tried several random ways of embedding the index, but I’ve had no success.

Any ideas? Thanks.

Jno.

Please Help!  The flow gets me like this,Where should i fix this problem.The flow changes for me fluctuate through the series range.What to do to get upflow in f(eta) and downflow in theta(eta)

 MVP.mw

I want to import a numeric 2800*1 matrix from matlab to maple by following command, but faced error as bellow:

X := ImportMatrix("E:/.../Omega.mat", source = MATLAB);
 ImportMatrix:-ModuleApply called with arguments: E:/.../Omega.mat, datatype = auto, delimiter = (), format = (), mode = (), output = all, ragged = true, skiplines = 0, source = MATLAB, sourceid = all, transpose = false
 #(ImportMatrix:-ModuleApply,36): error
Error, (in ImportMatrix) Array index out of range
 locals defined as: file = E:/.../Omega.mat, src = Matlab, ext = ext, res = res, x = x, isv7 = isv7, del = false

Where is the problem?

How to import?

This is my current code:

with~([NumberTheory, DocumentTools]):
tb := Tabulate([seq]([galois](CyclotomicPolynomial(i, x),x), i = 1 .. 10)):

I hope to export it into SVG file, but this code will report a error information:

Export("aatest.svg", tb)

# this is an example:

with(plots);

A := [[[6, 13], [6, 7], [5, 7], [5, 5], [7, 5], [7, 4], [4, 4], [4, 13]], [[13, 13], [13, 20], [20, 20], [20, 23], [22, 23], [22, 22], [23, 22], [23, 16], [16, 16], [16, 9], [9, 9], [9, 6], [7, 6], [7, 7], [6, 7], [6, 13]], [[13, 23], [20, 23], [20, 20], [13, 20]], [[13, 24], [20, 24], [20, 23], [13, 23]], [[22, 24], [22, 23], [20, 23], [20, 24]], [[24, 24], [24, 22], [23, 22], [23, 23], [22, 23], [22, 24]], [[22, 22], [22, 23], [23, 23], [23, 22]], [[22, 25], [25, 25], [25, 16], [23, 16], [23, 22], [24, 22], [24, 24], [22, 24]], [[25, 6], [16, 6], [16, 9], [23, 9], [23, 16], [25, 16]], [[9, 6], [9, 9], [16, 9], [16, 6]], [[6, 6], [6, 7], [7, 7], [7, 6]], [[6, 20], [13, 20], [13, 13], [6, 13]], [[20, 28], [28, 28], [28, 16], [25, 16], [25, 25], [22, 25], [22, 24], [20, 24]], [[16, 5], [9, 5], [9, 6], [16, 6]], [[7, 5], [7, 6], [9, 6], [9, 5]], [[5, 5], [5, 7], [6, 7], [6, 6], [7, 6], [7, 5]], [[4, 23], [13, 23], [13, 20], [6, 20], [6, 13], [4, 13]], [[23, 9], [16, 9], [16, 16], [23, 16]], [[9, 1], [1, 1], [1, 13], [4, 13], [4, 4], [7, 4], [7, 5], [9, 5]]];
NULL;

arte := seq(polygonplot([A[i]], color = ColorTools:-Color([rand()/10^12, rand()/10^12, rand()/10^12]), axes = none, style = polygon, view = [1 .. max(A[]), 1 .. max(A[][])]), i = 1 .. nops(A));
display(arte);

Dear all 
For n geater or equal 2, I would like to solve to find an integrer n that such satisfy an inequality. 

I would like to see how large does n have to be for  the following ineqlaity satisfied. 
But, unfortunattely Maple return 
Warning, solutions may have been lost

restart;
epsilon:=0.001;
solve(10^n /factorial(n) <= epsilon, n);

thank you 

printf("%", [[]]);

Yeah, it is incompatible with the Maple syntax. But I don't know why this command actually causes a serious logic error here. Actually, this seems fairly trifling in my view. Can you produce it again? 

restart

printf("%", [[]]);

NULL

Download printfIssue.mws

Dear Maplers

Consider the follwoing differential equation

Deq:=(K*( Q*sinh(K)*cosh(Q)-K*cosh(K)*sinh(Q))*(1+s*K^2)
   +p*(-4*K^2*Q*(K^2+Q^2)
       +Q*(Q^4+2*K^2*Q^2+5*K^4)*cosh(K)*cosh(Q)
       -K*(Q^4+6*K^2*Q^2+K^4)*sinh(K)*sinh(Q)));

pp := 0.077;
ss := 0; 

ode:= diff(Q(K), K) = eval(subs(Q=Q(K),-(diff(Deq, K))/(diff(Deq, Q))),[p=pp,s=ss]);

I aim to solve this DE numerically. Note that K and Q are complex variable and K varies from 0.1.e-5*I to 20.+1.e-5*I

in addition,

Q(0)=1e-10+1e-10*I

I tried dsolve. but it does not get back correct solutions

sol1 := dsolve({ode,Q(0)=1e-15+1e-15*I}, numeric, method=rkf45, output = listprocedure, abserr = 1.*10^(-6), relerr = 1.*10^(-6), range=0.0+1e-5*I .. 10.0+1e-5*I )

for example sol1(2.0+1e-5*I) return nothing

How can I solve this equation?

after updating to latest Physics package, I find now latex geneated is invalid as it gives compile error.

I looked at old files I have and I see the latex generated before was correct. so something changed in the latex() command to cause this and now none of my files compile when I run my Maple program.

Before, same code used to generate this

 \left(-x^{2}+1\right) \left(y^{\prime}\right)^{2} = 1-y^{2} 

which compiled correctly.

Here is worksheet
 

interface(version)

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1378 and is the same as the version installed in this computer, created 2023, January 29, 12:4 hours Pacific Time.`

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      linelength=10000  
);
Typesetting:-Unsuppress('all'); #always do this.
Typesetting:-Settings(prime=x,'typesetprime'=true); #this says to use y'(x) instead of dy/dx    
Typesetting:-Suppress(y(x)); # this says to use y' and not y'(x)

[useimaginaryunit = i, usecolor = false, powersoftrigonometricfunctions = mixed, leavespaceafterfunctionname = true, cacheresults = false, spaceaftersqrt = true, linelength = 10000]

x, false

ode:=(-x^2+1)*diff(y(x),x)^2 = 1-y(x)^2;

(-x^2+1)*(diff(y(x), x))^2 = 1-y(x)^2

latex(ode)

\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}

 

 

The error from the latex compiler is 

 

\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\begin{document}

\begin{dmath*}
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
\end{dmath*}

\end{document}

compiled using texlive lualatex command gives

(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Double superscript.
<recently read> \mathsup 
         
l.12 \left(-x^{2}+1\right) y^{\prime}^{2}
                                        = 1-y^{2}
? 

The fix is to keep same latex as before or use an extra {} like this  {y^{\prime}}^{2} 

but I think \left(y^{\prime}\right)^{2} looks better. But y^{\prime}^{2} is definitly wrong latex.

Download latex_problem.mw

I want to take v_{r} , v_{theta}, and v_{pi} common out of this expression and I want to simplify in a more simplify way. The maple sheet is attached below:metriccalculaions.mw

 

G[ti] := -(v[r]*`cos&theta;`*`cos&phi;`+v[r]*`cos&theta;`*`sin&phi;`+v[r]*`sin&theta;`)*rho*(-c^2+(1-A)*(v[r]^2+v[theta]^2+v[phi]^2-(v[r]*`cos&theta;`*`cos&phi;`)^2-(v[r]*`cos&theta;`*`sin&phi;`)^2-(v[r]*`sin&theta;`)^2))/(A*c^3)

First 233 234 235 236 237 238 239 Last Page 235 of 2425