MaplePrimes Questions

As a new user to Maple, I'm having trouble with something that should be simple - obtaining an algebraic simultaneous solution for two variables from two simple algebraic equations:

K1= N*(R9 + R6) + R9 / (R9 + R6)*N^2 + (2*R6 + 2*R9)*N + R9
K2= N*(R6 + R9) / (R6 + R9)*N^2 + (2*R6 + 2*R9)*N + R9

K1, K2 and N are known and I want to find the solutions for R6 and R9.  I know I could work this out by hand, but by learning how to use Maple to do this simple example would allow me to solve other, more complex, problems.

Thanks,

John

y := t -> 0.7*sin(300*t);
filenm := "https://www.gw-openscience.org/GW150914data/P150914/fig2-unfiltered-template-reconstruction-H.txt";
K := ImportMatrix(filenm, source = Matlab, skiplines = 1);
plot([K[() .. (), [1, 3]], y(t)], t = 0.35 .. 0.4);

I want to plot the residuals for this. Any ideas how? Thanks.

It seem like there is an (unwanted) difference between the latex() command and the newly introduced "Copy as LaTeX" in handling of \left and \right delimiters. A trivial example

>latex(sin(b/a));
\sin \! \left(\frac{b}{a}\right)

but if I instead use the new "Copy as LaTeX" command I get the result

\sin(\frac{b}{a})

These should of course be the same and I consider the first one to be the better conversion. It seems a very strange problem since it surely must be the same library routine that does the conversion in both cases? From a small set of examples I tried on it seem that the "Copy as .."  command never uses \left and \right which in several cases is absolutely necessary to get acceptable result.

 

I run Maple on two different computers each with 2 4k monitors running Windows 10 Pro.  Everything appears to work fine on one computer but on the other one, the display gets corrupted when moving the mouse under certain conditions.  I have eliminated the mouse and the video card as the problem because the same problem occurs after replacing them with other manufacturers components.  I have a document that generates a few plots that I can run from both computers.  At first all seems fine and the mouse can be moved across the display and plots without corruption.  But as soon as I try to enable any "Probe Info" via right clicking a plot or from the side pane when the plot is selected, moving the mouse over the plot will cause a continuous corruption that continuous to change as I move the mouse.  The only way I have found to recover from this is to close Maple and resart it.

It appears the problem has to do with redrawing the display after the mouse moves.  Below is an example:

Has anyone experienced this?

Thank you, David

 

test_19_marts.mw

Hey

Can anyone help me with this file?

I don't know how it happend, but the file somehow got corrupted. Is there anything i can do?

Thanks 

The background of my question comes from graph theory. But the essence of the problem has nothing to do with graph theory, and it only involves programming.

For the graph g1 below, the paired crossing edges  are marked as wine red.

with(GraphTheory):
with(SpecialGraphs):
g:=CompleteGraph(6);
g1:=DeleteEdge(g, {3,2}, inplace = false);

Paircrossedges:=[[{1,6},{3,5}],[{2,5},{1,4}],[{2,6},{3,4}]];

For each pair of crossed edges, I choose one to delete and get a plane graph g1', and then I consider the edge connectivity of g1', if the edge connectivity is equal 3, stop the calculation and return to the deleted edge set, otherwise continue to look for.

The following code is my attempt, break does not seem to work.

Conremovedges:= proc(G::Graph,Paircrossedges)
local i,j,k,dedges;
for i from 1 to 2 do
   for j from 1 to 2 do
     for k from 1 to 2 do
dedges:={Paircrossedges[1][i],Paircrossedges[2][j],Paircrossedges[3][k]};
              if EdgeConnectivity(DeleteEdge(G, dedges, inplace = false))=3 then
print(dedges);
break;
end if;
end do:
end do: 
end do:
end proc:
Conremovedges(g1,Paircrossedges)

 

My idea is that as long as the edge set that meets the condition appears for the first time, it should stop. If none are satisfied, return "not found".

Another question:

The above is just my example. In fact, the graph I want to consider is more complicated. If there are 18 pairs of crossing edges, do I need to write 18th-order for-loops? This seems very troublesome. Is there an easier way? Maximum number of for loops is 2^18 that is equal to 262144, which is still acceptable.

Conremovedges:= proc(G::Graph,Paircrossedges)
local a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,dedges;

for a1 from 1 to 2 do
for a2 from 1 to 2 do
for a3 from 1 to 2 do
for a4 from 1 to 2 do
for a5 from 1 to 2 do
for a6 from 1 to 2 do
for a7 from 1 to 2 do
for a8 from 1 to 2 do

for a9 from 1 to 2 do
for a10 from 1 to 2 do
for a11 from 1 to 2 do
for a12 from 1 to 2 do
for a13 from 1 to 2 do
for a14 from 1 to 2 do
for a15 from 1 to 2 do
for a16 from 1 to 2 do
for a17 from 1 to 2 do
for a18 from 1 to 2 do

dedges:={
Paircrossedges[1][a1],Paircrossedges[2][a2],Paircrossedges[3][a3],
Paircrossedges[4][a4],Paircrossedges[5][a5],Paircrossedges[6][a6],
Paircrossedges[7][a7],Paircrossedges[8][a8],Paircrossedges[9][a9],
Paircrossedges[10][a10],Paircrossedges[11][a11],Paircrossedges[12][a12],
Paircrossedges[13][a13],Paircrossedges[14][a14],Paircrossedges[15][a15],
Paircrossedges[16][a16],Paircrossedges[17][a17],Paircrossedges[18][a18]};
              if EdgeConnectivity(DeleteEdge(G, dedges, inplace = false))=3 then
