MaplePrimes Questions

I am trying to rearrange the elements of an equation by the absolute value of their coefficients. eg -3y^2 x+2x z^2+6z^2 to

2x z^2 -3y^2 +6z^2 

 

Download Rearange_test.mwRearange_test.mw

test1_03.mw

The solution I'm getting here for v(y), doesn't satisfy my original two equations. Like for example if I choose u(y)=y, for easy check it can be seen that my de2 equation doesn't satisfy that value.

Can anyone help me out?

Hi
when I use this package, maple makes error like bellow. what is the problem ? thank u

Hi,


I was applying the Grip Map to the procedure LArip. It apparently finished in less than 5 seconds. But when I wanted to display the results as an Array, this step required minutes. How can this time be reduced? Here is a piece of the code:

n := 8;
r := 2^n;
M := Vector(r, randperm(r) + [-seq(1, i = 1 .. r)], datatype = integer[4]);

LArip := proc(k::integer, r::integer, M::Vector(datatype = integer[4]))
local N, j, t, i, A;
N := Vector(r, 0); A := Vector(r, 0);
i := k - 1;
for j from 0 to r - 1 do
for t from 0 to r - 1 do
N[t + 1] := Occurrences(1, Split(Xor(And(t, i), And(M[t + 1], j)))) mod 2;
end do;
A[j + 1] := Occurrences(0, convert(N[], list));
end do;
return convert(A, list);
end proc;

infolevel[Grid:-Map] := 3;
rt := time[real]();
Bb := Grid:-Map(k -> LArip(k, r, M), [$ (1 .. r)]);
GridMapTime := time[real]() - rt;
 

The worksheet is here:

Magma_GridMap.mw

Thank you for your help.

Hey!
I am using the solve function and I get the following form of the result :

rootsq0 := {z = 9.096986124+3.141592654*I}, {z = 1.138376998+3.141592654*I}, {z = .3074241220+3.141592654*I}, {z = .5854971300+3.141592654*I}, {z = -2.519351300+3.141592654*I}, {z = -5.138371980+3.141592654*I}, {z = -1.759344122+3.141592654*I}, {z = -0.9698634104e-1+3.141592654*I}

I want to convert rootsq0 into a list [9.096986124+3.141592654*I, 1.138376998+3.141592654*I, ...]. So, I would like to remove {} and z=. Any suggestions are welcome! :)

Is it possible to write an equation reduction program that uses only LinearAlgebra.?

restart; with(LinearAlgebra); with(Student[LinearAlgebra]); unprotect(D);
f := proc (x, y) options operator, arrow; 5*x^2+4*y*x+8*y^2+16*x-8*y-16 end proc;
A := coeff(f(x, y), x, 2); B := coeff(coeff(f(x, y), x, 1), y, 1); C := coeff(f(x, y), y, 2); D := coeff(coeff(f(x, y), x, 1), y, 0); E := coeff(coeff(f(x, y), y, 1), x, 0);
F := tcoeff(f(x, y));
MQ:=Matrix([[A,B/2], [B/2,C]]):
Delta := A^2-4*A*C;
ML := `<,>`(D, E);
vp := Eigenvalues(MQ);
Omega := evalm(-`&*`((1/2)*ML, 1/MQ));
M1 := MQ-Eigenvalues(MQ)[1]*IdentityMatrix(2);
M2 := MQ-Eigenvalues(MQ)[2]*IdentityMatrix(2);
D := JordanForm(MQ);
with(linalg);
ma := matrix(2, 2, [A, (1/2)*B, (1/2)*B, C]);
jordan(ma, 'P1'); G := map(normalize, GramSchmidt([col(P1, 1 .. 2)])); P := map(simplify, concat(op(G)));

;
evalm(`&*`(`&*`(1/P, MQ), P));
nx := [X, Y];
var := [x, y];
x := matrix([seq([nx[i]], i = 1 .. 2)]); y := evalm(`&*`(P, x));
s := seq(var[k] = y[k, 1]+Omega[k], k = 1 .. 2);
eq := unapply(simplify(expand(subs(s, f(x, y)))), X, Y);
alpha := -eq(0, 0);
a := sqrt(alpha/vp[2]); b := sqrt(alpha/vp[1]); c := sqrt(a^2-b^2); print(X^2/a^2+Y^2/b^2 = 1);

This program works;. It is possible to simplify ? Thank you.

 

restart;
eq := 61*x^2 + 1 = y^2;
sols := (isolve(eq) assuming (x::posint, y::posint)):
for sol in sols do
  print(subs(_Z1 = 1, sol));
end do;

isolve returns the solution in terms of _Z1, indicating there may be infinite number of solutions?
I think {x = 226153980, y = 1766319049} is the only solution with x::posint, y::posint.

How do I restrict this to only positive integers in the solution?

If you could assist; I am trying to set something like an asymptote or upper limit such that my plot below approaches asymptotically (below y =1 ) from negative infinity:

Download Plotting.mw

Why Float(undefined) appears in calculation integrals

3333.mw

