MaplePrimes Questions

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)

Hello 
My Question is is there a command to count up "compute" the number of certain digits in a given number

Hi everyone, I'm studying physics at college and we have to do lab reports. Of course we have to fit data sets. They only taught us how to calculate errors of the parameters of lineaer distributions.

Unforutnately I have to fit points that follow these functions:

y=a+b*x^c

y=d+a*x/(sqrt(b*x^2+c^2))

First of all, which command do I use to fit for the second function? (Its the formula of abs(Vout/Vin) in function of the frequence in RC circuits)

I know for the first one there's the PowerFit command.

Also, is there a command that returns the errors for the variaous fit parameters? (i.e. a,b,c,d)

Or at least, someone knows the methods and formulas to find them?

Hello guys
I'm having trouble solving a PDE using pdsolve-numerical. Here's a notebook attached.

I'm grateful if anyone can help.

Regards,

Oliveira

                   PDE1.mw

x := 19.073*Unit('m'^4*'kg'^2/('s'^6*'A'^2)); simplify(x); Units:-Simple:-simplify(x); Units:-Standard:-simplify(x); Units:-Natural:-simplify(x); convert(x, units, V^2); # None of the simplify commands do anything. Is there a way to get the last result?

This figure refuses to turn
Fig := proc(t) local a, b, P, Q, N, R, TG, x0, y0, p1, p2, p3, po, tp, sol; a := 11; b := 7; R := sqrt(a^2 + b^2); P := [R*sin(t), R*cos(t)]; x0 := P[1]; y0 := P[2]; TG := (a^2 - x0^2)*(y - y0)^2 + (b^2 - y0^2)*(x - x0)^2 + 2*y0*x0*(x - x0)*(y - y0) = 0; p1 := implicitplot(x^2/a^2 + y^2/b^2 - 1, x = -11 .. 11, y = -7 .. 7, color = blue); p2 := implicitplot(x^2 + y^2 - a^2 - b^2, x = -15 .. 15, y = -15 .. 15, color = blue); p3 := implicitplot(TG, x = -15 .. 15, y = -15 .. 15, color = red); sol := solve({x^2/a^2 + y^2/b^2 - 1 = 0, TG}, {x, y}, explicit); Q := [subs(sol[1], x), subs(sol[1], y)]; N := [subs(sol[2], x), subs(sol[2], y)]; po := plot([P, Q, N], style = point, symbolsize = 15, symbol = solidcircle, color = red); tp := textplot([[P[], "P"], [Q[], "Q"], [N[], "N"]], 'align' = {'above', 'left'}); display([p1, p2, p3, po, tp], scaling = constrained); end procnFig := 60;
Figs := seq(Fig(2*Pi*i/nFig), i = 0 .. nFig);
Error, (in Fig) invalid subscript selector
display(Figs, insequence = true);
NULL; Why this error message. Thank you.

Given matrix A, Please help me calculate A^100 by steps, without using Maple or calculators. Thank you so much!

I'm terribly sorry to ask such elementary questions.

I am getting started on Maple and the most trivial calculations are taking hours.

For example the expression:

b := exp(-i*varphi)*sin(theta/2)*cos(theta/2) + cos(theta/2)*exp(i*varphi)*sin(theta/2)

can be simplifed to           sin(theta)*Cos(Phi)

but no amount of commands such as simplify(b,trig) or combine(b, exp) will do it.

Any hits will be appreciated.

interface(version);

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

restart;
ode := diff(y(x),x)/y(x)-(3*(4*x^2+y(x)^2+1))/(2*x*(4*x^2+y(x)^2-2-2*x))=0;
DEtools:-odeadvisor(ode);
sol:=dsolve(ode,y(x));

(diff(y(x), x))/y(x)-(3/2)*(4*x^2+y(x)^2+1)/(x*(4*x^2+y(x)^2-2-2*x)) = 0

[_rational]

Error, (in dsolve) invalid subscript selector

 

Download error_jan_27_2023.mw

How do you modify the column widths in an already created table?

I want to create the groups (Z/nZ)+ and (Z/nZ)*.

I can do this in python for n=7. I want to do this with other values of n.

(Z/7Z)+
   0 1 2 3 4 5 6
0 0 1 2 3 4 5 6
1 1 2 3 4 5 6 0
2 2 3 4 5 6 0 1
3 3 4 5 6 0 1 2
4 4 5 6 0 1 2 3
5 5 6 0 1 2 3 4
6 6 0 1 2 3 4 5
 
(Z/7Z)*
   1 2 3 4 5 6
1 1 2 3 4 5 6
2 2 4 6 1 3 5
3 3 6 2 5 1 4
4 4 1 5 2 6 3
5 5 3 1 6 4 2
6 6 5 4 3 2 1
 

I tried creating a Cayley table but can not get that right.

I started to use maple recently and I do not know why fsolve does not work in this case:

Sol-NLSE.mw

I am wondering if the conjugate(x[j]) is the reason.

Thanks in advance

In the Physics package.

How do I define arbitrary non-standard coordinates.

All that is available is the standard trivial cartesian, spherical and such coordinate systems.

Setup(Coordinatesystems = cartesian)

See e.g.

https://www.maplesoft.com/support/help/maple/view.aspx?path=Physics%2FRicci

This question was inspired by https://www.mapleprimes.com/questions/235613-Convert-A-List-With-Nested-Ordered-Sets.

I want to replace several characters of a string separately. 

s:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]"

Like this their will be many say n element then I need to a list as 

{{0,1},{1,2},{1,10},......}

I took the for-loop as follows, but I'm wondering if there's a more concise way to deal with it.

with(StringTools):
L:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]":    
L1:=["(",")","[","]"]:
L2:=["{","}","{","}"]:
X:=L:
for i from 1 to nops(L1) do
X:=SubstituteAll(X,L1[i],L2[i]);
end do:
parse(X)

{{0, 1}, {1, 2}, {1, 10}, {2, 3}, {3, 4}, {4, 5}, {4, 9}, {5, 6}, {6, 7}, {7, 8}, {8, 9}, {10, 11}, {11, 12}, {11, 16}, {12, 13}, {13, 14}, {14, 15}, {15, 16}}

I know that a function acting repeatedly can use f @@ n, for example,

(sin@@2)(x);

But if f  has some  arguments, can it still be used?

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