print(dedges);
break;
end if;
end do:
end do: 
end do:
end do:
end do:
end do: 
end do:
end do:
end do:
end do: 
end do:
end do:
end do:
end do: 
end do:
end do:
end do:
end do: 
end proc:

 

 

 

 

 

In Maple, when calling LinearAlgebra:-Eigenvectors the order can change randomally each time. Ofcourse the result is always correct, but can show up in different order. 

I find this confusing, as I am looking at the screen, and see order changed each time. This is the order of how Maple shows the eigenvalues and corresponding eigenvectors.

Why does Maple do this? Is there a way to have same order given each time? Here is an example. If you run this code twice, most likely you will get different order each time. If not, try the command one more time.

restart;
Sy:=1/sqrt(2)*Matrix([[0,-I,0],[I,0,-I],[0,I,0]]);
lambda, v :=LinearAlgebra:-Eigenvectors(Sy);

screen shot

I thought there might be a global option to tell Maple not to do this? 

Again, answer is correct each time. I just like same output to show each time, as it is less confusing. Sometimes I think I did something wrong when I see different output show up for same command.

 

 

sometimes I get expressions with sqrt(n)/n in them where n is positive integer. I'd like Maple to simplify this to 1/sqrt(n).

So sqrt(2)/2 will becomes 1/sqrt(2). I find this simpler.

Here is an example

v:=Vector([1/2, -1/2*sqrt(2), 1/2]);
simplify(v);
simplify(size);
simplify(v,sqrt);
simplify(v,power);

and tried few other things. 

is there a trick to do this? This is the case where all the expression have actual numerical integers in them (not symbolic), just like the above example. These come from numerical examples. 

 

Before I put in a change request to make LinearAlgebra:-Equal the "is" of matrix/vector options, I wonder is there something else I should be doing. 

LinearAlgebra_Equal.mw

He intentado utilizar el comando "SolveSteps" y no he podido lograr que se muestre los pasos de la solución, incluso copié el siguiente comando que aparece en la ayuda: SolveSteps([12*x + y = 18, 7*x - 8*y = 32]), donde aparecen una serie de pasos antes de llegar a la respuesta final, pero al escribirlo en la "hoja de trabajo", no me aparece el desarrollo del ejercicio, sino que el mismo comando y la ecuación que escribí. Acaso debo de instalar los comandos, será que no vienen predeterminados, o será porque tengo una versión temporal de 15 días, que no permite utilizar dichos comandos?

Gracias por su ayuda.

Hello MaplePrimes, 

So, I have used the discont=true option in the past and it has worked fine for me but for some reason with these functions I am using now the plots are still containing the veritcal asymptotes. Anyone spot something I am forgetting or doing incorrectly?

I have attached my maple file for easy viewing. 

Thanks. 

DiscontQuestion.mw

 

Hello,

How i use maple to get the formal solution of this non autonomous system :

dsys := {diff(x(t), t) = (a*p*S/h + (-o - u))*x(t) + f(t)*p*S*y(t)/h, diff(y(t), t) = a*(1 - p)*S*x(t)/h + (f(t)*(1 - p)*S/h - b)*y(t)}

I tried dsolve(dsys) but maple consider the set of solution with x(t) y(t) and f(t), but f(t) is a parameter of the system. I search a solution for x(t) and y(t).

Thank you

I easily found the roots of the following equations,

s:=solve(x^3+x^2-2*x-1,x)

I accidentally discovered that  2*cos((2*Pi)/7) is also the root of this equation. 

simplify(eval(x^3+x^2-2*x-1,x=2*cos((2*Pi)/7)))

0

It’s easy to know that 2*cos((2*Pi)/7) is equivalent to the third root found above

s1:=fsolve(x^3+x^2-2*x-1,x);
2*cos((2*Pi)/7.)

         s := -1.801937736, -0.4450418679, 1.246979604

                          1.246979604

 

Maybe I don’t like the use of imaginary units, and I prefer  2*cos((2*Pi)/7) .

In the case that I don’t know that  2*cos((2*Pi)/7) is the solution of the equation, can I make a certain transformation without using the imaginary unit to represent the real number. For example, trigonometric functions, exponential functions, etc.

I tried to use the following functions, all failed.

s:=solve(x^3+x^2-2*x-1,x);
convert(s[3],cos);
identify(s[3])

 

What is interesting is the following phenomenon. Even if Zeta function does not look great:

s1:=fsolve(x^3+x^2-2*x-1,x):
identify(s1[3])

 

 

For this example, can all roots be transformed into trigonometric expressions by maple.

 

 

Can someone please tell me why is my output not ''-cos(x) '' but this:

And how can I set up the worksheet to give me the outputs I want?

Few months ago, someone was kind enough to send me an email letting me know that in Maple 2021 the following new change will be in Object

I am attending a workshop on OOP.  In Maple 2021, one will be able 
to invoke a method of an instance of an object with the  syntax:  object_name:-method_name

However, I am not able to get the above to work in Maple 2021. And I looked at the help pages and see no such example. This is what I tried

restart;
module person()
    option object;
    local name := "me";   

    export get_name::static := proc( self::person, $ )
        self:-name;
    end;

    export set_name::static := proc( self::person, name, $ )
        self:-name:=name;
    end;

end:

p:=Object( person ); #create object

p:-get_name();

Error, invalid input: person:-get_name uses a 1st argument, self (of type person), which is missing

What changes are needed in the above code to be able to use  obj:-method()  syntax?

Or is it possible that this change did not go into Maple 2021?


 

First 306 307 308 309 310 311 312 Last Page 308 of 2308