Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

How can I change the order of variables in a polynomial as I want? For example, I want to assign a polynomial G of 3 variables a,b,c. Then I want to compute G(a,b,c) (exchange the variable a to b, exchange variable b to a)?

Hello everybody

I would like to check, with Spacetime Tensors computation , if  a transfomation is a Lorentz transformation , i.e that leavs Minkosky metric invariant 

For esample a boost  or axis rotation transformation

Some could help me ? ( Maple 2016)

Thank's a lot

I've probably asked about this long time ago but I do not remember now. But it is still a problem any way in 2022.2

Compare these two results

code is

 

restart;

alias(seq(c[k] = _C||k, k = 0..10));
c[1]*h(x);
Int(c[1]*h(x),x);


restart;
c[1]*h(x);
Int(c[1]*h(x),x);

I tried with typesetting level as extended and standard and same result.

Is this a know issue? It is not a big deal as it only affects display but it will be nice to find why it happens when using alias.

 

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.

restart

NULL

NULL

P := [X, Y]

[X, Y]

``

NULL

Pn := [(5*X+12*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y), (2*(12*X-5*Y))*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y)]

[(5*X+12*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y), 2*(12*X-5*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y)]

NULL

``

Y := 2+3*Xn

2+3*X

``

for i to 5 do P || i := eval(Pn, X = i) end do

[181139/51416, -19775/25708]

NULL

l12 := 153621*x*(1/68840)+169429*y*(1/27536)-15067/17210

(153621/68840)*x+(169429/27536)*y-15067/17210

NULL

l34 := -5733*x*(1/473062)+258973*y*(1/946124)+244205/946124

-(5733/473062)*x+(258973/946124)*y+244205/946124

c1 := l12*l34

((153621/68840)*x+(169429/27536)*y-15067/17210)*(-(5733/473062)*x+(258973/946124)*y+244205/946124)

NULL

l13 := 5499*x*(1/2360)+6539*y*(1/944)-793/472

(5499/2360)*x+(6539/944)*y-793/472

l24 := 596115*x*(1/6899489)+7228091*y*(1/6899489)+195364/363131

(596115/6899489)*x+(7228091/6899489)*y+195364/363131

plots:-implicitplot([l12, l34, l13, l24])

c2 := l13*l24

((5499/2360)*x+(6539/944)*y-793/472)*((596115/6899489)*x+(7228091/6899489)*y+195364/363131)

c := simplify(c2*lambda+c1)

(655607277/3256558808)*(x+(2515/846)*y-305/423)*(x+(556007/45855)*y+285532/45855)*lambda-(880709193/32565588080)*(x-(19921/882)*y-18785/882)*(x+(65165/23634)*y-4636/11817)

lambda := solve(eval(c, [x = P5[1], y = P5[2]]), lambda)

-1/4

simplify(c)

-(5039454771/65131176160)*x^2+(1/130262352320)*(-29130506847*y+40315638168)*x-(423368829/3256558808)*y^2+(111619143207/130262352320)*y

plt1 := plot(Y, X = -10 .. 10)

NULL

NULL

plt2 := plots:-implicitplot([c])

plots:-display(plt1, plt2, colour = ["Red", "Green"])

NULL

for i in [-7, 13/3, 42*(1/7)] do x := eval(Pn[1], X = i); y := eval(Pn[2], X = i); simplify(c) end do

0

NULL

Download Q_23-03-04_how_to_find_conic_from_mapping.mw

Dears,
I have a problem whem try to solve a optimization probolem.
The equations are "complex" (G1 equation), and this error is showed "Error, (in Optimization:-NLPSolve) could not store 0.1749271137e-1*(588.000000000000+72.0000000000000*(-3.03333333+.333333333333333*MM)*(MM-17.80)+72.0000000000000*(.333333333333333*NN-3.5666666666667)*(17.00-1.*NN)+24.50000000*(2.90+4.666666667*tan(1.000000000*arctan(.166666666666667*MM-2.96666666666667)))*(18.00+5.627472876000*sin(-1.570796327+1.000000000*arctan(.166666666666667*MM-2.96666666666667))/sin(-1.745329252+1.000000000*arctan(.166666666666667*MM-2.96666666666667)))*cos(-.5235987756000+1.000000000*arctan(.166666666666667*MM-2.96666666666667))^2*sin(.3490658504000+1.000000000*arctan(.166666666666667*MM-2.9666 ... 756000+1.000000000*arctan(.166666666666667*MM-2.96666666666667))^2)-1. in a floating-point rtable".
Someone can help me?

ATS := proc(NN::float, MM::float) 
L[7]*H[4] + L[4]*H[2] + L[1]*(H[1] - H[2]) + 1/2*(P[X1] - NN)*(H[1] - H[2]) + 1/2*(MM - P[XF])*(H[1] - H[2]); 
end proc;
bounds := 14.90 .. 16.90, 17.90 .. 19.90;
cstr8 := proc(NN::float, MM::float) 
G1 - FS; 
end proc;

