MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

How do i use d'Alembert formula to solve,plot and animate with Maple software

Hi!

I seem to run into problems with (quantum) perturbation theory. In the following minimal working example, an energy denominator, as occuring in perturbation theory is not evaluated if I previously assume that the quantum number is a positive integer. It's supposed to return an error, as the energy denominator is 0.

restart; with(Physics)

a := Annihilation(N, 1, notation = explicit):

psi := Ket(N, m);

Physics:-Ket(N, m)

(1)

E := proc (g) options operator, arrow; (1/2)*g*(g-1)-mu*g end proc:

simplify(value(Typesetting:-delayDotProduct(Typesetting:-delayDotProduct(Dagger(psi), 1/(E(m)-H)), psi)))

-I/(Im(m)*(2*Re(m)-1-2*mu))

(2)

assume(`in`(m, nonnegint), m > 0);

simplify(value(Typesetting:-delayDotProduct(Typesetting:-delayDotProduct(Dagger(psi), 1/(E(m)-H)), psi)))

-2*Physics:-Bracket(Physics:-Bra(N, m), 1/(-2*mu*Physics:-`*`(`a-`[N[1]], `a+`[N[1]])+2*mu*m-m^2+Physics:-`*`(Physics:-`^`(`a-`[N[1]], 2), Physics:-`^`(`a+`[N[1]], 2))-4*Physics:-`*`(`a-`[N[1]], `a+`[N[1]])+2*mu+m+2), Physics:-Ket(N, m))

(3)

Parse:-ConvertTo1D, "invalid input %1", `.`(Dagger(psi), 1/(E-H), psi)

2/(2*mu*m-m^2+2*E+m)

(4)

``

Download energy_denominator.mw

 

Best regards,

Sören

how to calculate the cobordism between two ideals

Hi,

I was helping for a computing session today.

Maple 17 and 18 were not plotting the following:

 

restart:

with(plots):
spacecurve([x,cos(x), sin(x)], x = 0..10);

On some of the machines, with campus site license, windows 7, x64.

The plot came up with a "frame" only. And nothing was plotted.

We really can't figure out why?

Something to do with the settings(options)?

 

Had anyone had a similar experience?

 

Thanks,

 

casper

Find a series solution of the differental equation

y'=2*x*y

 

do graph have invariant for invariant of cayley graph

for example, how to convert below word relation into graph

a^2 = 1

a*b = b*a

my code can only do for one variable, 

how to make divisible checking for multivariable cases with the ordering such as plex

 

IsDivisible(LP(h, t), LP(g[i], t), x)

it is not only x when multivariable

 

f:=LP(y^2*x,plex(x, y))[2];
g:=LP(y*x-y,plex(x, y))[2];
Remainder(f, g, gcd(f,g));
degree(Remainder(f, g, x),x);
degree(g, x);

remainder has error expect its 3rd argument x, to be of type or but received y*x

how to do if have ordering

do it need to check whether both f and g have variable x using indets and then apply remainder?

do it need to check each variable starting from the first variable in the ordering? 

how about if f has variable x but g do not have variable x, or f do not have variable x and g have variable x

 

if so, i try to replace below code in the bottom code, it has error

Error, (in FindDivisble) cannot determine if this expression is true or false: 0 < Search(x, {x, y})

FindDivisble := proc(g, h, t)
with(ListTools):
result := 0;
for i from 1 to nops(g) do
mainvariable := 0;
for j from 1 to nops(t) do
mainvariable := op(j, t);
if mainvariable <> 0 then
if Search(mainvariable, indets(h)) > 0 and Search(mainvariable, indets(g[i])) > 0 then
if IsDivisible(LP(h,t), LP(g[i],t), mainvariable) = 0 then
return i;
else
result := 0;
end if:
end if:
end if:
od:
od:
return result;
end proc:

 

 