I see this question at here
https://mathematica.stackexchange.com/questions/239874/how-to-reduce-timing-to-find-the-integer-numbers-a-b-c-d-e-f-g-h-k-m-of

How to solve this problem by Maple?

command completion (when hitting the ESC key) in Maple could be made more useful. It does not seem to support type names for example.

What shows up on the command completion window are  possible commands that start with that partial text.

It does not list other known names by Maple, such as type names and other options.

This makes it hard to use in many places, where one have to remember type names exactly instead of the system helping them by listing all possible type names that start with that string.

Is there a way around this? Will Maple next version support smarter and more complete command completion menu?

 

 

dear all

I would like to display the error ( tab_err) and plot it. 
The code run without any mistakes but there is no table of error dispalyed and can then be plotted 


integ_R.mw

Thank you for any help 

 

How to plot Complex vales in 2D? 

Z be complex.

rho := 1/4; mu := 1/4; E := sum(Z^k/GAMMA(k*rho+mu), k = 0 .. 5)

I am trying to run this code but this error message is coming up "Error, (in fprintf) number expected for floating point format
". What have I done wrong and how do I correct it.

Thank you and best regards.

 

restart;
Digits:=30:

f:=proc(n)
	-((sin(x[n]))/(2-sin(x[n])))*(2+sin(x[n]-Pi)):
end proc:

e1:=y[n+1]=h*delta[n]-(1/2)*h^2*(-u^2*sin((1/2)*u)+2*cos((1/2)*u)*u-2*cos(u)*u-4*sin((1/2)*u)+2*sin(u))*f(n)/(u^2*(2*sin((1/2)*u)-sin(u)))+(1/2)*h^2*(u^2*sin((1/2)*u)+2*cos((1/2)*u)*u-4*sin((1/2)*u)+2*sin(u)-2*u)*f(n+1)/(u^2*(2*sin((1/2)*u)-sin(u)))-(1/2)*h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u)))+y[n]:
e2:=h*delta[n+1]=h*delta[n]+h^2*(u*sin((1/2)*u)+cos(u)-1)*f(n)/(u*(2*sin((1/2)*u)-sin(u)))+h^2*(u*sin((1/2)*u)+cos(u)-1)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u))):
e3:=y[n+1/2]=(1/2)*h*delta[n]-(1/8)*h^2*(-u^2*sin((1/2)*u)+4*cos((1/2)*u)*u-4*cos(u)*u-16*sin((1/2)*u)+8*sin(u))*f(n)/(u^2*(2*sin((1/2)*u)-sin(u)))+(1/8)*h^2*(u*sin((1/2)*u)+4*cos((1/2)*u)-4)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-(1/8)*h^2*(u^2*sin(u)+4*cos(u)*u+16*sin((1/2)*u)-8*sin(u)-4*u)*f(n+1/2)/(u^2*(2*sin((1/2)*u)-sin(u)))+y[n]:
e4:=h*delta[n+1/2]=h*delta[n]-(1/2)*h^2*(-u*sin((1/2)*u)+4*cos((1/2)*u)-2*cos(u)-2)*f(n)/(u*(2*sin((1/2)*u)-sin(u)))+(1/2)*h^2*(u*sin((1/2)*u)+4*cos((1/2)*u)-4)*f(n+1)/(u*(2*sin((1/2)*u)-sin(u)))-(1/2)*h^2*(u*sin(u)+2*cos(u)-2)*f(n+1/2)/(u*(2*sin((1/2)*u)-sin(u))):


inx:=0:
ind:=1:
iny:=2:
h:=Pi/4:
n:=0:
omega:=1:
u:=omega*h:
N:=solve(h*p = 8*Pi, p):

c:=1:
for j from 0 to 1 by 1/2 do
	t[j]:=inx+j*h:
end do:

vars:=y[n+1/2],y[n+1],delta[n+1/2],delta[n+1]:

step := [seq](eval(x, x=c*h), c=1..N):
printf("%6s%15s%15s%16s%15s%15s%15s\n", 
	"h","Num.y","Num.z","Ex.y","Ex.z","Error y","Error z");
#eval(<vars>, solve({e||(1..4)},{vars}));


st := time():
for k from 1 to N do

	par1:=x[0]=t[0],x[1/2]=t[1/2],x[1]=t[1]:
	par2:=y[n]=iny,delta[n]=ind:
	res:=eval(<vars>, fsolve(eval({e||(1..4)},[par1,par2]), {vars}));

	for i from 1 to 2 do
		exy:=eval(2+sin(c*h/2)):
		exz:=eval(-sin(c*h/2)+10*epsilon*cos(10*c*h)):
		printf("%6.5f%17.9f%15.9f%15.9f%15.9f %13.5g%15.5g\n", 
		h*c,res[i],res[i+2],exy,exz,abs(res[i]-exy),
		abs(res[i+2]-exz)):
		
		c:=c+1:

	end do:
	iny:=res[2]:
	ind:=res[4]:
	inx:=t[1]:
	for j from 0 to 1 by 1/2 do
		t[j]:=inx + j*h:
	end do:
end do:

 

First 320 321 322 323 324 325 326 Last Page 322 of 2308