NLPSolve(ATS, {cstr8}, bounds, initialpoint = [15.90, 18.90], assume = nonnegative)

Hi MaplePrimes, 

I am interested in obtaining some gravitational field equations from an action using the FunDiff command. I have been able to write what I think is a pretty short and quick worksheet(with an arbitrary metric) and I am easily able to obtain the Einstein Field Equations. However, when I introduce some new more complicated terms into the action and apply the Simplify command maple does not appear to be able to evaluate and I end up halting the computation. When I specify a metric Maple, for example Schwarzschild, Maple will easily be able to Simplify my expression but it will use metric components during the process. Where what I am interested in is just the Tensor expression with respective indices. 

I was wondering if anyone had any thoughts on how I could resolve this. 

I have attached the worksheet that I am working with. I look forward to your thoughts/comments.

Thank you.  

ActionFieldEquations.mw

If we use, for example, pointplot3d with an mx3 matrix we get a 3d plot. I can click on the plot and choose the lighting. But how do we do that with code?

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

restart

with(LinearAlgebra)

assume(x::real); assume(t::real); assume(`α__1`::real); assume(`α__2`::real); assume(nu::real)

A2s := Matrix([[H__11*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__13*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`))+1, H__12*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__14*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__11*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__13*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__12*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__14*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__12*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__14*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), 1+H__11*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__13*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__12*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__14*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__11*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__13*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__13*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__33*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__14*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__34*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), 1+H__13*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__33*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__14*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__34*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__14*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__34*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__13*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__33*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__14*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__34*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__13*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__33*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))+1]])

Matrix(%id = 36893490803012390908)

(1)

vvalue := {v__11 = (conjugate(`λ__1`)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*`α__1`*(conjugate(`λ__1`)^3-`λ__1`^3)+2*`α__2`*(conjugate(`λ__1`)^2-`λ__1`^2)-8*nu*(conjugate(`λ__1`)^4-`λ__1`^4))*t, v__12 = (conjugate(`λ__1`)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*`α__1`*(conjugate(`λ__1`)^3-`λ__2`^3)+2*`α__2`*(conjugate(`λ__1`)^2-`λ__2`^2)-8*nu*(conjugate(`λ__1`)^4-`λ__2`^4))*t, v__21 = (conjugate(`λ__2`)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*`α__1`*(conjugate(`λ__2`)^3-`λ__1`^3)+2*`α__2`*(conjugate(`λ__2`)^2-`λ__1`^2)-8*nu*(conjugate(`λ__2`)^4-`λ__1`^4))*t, v__22 = (conjugate(`λ__2`)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*`α__1`*(conjugate(`λ__2`)^3-`λ__2`^3)+2*`α__2`*(conjugate(`λ__2`)^2-`λ__2`^2)-8*nu*(conjugate(`λ__2`)^4-`λ__2`^4))*t}

{v__11 = (conjugate(lambda__1)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*alpha__1*(conjugate(lambda__1)^3-lambda__1^3)+2*alpha__2*(conjugate(lambda__1)^2-lambda__1^2)-8*nu*(conjugate(lambda__1)^4-lambda__1^4))*t, v__12 = (conjugate(lambda__1)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*alpha__1*(conjugate(lambda__1)^3-lambda__2^3)+2*alpha__2*(conjugate(lambda__1)^2-lambda__2^2)-8*nu*(conjugate(lambda__1)^4-lambda__2^4))*t, v__21 = (conjugate(lambda__2)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*alpha__1*(conjugate(lambda__2)^3-lambda__1^3)+2*alpha__2*(conjugate(lambda__2)^2-lambda__1^2)-8*nu*(conjugate(lambda__2)^4-lambda__1^4))*t, v__22 = (conjugate(lambda__2)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*alpha__1*(conjugate(lambda__2)^3-lambda__2^3)+2*alpha__2*(conjugate(lambda__2)^2-lambda__2^2)-8*nu*(conjugate(lambda__2)^4-lambda__2^4))*t}

(2)

NULL

A2s2 := Determinant(A2s); dets22 := simplify(A2s2, size); length(%)

8949

(3)

dets22f := simplify(subs(vvalue, dets22))

NULL

Download sol1det.mw

Hello. I work with vector fields and 1-forms with the package DifferentialGeometry. I need to copy the output in a latex file, but when I use copy paste what I get is the internal representation of the 1-forms, for example, something like

_DG([[\"form\", M, 1], [[[1], x2/x4], [[2], -1]]])

But what I need is something like:

x2/x4 dx1-(`*`(dx2))

which is what I see at the screen. I have tried lot of commands but I don't get what I want.

Here is the basic code:

restart;

with(DifferentialGeometry);

with(JetCalculus);

DGsetup([x1, x2, x3], M);

w:=evalDG(x2/x4 dx1-dx2)

I'm using Maple 2022.  I'm using fsolve to solve for values of 3 variables and I've created a function that looks like 

solution := (TtT, FtT) -> fsolve({eq1, eq2, eq3},{Y,P,PY},{Y=0..100,P=0..100,PY=0..100})

this works fine, giving answers like

solution(1, 0.5);
    {P = 0.1813175442, PY = 0.1593412279, Y = 0.4393982627}

I'd like to plot Y vs TtT at a fixed FtT of 0.5 so I defined a second function

YFtpt5 := TtT -> solution(TtT, 0.5)[3]

this also works fine, giving

YFtpt5(10);
                       Y = 0.02320766980

so I try to plot it with a range variable like this

with plots:

plot(YFtpt5,0.01..10)

but this gives the error 

plot(YFtpt5, 0.01 .. 10);
Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

It draws axis but no plot.  I've evaluated the function at 0.01,10, and a number of points in between and everything I've tried gives a numeric answer.  Is it because the answer is "Y=0.43"  or something else.  

Help, have no idea what to do.

Obtain a finite topological space from a dynamical system specified as a system of ODEs, by writing Maple code for following steps (use Maple packages DynamicSytems and GraphTheory, preferablly):

  1. Visualize the phase space of the system by plotting solution curves for different initial conditions.

  2. Consider a finite region of the phase space.

  3. Define a finite grid of points in the region.

  4. Define a topology on the grid points based on their connectivity.

  5. Give some useful information regarding the dynamical system in terms of topological properties.

Article https://mapleprimes.com/posts/208409-Downloading-Historical-Stock-Quotes has worked well for the last few years.

Somewhere in the last 6 months Yahoo has changed the method. Crumbstore no longer exists within the page source.

Does anyone have a method that currently works.

Problem is also verified at: https://www.solveforum.com/forums/threads/solved-yahoo-finance-cookie-and-crumb-not-working.2316600/ ,however they do not have a solution.

I want an example worksheet to open as a worksheet rather than a help page when I'm building help pages for a package. For instance, opening a worksheet instead of a help page is the result of clicking the "Package Overview help page template" hyperlink on the "Templates" help page. The mouseover of the hyperlink suggests it was saved as a help page rather than a worksheet, most likely in a help database. Although I can see the active=true option in INTERFACE HELP, I'm not sure how to convert my spreadsheet to this format without losing the formatting styles. It would make sense to have an option under "save to database" or an active=true option for makehelp, but these do not appear to exist. Any recommendations? Thanks, David.

Dear all,

consider two lists of complex values :

list1 := [l1,l2,l3,l4,l5]

list2 := [s1,s2,s3,s4,s5].

There is a set of second order differential equation

d^2u(k)/dt^2+I*A*du/dt-B*u=0

where A is sum of elements of list1 and list2 and B is multiplication of their element. Therefore,

d^2u[1](k)/dt^2+I*(l1+s1)*du[1]/dt-(l1*s1)*u[1]=0

d^2u[2](k)/dt^2+I*(l2+s2)*du[2]/dt-(l2*s2)*u[2]=0

d^2u[3](k)/dt^2+I*(l3+s3)*du[3]/dt-(l3*s3)*u[3]=0

d^2u[4](k)/dt^2+I*(l4+s4)*du[4]/dt-(l4*s4)*u[4]=0

d^2u[5](k)/dt^2+I*(l5+s5)*du[5]/dt-(l5*s5)*u[5]=0

How can I create a set of differential equations and initial conditions based on nops(list1), then solve this system of differential equations numerically in Maple.

since u[i] are function of k, next step is to transforme them to real space by inverse fourier transform.

finally save the results and plot them.

Note that for simplisity I wrote a linear equation but it is not. so, because of nonlinear terms it is not possible to use superposition of the solution. I have to take them as coupled system of equations.

====

for example

list1 := [ [0., -5.496799068*10^(-15)-0.*I], [.1, 5.201897725*10^(-16)-1.188994754*I], [.2, 6.924043163*10^(-17)-4.747763855*I], [.3, 2.297497722*10^(-17)-10.66272177*I], [.4, 1.159126178*10^(-17)-18.96299588*I] ] 

list2 :=[ [0., -8.634351786*10^(-7)-67.81404036*I], [.1, -0.7387644021e-5-67.76491234*I], [.2, -0.1433025271e-4-67.59922295*I], [.3, -0.2231598645e-4-67.25152449*I], [.4, -0.3280855430e-4-66.56357035*I] ]

where first element is k and the second value is l_i and s_i

the differential equation is

ode_u[i]:= diff(u[i](t),t$2)+I*(list1[i][2]+list2[i][2])*diff(u[i](t),t)-list1[1][2]*list2[2][2]*u[i](t)=0;

eta is in fourier space where k values are in list1[i][1].

We laso know that f(-k)= - f*(k) where f=list[i][2]

and u[i] as function of k, initially has a Gaussian shape at t=0 in fourier space..

Thanks in advance for your help

Anyone out there converted the  nyqlog at MATLAB/nyqlog.m at master · nielsSkov/MATLAB · GitHub  to Maple or Maple Flow? For Nyquist plots...

First 114 115 116 117 118 119 120 Last Page 116 of 2097