## Is there a different way to find the conic...

Asked by:

This a more a math question than  a maple programming question. But interesting.

I have a point P=[x,y] on a line y= 2+3x. The point maps to Pn=[f(x, y), g(x, y)]. That represents a conic.

I want to find the equation of the conic. I did it by calculating 5 points and that works fine but only because I know I'm looking for a conic.

Can the problem by solved without having to get the five points?
I copied and pasted the equations for the lines because they were generated by commands in a pagkage I have.

 n

Download Q_23-03-04_how_to_find_conic_from_mapping.mw

## Maple continuously shows 'Evaluating'...

Asked by:

Maple continuously shows 'Evaluating' and there is no output. How to fix it?

 >
 >
 >
 >
 (1)
 >
 (2)
 >
 >
 (3)
 >
 >

Download sol1det.mw

## why so many "kernel connection has been lost" in M...

Asked by:

I get about 3-4 of these each day when I run my long script. Maple 2022.2 on windows 10

They happen much more for me in Maple 2022 than before. I am on windows 10 pro with 128 GB ram, new PC, very fast PC.

googling, I see others having same problem.

https://www.reddit.com/r/maplesoft/comments/uixics/frequent_kernel_connection_has_been_lost_on_maple/

"Ever since I upgraded to Maple 2022, relatively intensive symbolic calculations and plots frequently kill the kernel and throw the error message “Kernel Connection has been lost”. This never happened on Maple 2021."

It happens for me whenever I run something that takes long time and it is always random when and where it happens.

This is really disappointing as one expects software quality of a product to improve over time but for me, I find Maple's becoming less robust and its quality becoming worst not better.  This is too bad, because Maple is a good language and I like programming in it, but it is the software build quality of the overall software which needs to be improved.

I see many hangs also where I have to kill mserver.exe may be 10 times a day just to get the script to complete. (this is besides this kernel lost connection problem). Those also happen at random places in the script. Restarting the script from same place, it runs OK now.

Is there something one can do to find why this lost connection happens?  Crash dump somewhere? Log file somewhere?

I do not have firewall. I use default windows 10 settings for security. Do not have any other special anti-virus software.  No other app I use on this PC crash like this. It is only Maple.

## Automatically combining indexed plots...

Asked by:

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.

## How to export the result into SVG file...

Asked by:

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)

## Is this a bug of printf?...

Asked by:
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?

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

## latex problem after latest update to Physics packa...

Asked by:

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)

 > Physics:-Version()

 > 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)

 > ode:=(-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

## Solve numerical PDE...

Asked by:

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

## Simplifying Units...

Asked by:

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?

## is this a bug? dsolve gives Error, (in dsolve) inv...

Asked by:
 > interface(version);

 > 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));

Error, (in dsolve) invalid subscript selector

 >

Download error_jan_27_2023.mw

## How do I create the groups (Z/nZ)+ and (Z/nZ)*?...

Asked by:

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.

## How to write functions with parameters that act on...

Asked by:

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?

## How do i perform optimization on a function that c...

Asked by:

I am trying to call an optimization function for a set of operations where the object function contains integrals. i get this error when i try to do the optimization, i actually want to optimize a cost function, this is the error i get: Error, (in Optimization:-NLPSolve) integration range or variable must be specified in the second argument, got 1. = 4 .. 7

here is my work:

a2 := 18;
b2 := 5;
a1 := 3;
b1 := 2.5;
ci := 0.05;
cr := 1;
cf := 10;
p := 0.1;
L := 0.5;
S := 3;
T := 10;
cud := 50;
co := 0.02;
tr := 0.006;
ti := 0.0014;
tf := 0.014;
K := 2;
A := 2;
M := 7;
f01 := x -> b1*(x/a1)^(b1 - 1)*exp(-(x/a1)^b1)/a1;
f02 := x -> b2*(x/a2)^(b2 - 1)*exp(-(x/a2)^b2)/a2;
fx := x -> p*f01(x) + (1 - p)*f02(x);
fh := h -> L*exp(-L*h);
Fh := h -> 1 - exp(-L*h);

