MaplePrimes Questions

I am solving 3 nonlinear equations for 3 variables: lambda_1, lambda_2, and lambda_3. I would expect these lambdas to be real and positive.

Instead of solving my original equations, which are convoluted and not in polynomial form, I try to solve for their numerators first (since their numerators are polynomials). Broadly speaking, such solutions should also solve the original non-polynomial system. More specifically, the solutions thus obtained may be a nontrivial superset of the solutions of the original system. They need to be verified, which should be a much much easier process than obtaining that superset. In the case at hand, my original system is rational functions, and thus the only thing that really needs to be verified is that the solutions do not make any of the original denominators zero.

1st question: How to actually implement such verification? In other words, how to verify that the polynomial solution that I obtain also solves the original non-polynomial system?

2nd question: As you can see from my attached script, I obtain one polynomial solution. How to analyze it? What can I say about its roots? In case there are an infinite number of roots, how can I pin down a closed-form, real, and positive expression of lambda_1, lambda_2, lambda_3 in terms of the four parameters gamma, p, sigma_e and sigma_v?*

*Please note that in SolveTools:-PolynomialSystem I set backsubstitute=false to favour compactness and computational efficiency (which means that I need to do the backsubstitution myself now - how to do it?).

**Perhaps is useful to know that gamma, sigma_e and sigma_v are all real and positive and that p is a real, positive number between 0 and 1 (it represents a probability).

SCRIPT: 141123_Problem_NoCorrelation.mw

Thanks a lot!

Hi,

I would like to calculate Laplacian(1/r) in spherical coordinates

Considering that 1/r in spherical coordinates defines a distribution function (understood in Laurent Schwartz meaning) , the result has to be -4πDirac(r)

I tried to establish this result on Maple but that doesn't work. The result given is -Dirac(r)/r²  (see below)

What is the mistake I made?

Thanks

with(Physics[Vectors]);

SetCoordinates(spherical[r, phi, theta]);

F := Laplacian(1/r);
                               Dirac(r)
                        F := - --------
                                    r²  

Perhaps a stupid question but I fail to convert 21/4a1/4/pi1/4 (a result of a calculation performed by maple) into (2a/pi)1/4.

I tried simplify, combine, collect, ... with options. None of them work.

Thank you. 

Could you please help me to solve this error.

my code is here.

CR-C.mw

This question is an expansion of my previous reply. 

There exist sixty kinds of statements in Maple, whose major ​​​​portion can be used as an expression or within an expression (e.g., assignment, loop, and condition). But why is use an exception?

Moreover, since it is reasonable to think of use as a (partial) generalization (see below) of the subs function, shouldn't the behaviour of use be consistent with do/if?

Compare: "seq((…;…;…), x in x__0):" (not allowed) vs. "for x in x__0 do …;…;… od:" (allowed); "subs(x = x__0, (…;…;…)):" (not allowed) vs. "use x = x__0 in …;…;… od:" (Not allowed! Why?).)

Edit. Besides that, is there some workaround to do something like

  # If use can be used as an expression or within an expression, 
use x = 2 + y in 'use y = 4 in x + y end' end;
  # should return “use y~ = 4 in (2 + y) + y~ end use;” and 
(use y = 2 + x in x -> x + y end);
  # should output “x~ -> x~ + (2 + x);”. 
  # Unfortunately, I cannot find a workaround to stimulate them.

 at present? Note that the `subs` function is unable to do so, so in my opinion, only when the use of `use` is no longer limited to statements will it become a sweeping generalization of `subs`.

Hi,

The procedure below returns the plots of 3 matrices whose eigenvalues are given and fixed (but chosen randomly). Plots are returned simultaneously via the command display. When I run the procedure 2-3 times, I realize that the drawings are not directly comparable. I have to say that I have naively used the command (three times, i.e. for each plot):

implicitplot("function", -2 .. 2, -2 .. 2, axes = boxed, color = blue, gridrefine = 3, scaling = constrained, resolution = 1000); 

Is there a way to "force" maple to return -- each time I run the procedure -- plots of the same size, same scaling and so on ? I would like also to put names on the axis with consistent writings and fonts. Is it possible ?

Many thanks,