with(Groebner):
LP := proc(f, t)
return LeadingTerm(f, t)/LeadingCoefficient(f, t);
end proc:
IsDivisible := proc(f, g, x)
with(Algebraic):
if Remainder(f, g, x) = 0 or degree(Remainder(f, g, x),x) < degree(g, x) then
return 0;
else
return 1;
end if:
end proc:
FindDivisble := proc(g, h, t)
result := 0;
for i from 1 to nops(g) do
if IsDivisible(LP(h, t), LP(g[i], t), x) = 0 then
return i;
else
result := 0;
end if:
od:
return result;
end proc:
MD := proc(f, g, t)
r := 0;
u := Matrix(nops(g), 1);
for j from 1 to nops(g) do
u[j] := 0;
od:
h := f;
while h <> 0 do
i := FindDivisble(g, h, t);
if i > 0 then
u[i] := u[i] + LeadingTerm(h, t)/LeadingTerm(f[i], t);
h := h - LeadingTerm(h, t)/LeadingTerm(f[i], t)*f[i];
else
r := r + LeadingTerm(h, t);
h := h - LeadingTerm(h, t);
end if:
od:
end proc:
f:=y^2*x;
f1 := y*x-y;
f2 := y^2-x;
MD(f,[f1,f2],plex(x, y));

So I'm trying to make a procedure to tell is a sequence is graphical or not.
seqgraph:= proc (L::list)

local k::integer, i::integer, n::integer, a::integer, S;

n := numelems(L);

S := convert(L, `+`);

a := 0;

if type(S, odd) then print("not graphical")

else for k to n do

if add(L[i], i = 1 .. k) <= k(k-1)+add(min(k, L[i]), i = k+1 .. n) then a := a+1

else a := a+2

end if;

end do;

end if;
if n = a then print(graphical)

else print("not graphical")

end if;

end proc;

 

 I'm trying to say that if that equality (which is part of the erdos gallai theorem) holds for that value of k then we'll add one to a value (a). Thus, if a=n at the end then the ineuqality was true for each k and thus it would it should print "graphical" but every list I test it one prints 'not graphical'. Where is my mistake? I get an error saying it can't execute add?

From some scientific experiments, the following set of data is available
(1.0, 2.33),(2.0, 0.0626),(3.0, −2.16),(4.0, −2.45),(5.0, −0.357),(6.0, 2.21),(7.0, 2.75),(8.0, 0.636),(9.0, −2.45).

We need to use least squares method to fit the curve to the data
y = a + b cos(x) + c sin(x) + d cos(2x) + e sin(2x)


Show your solution procedure in Maple and get the best fit for the coefficients. Finally
plot the data and the y curve together on the same graph to visualize the fitting. For the
data, use blue circles while for the y curve, use red solid line style. Use the leastsquares
command we learned in LinearAlgebra package.

What is the solution to the following system? Is the solution unique? Use
the reduced row echelon form to explain why.
x + 2y + 3z = 1,
4x + 5y + 6z = 1,
7x + 8y + 9z = 1

Find the eigenvalues and eigenvectors for

A =
2 0.37 0
0 1.1 −4.29
1.6 0 2.2


Can you estimate the largest eigenvalues (in absolute value) using Power method for this
problem? Try to explain why if you can

Find the quadratic polynomial which interpolates (2, 0),(6, 1),(8, 0). Solve this with Maple. Start the problem by setting f(x) = ax2 + bx + c for example, then the unknowns are a, b, c.

So for the part of the erdos gallai theorem that says:


\sum^{k}_{i=1}d_i\leq k(k-1)+ \sum^n_{i=k+1} \min(d_i,k)

 

how could I translate this into maple? I'm assuming I'll need to use nested for...dos

If I have a list, how can I write a program to see is that list is graphical? So far I have

graphicalseq := proc (L::list)

local i::integer, N;

N := convert(L, `+`);


if type(N, odd) then print("Sequence is not graphical")


else if numelems(L)-1 < L[1] then print("Sequence is not graphical")
end if;


end if;

end proc;

I know I still have to keep going to determine whether the sequence is graphical, but I'm not sure how.

 I was thinking of trying to somehow use Havel-Hakimi's theorem, but again I'm not sure how. Any hints would be appreciated.  I can't use the is Graph Sequence function

4 5 6 7 8 9 10 Last Page 6 of 1067