P1_1 := (K, A, M) -> sum(int(fx(x)*(1 - Fh(i*A - x)), x = (i - 1)*A .. i*A), i = 1 .. K);
L1_1 := (K, A, M) -> sum((i*A + tr + i*ti)*P1_1(K, A, M), i = 1 .. K);
C1_1 := (K, A, M) -> sum((ci*i + cr)*P1_1(K, A, M), i = 1 .. K);
NULL;
P2_1 := (K, A, M) -> sum(int(fh(h)*fx(x), [h = 0 .. i*A - x, x = (i - 1)*A .. i*A]), i = 1 .. K);
L2_1 := (K, A, M) -> sum((tf + (i - 1)*ti)*int((x + h)*fh(h)*fx(x), [h = 0 .. i*A - x, x = (i - 1)*A .. i*A]), i = 1 .. K);
C2_1 := (K, A, M) -> sum(((i - 1)*ci + cf)*P2_1(K, A, M), i = 1 .. K);
P3_1 := (K, A, M) -> int(fh(h)*fx(x), [h = 0 .. M - x, x = A*K .. M]);
L3_1 := (K, A, M) -> (K*ti + tf)*int((x + h)*fh(h)*fx(x), [h = 0 .. M - x, x = A*K .. M]);
C3_1 := (K, A, M) -> (K*ci + cf)*P3_1(K, A, M);
P4_1 := (K, A, M) -> int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
L4_1 := (K, A, M) -> (K*ti + tr + M)*int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
C4_1 := (K, A, M) -> (K*ci + cr)*int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
P5_1 := (K, A, M) -> int(fx(x), x = M .. infinity);
L5_1 := (K, A, M) -> (K*ti + tr + M)*int(fx(x), x = M .. infinity);
C5_1 := (K, A, M) -> (K*ci + cr)*int(fx(x), x = M .. infinity);
Ptotal_1 := (K, A, M) -> P1_1(K, A, M) + P2_1(K, A, M) + P3_1(K, A, M) + P4_1(K, A, M) + P5_1(K, A, M);
Ptotal_1(K, A, M);
evalf(Ptotal_1(K, A, M));
Ltotal_1 := (K, A, M) -> L1_1(K, A, M) + L2_1(K, A, M) + L3_1(K, A, M) + L4_1(K, A, M) + L5_1(K, A, M);
evalf(Ltotal_1(K, A, M));
Ctotal_1 := (K, A, M) -> C1_1(K, A, M) + C2_1(K, A, M) + C3_1(K, A, M) + C4_1(K, A, M) + C5_1(K, A, M);
Cost_rate_1 := (K, A, M) -> Ctotal_1(K, A, M)/Ltotal_1(K, A, M);
integralOF := int(Cost_rate_1(K, A, M), x = 1 .. 2);
evalf(integralOF);
0.2759938793

MTBOF := Ltotal_1(K, A, M)/(P2_1(K, A, M) + P3_1(K, A, M));
evalf(MTBOF);
159.4642167

rd := 1/MTBOF;
ro := 1/M + rd;
const1 := 0 <= K;
const2 := K*A <= M;
const3 := M <= 20;
const4 := 0 <= A;
const5 := 0 <= M;
totalconstr := {const1, const2, const3, const4, const5};

optimized_cost := Optimization:-Minimize(integralOF, totalconstr);
Error, (in Optimization:-NLPSolve) integration range or variable must be specified in the second argument, got 1. = 4 .. 7
NULL;

please, i need assitance urgently.. thanks

## Plot Problem - What is happening at f(0)/...

Asked by:

What is happening at f(0)?

Look at PlotProblem.mw

## Writing an explanatory paragrah I want to use an a...

Asked by:

Writing an explanatory paragrah i want to use an approximately equal symbol. How can I do this? The palette has lots of symbols but not what in latex would be done with \approx

 1 2 3 4 5 6 7 Last Page 1 of 22
﻿