Best,

Rachid

-----

with(plots);
with(LinearAlgebra);
P0 := proc(n, epsilon)
local m, N, D1, Modu, fs, f1, f2, f, q, s, r, t, eps, pp, k;
eps := epsilon;
m := n;
N := eval(RandomMatrix(m, m));
N := N/evalf(Norm(evalf(N), 2));
D1 := DiagonalMatrix(Eigenvalues(N));
pp := pointplot({seq([Re(D1[k, k]), Im(D1[k, k])], k = 1 .. m)});
f := (i, j) -> if i = j then D1[i, i]; elif i = j + 1 then (1 - abs(D1[i, i])^2)^(1/2)*(1 - abs(D1[j, j])^2)^(1/2); elif j + 1 < i then (1 - abs(D1[i, i])^2)^(1/2)*(1 - abs(D1[j, j])^2)^(1/2)*mul(-conjugate(D1[t, t]), t = j + 1 .. i - 1); else 0; end if;
Modu := Matrix(m, (i, j) -> f(i, j)); fs := (x, y) -> Norm(1/((x + y*I)*IdentityMatrix(m) - N), 2) - 1/eps;
f1 := (x, y) -> Norm(1/((x + y*I)*IdentityMatrix(m) - D1), 2) - 1/eps;
f2 := (x, y) -> Norm(1/((x + y*I)*IdentityMatrix(m) - Modu), 2) - 1/eps;
s := implicitplot(fs, -2 .. 2, -2 .. 2, axes = boxed, color = blue, gridrefine = 3, scaling = constrained, resolution = 1000);
q := implicitplot(f1, -2 .. 2, -2 .. 2, axes = boxed, gridrefine = 3, scaling = constrained, resolution = 1000);
r := implicitplot(f2, -2 .. 2, -2 .. 2, axes = boxed, color = green, gridrefine = 3, scaling = constrained, resolution = 1000); RETURN(display({q, s, r, pp}));
end proc;

I make a function 
myf := (a, b, c) -> [a*x^2 + b*x + c = 0, solve(a*x^2 + b*x + c = 0, {x})];

I tried 

myf(1, 2, -3);

and get

[x^2 + 2*x - 3 = 0, {x = 1}, {x = -3}]

With list mylist := [[1, 2, -3], [3, 2, -1]];

How can I map myf  onto mylist?

I tried 

myf := (a, b, c) -> [a*x^2 + b*x + c = 0, solve(a*x^2 + b*x + c = 0, {x})];
mylist := [[1, 2, -3], [3, 2, -1]];
map(myf, mylist);

I can not get the result. 

Apparently max and max[index] don't work with tables.

I'd like to put that on a wish list for future development.

Right now the workaround for the first one would be max(entries(atable)) I think.

Haven't solved max[index] yet.

I was wondering whether the rendering of bars

 

looks also dot like on other computers

Looks like Newtonian notation

When the Fourier transform to the heat equation for example it is useful to represent the Fourier transform of a derivative as the derivative of the transform.  Thus

        FT{d(U(x, t)/dt}  = d(FT{U(t))} / dt,

Where FT => Fourier transform wrt the variable x.

How do I get Maple to obtain the above.

Joe Salacuse

l*`ℏ`*t*sqrt(4*`ℏ`^2*a^2*t^2 + m^2)/(sqrt(2*I*`ℏ`*t*a + m)*sqrt(-2*I*`ℏ`*t*a + m)*m) can be simplified :l *h*t/m

How can I ask Maple to do this.

Given

expr:=  (x^(-(44 + 12*sqrt(69))^(1/3)/6 + 10/(3*(44 + 12*sqrt(69))^(1/3)) + 2/3)) - (x^(sqrt(69)*2^(1/3)*((11 + 3*sqrt(69))^2)^(1/3)/100 - (11*(44 + 12*sqrt(69))^(2/3))/600 - (44 + 12*sqrt(69))^(1/3)/6 + 2/3))

could someone come with a trick to show this is zero using simplification and other methods? I know I can use is and coulditbe but I do not trust these too much due to false positives I've seen from them in some places.

Here is my attempts

restart;


expr:=  (x^(-(44 + 12*sqrt(69))^(1/3)/6 + 10/(3*(44 + 12*sqrt(69))^(1/3)) + 2/3)) - (x^(sqrt(69)*2^(1/3)*((11 + 3*sqrt(69))^2)^(1/3)/100 - (11*(44 + 12*sqrt(69))^(2/3))/600 - (44 + 12*sqrt(69))^(1/3)/6 + 2/3));
simplify(expr);
simplify(expr,size);
simplify(expr,symbolic);
simplify(normal(expr));
simplify(normal(expr),symbolic);
simplify(expr) assuming real;
simplify(expr) assuming positive;
is(expr=0);
coulditbe(expr=0);
evalb(expr=0);

Gives

This is for reference, the Mathematica attempt

long time ago I asked about automatic spacing to improve latex for sqrt. A nice solution was provided in https://www.mapleprimes.com/questions/231062-Adding-Space-After-Sqrt-To-Improve-The-Latex

The above is activatived using spaceaftersqrt = true option for latex:-Settings

There is a similar issue for inert integration where a space is typically added before the final dx This is done similar to the above fix using \, See for example this Latex web site giving many examples.

But there is no option I could see to tell Maple to do this automatically for integration.

So all my inert integrals now look not too good as the dx is too close to the integrand. Here are 2 examples with the settings I am using

restart;

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      usetypesettingcurrentsettings=true,
      linelength=10000      
);

sol:=sqrt(4*y^3-a*y-b)*a;
Intat( subs(y=a,1/sol),a=y(x));
latex(%);

Int(sol,y);
latex(%);

I copied the latex and compiled it, and this is the result

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

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a d y
\]

\end{document}

Which gives

Compare the output when adding \, by hand to the latex

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

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, d y
\]

\end{document}

Which now gives much better result

Actually, what would be nice if the "d" in "dx" was mathrm which becomes

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

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, \mathrm{d} a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, \mathrm{d} y
\]

\end{document}

But may be I am asking for too much here. But having an option to add \, only for inert integration will be good to have.

Does there exist an option to do this that may be I overlooked?

Maple 2023.2

 

I have the function: 2*sin(x)+1/2x-1

I want the x-intercepts, but Maple only provides one answer with fsolve.

plot(2*sin(x)+1/2*x-1)

I am trying to find the integer numbers a, b, c, d, t so that the equation sqrt(a x^2 + b x + c) = d x + t have two integer solutions. My code

First I solve

solve(a*x^2 + b*x + c = (d*x + t)^2, x);

I get

(2*d*t - b + sqrt(4*a*t^2 - 4*b*d*t + 4*c*d^2 - 4*a*c + b^2))/(2*(-d^2 + a)), -(-2*d*t + sqrt(4*a*t^2 - 4*b*d*t + 4*c*d^2 - 4*a*c + b^2) + b)/(2*(-d^2 + a))

And then, I solve
restart;
n := 0;
for a to 10 do
for b to 10 do
for c to 10 do
for d to 10 do
for t to 10 do
mydelta := 4*a*t^2 - 4*b*d*t + 4*c*d^2 - 4*a*c + b^2;
if 0 < mydelta and type(mydelta, integer) then
x1 := (2*d*t - b + sqrt(4*a*t^2 - 4*b*d*t + 4*c*d^2 - 4*a*c + b^2))/(2*(-d^2 + a));
x2 := -(-2*d*t + sqrt(4*a*t^2 - 4*b*d*t + 4*c*d^2 - 4*a*c + b^2) + b)/(2*(-d^2 + a));
if 0 < d*x1 + t and 0 < d*x2 + t and type(x1, integer) and type(x2, integer) and nops({a, b, c, d, t}) = 5 and c <> t^2 and -d^2 + a <> 0 and nops({x1, x2}) = 2 then n := n + 1; L[n] := [a, b, c, d, t]; end if; end if; end do; end do; end do; end do;
end do;
L := convert(L, list);
nops(L);

I don't get any solutions. But, when I  solve(sqrt(2*x^2 + 3*x + 5) = x + 9, x); I get two solutions 19, -4.
Where is wrong in my code?
 

First 94 95 96 97 98 99 100 Last Page 96 of 2368