MaplePrimes Questions

In the context of homework, there are some calculations that I do through Maple, and others that I do mostly by hand, and just show my work with Maple's engine that is great at rendering special mathematical formats (like matrices, for example).

I would like to show something like that:

 

It's pretty easy to make the matrices, right now my line looks like this:

 

But I would like to refrain for executing the "+" operator and the multiplication by x6 and x7, to have the output like in the first picture. If I disable all execution and take the statement as plain text, then obviously I will not get the correctly rendered matrices.

Is there a way, like an escape character, to prevent specific operations from being executed in one line in particular?


 

لا شيء

-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------

إعادة بدء

مع (LinearAlgebra)

مع (orthopoly)

مع (طالب)

لا شيء

لا شيء

لا شيء

لا شيء

سيل (ألفا): = 2؛  سيل (بيتا): = 1؛  ألفا: = 1.5؛  بيتا: = .5

2

 

1

 

1.5

 

0.5

(1)

n: = 8؛  m: = 8

8

 

8

(2)

 

لا شيء

x [3]: = .611423302089630؛  x [4]: ​​= 1.09446605083631؛  x [5]: = 1.99636816302962؛  x [6]: = 3.38757178455234؛  x [7]: = 5.41873370919121؛  x [8]: = 8.49143699030089

،611423302089630

 

+1.09446605083631

 

1.99636816302962

 

3.38757178455234

 

5.41873370919121

 

8.49143699030089

(3)

# 1 / حساب مصفوفة (A). (طريقة الجمع)

A := array(1 .. n, 1 .. m); for j to m do A[1, j] := evalf(subs(x = 0, L(j-1, 2*x-1))) end do; for j to m do A[2, j] := evalf(subs(x = 0, diff(L(j-1, 2*x-1), x))) end do; for i from 3 to n do for j to m do A[i, j] := evalf(subs(x = x[i], fracdiff(L(j-1, 2*x-1), x, alpha, method = direct))+subs(x = x[i], fracdiff(L(j-1, 2*x-1), x, beta, method = direct))+subs(x = x[i], diff(L(j-1, 2*x-1), x))+subs(x = x[i], L(j-1, 2*x-1))) end do end do

print(`A=`, A)

`A=`, A

(4)

A := convert(A, Matrix)

A := Matrix(8, 8, {(1, 1) = 1., (1, 2) = 2., (1, 3) = 3.500000000, (1, 4) = 5.666666667, (1, 5) = 8.708333333, (1, 6) = 12.88333333, (1, 7) = 18.50972222, (1, 8) = 25.97658730, (2, 1) = 0., (2, 2) = -2., (2, 3) = -6., (2, 4) = -13., (2, 5) = -24.33333333, (2, 6) = -41.75000000, (2, 7) = -67.51666667, (2, 8) = -104.5361111, (3, 1) = 1., (3, 2) = -2.987486314, (3, 3) = -3.301220288, (3, 4) = .5119939327, (3, 5) = 9.171314221, (3, 6) = 23.72035697, (3, 7) = 45.59773916, (3, 8) = 76.72165628, (4, 1) = 1., (4, 2) = -4.549878909, (4, 3) = -1.208865530, (4, 4) = 6.408882482, (4, 5) = 16.03540544, (4, 6) = 27.10075251, (4, 7) = 40.26736031, (4, 8) = 57.11215315, (5, 1) = 1., (5, 2) = -7.181375466, (5, 3) = 6.777193107, (5, 4) = 12.19170970, (5, 5) = 9.600555508, (5, 6) = 7.084730200, (5, 7) = 11.13249218, (5, 8) = 24.60731420, (6, 1) = 1., (6, 2) = -10.92878792, (6, 3) = 28.28352183, (6, 4) = -10.19173665, (6, 5) = -20.04576479, (6, 6) = 9.17677094, (6, 7) = 39.97816692, (6, 8) = 49.07345342, (7, 1) = 1., (7, 2) = -16.09078867, (7, 3) = 78.08969329, (7, 4) = -166.5158779, (7, 5) = 129.0586058, (7, 6) = 104.8307190, (7, 7) = -104.838425, (7, 8) = -111.0119440, (8, 1) = 1., (8, 2) = -23.55908364, (8, 3) = 192.6052140, (8, 4) = -856.8131732, (8, 5) = 2255.610395, (8, 6) = -3256.154493, (8, 7) = 1577.05254, (8, 8) = 2063.443568})

(5)

NULL

# ------------------------------------------------- --------------------------
# 2 / حساب مصفوفة (ب) من قبل أدومين بوليس لمصطلح غير الخطية.

"G(y):=(e)^(y)"

proc (y) options operator, arrow; exp(y) end proc

(6)

"g(x):=evalf(((4*sqrt(x))/(sqrt(Pi)))+(8/(3))*((x^(3/(2)))/(sqrt(Pi)))+2*x+x^(2)+(e)^(x^(2)))"

proc (x) options operator, arrow; evalf(4*sqrt(x)/sqrt(Pi)+(8/3)*x^(3/2)/sqrt(Pi)+2*x+x^2+exp(x^2)) end proc

(7)

#Find أدومين بولي:

for k from 0 to n-1 do AP[k] := evalf(subs(lambda = 0, (diff(G(sum(y[t]*lambda^t, t = 0 .. k)), [`$`(lambda, k)]))/factorial(k))) end do

exp(y[0])

 

y[1]*exp(y[0])

 

y[2]*exp(y[0])+.5000000000*y[1]^2*exp(y[0])

 

y[3]*exp(y[0])+y[2]*y[1]*exp(y[0])+.1666666667*y[1]^3*exp(y[0])

 

y[4]*exp(y[0])+y[3]*y[1]*exp(y[0])+.5000000000*y[2]^2*exp(y[0])+.5000000000*y[2]*y[1]^2*exp(y[0])+0.4166666667e-1*y[1]^4*exp(y[0])

 

y[5]*exp(y[0])+y[4]*y[1]*exp(y[0])+y[3]*y[2]*exp(y[0])+.5000000000*y[3]*y[1]^2*exp(y[0])+.5000000000*y[2]^2*y[1]*exp(y[0])+.1666666667*y[2]*y[1]^3*exp(y[0])+0.8333333333e-2*y[1]^5*exp(y[0])

 

y[6]*exp(y[0])+y[5]*y[1]*exp(y[0])+y[4]*y[2]*exp(y[0])+.5000000000*y[4]*y[1]^2*exp(y[0])+.5000000000*y[3]^2*exp(y[0])+y[3]*y[2]*y[1]*exp(y[0])+.1666666667*y[3]*y[1]^3*exp(y[0])+.1666666667*y[2]^3*exp(y[0])+.2500000000*y[2]^2*y[1]^2*exp(y[0])+0.4166666667e-1*y[2]*y[1]^4*exp(y[0])+0.1388888889e-2*y[1]^6*exp(y[0])

 

y[7]*exp(y[0])+.5000000000*y[3]*y[2]*y[1]^2*exp(y[0])+.5000000000*y[5]*y[1]^2*exp(y[0])+y[5]*y[2]*exp(y[0])+y[6]*y[1]*exp(y[0])+y[4]*y[3]*exp(y[0])+.5000000000*y[3]^2*y[1]*exp(y[0])+.1666666667*y[2]^3*y[1]*exp(y[0])+0.1984126984e-3*y[1]^7*exp(y[0])+y[4]*y[2]*y[1]*exp(y[0])+0.8333333333e-2*y[2]*y[1]^5*exp(y[0])+0.8333333333e-1*y[2]^2*y[1]^3*exp(y[0])+0.4166666667e-1*y[3]*y[1]^4*exp(y[0])+.5000000000*y[3]*y[2]^2*exp(y[0])+.1666666667*y[4]*y[1]^3*exp(y[0])

(8)

NULL

#Find a ماتريسز b ^ (k) و C ^ (k): = A ^ (- 1) * b ^ (k)، ثم ايجاد حل تقريبي Y [k]: = سوم (C ^ (k) [i ] * L [i]، i = 1 .. n ):

# 1) البحث ب (0)

b0 := array(1 .. n, 1 .. m-7); for i to 2 do b0[i, 1] := 0 end do; for i from 3 to n do b0[i, 1] := evalf(subs(x = x[i], g(x[i]))) end do

print(`b0=`, b0)

`b0=`, b0

(9)

b0 := convert(b0, Matrix)

b0 := Matrix(8, 1, {(1, 1) = 0, (2, 1) = 0, (3, 1) = 5.533921684, (4, 1) = 10.78339161, (5, 1) = 69.22208674, (6, 1) = 96372.14332, (7, 1) = 0.5649990671e13, (8, 1) = 0.2063418920e32})

(10)

# 2) البحث عن ج (0)

C0 := LinearSolve(A, b0)

C0 := Matrix(8, 1, {(1, 1) = -0.11474558283495975e27, (2, 1) = -0.6041534517526968e26, (3, 1) = 0.28431046341368933e27, (4, 1) = -0.1109483456679843e28, (5, 1) = 0.2601411410469915e28, (6, 1) = -0.34736953613415415e28, (7, 1) = 0.23829217145639085e28, (8, 1) = -0.634449734180237e27}, datatype = float[8])

(11)

for i to n do k0[i] := C0[i, 1] end do

HFloat(-1.1474558283495975e26)

 

HFloat(-6.041534517526968e25)

 

HFloat(2.8431046341368933e26)

 

HFloat(-1.109483456679843e27)

 

HFloat(2.601411410469915e27)

 

HFloat(-3.4736953613415415e27)

 

HFloat(2.3829217145639085e27)

 

HFloat(-6.34449734180237e26)

(12)

# 3) البحث عن y (0)

y[0] := sum(k0[s]*L(s-1, 2*x-1), s = 1 .. 8)

-HFloat (5.083969685801073e25) -HFloat (1.4661238981264424e26) * س + HFloat (1.2387812172594187e26) * (2 * س 1) ^ 2-HFloat (1.9836944590452831e24) * (2 * س 1) ^ 3 HFloat (5.120751558697758 E25) * (2 * س 1) ^ 4 + HFloat (2.0830079097858884e25) * (2 * س 1) ^ 5 HFloat (2.8586478120802086e24) * (2 * س 1) ^ 6 + HFloat (1.2588288376592004e23) * (2 * س 1) ^ 7

(13)

# -------------------------

#Find b (1)

لا شيء

لا شيء

لا شيء

b1: = أري (1 .. n، 1 .. m-7)؛  ل i تو 2 دو b1 [i، 1]: = 0 إند دو؛  من i إلى n n b1 [i، 1]: = سوبس (x = x [i]، أب [0]) إند دو

برينت (`b1 =`، b1)

`b1 =`، b1

(14)

b1: = كونفيرت (b1، ماتريكس)

b1: = مصفوفة (8، 1، {(1، 1) = 0، (2، 1) = 0، (3، 1) = إكس (هفلوات (-1.3446720400287247e26))، (4، 1) = إكس هفلوت (-1.000132892371102e26))، (5، 1) = إكس (هفلوت (-1.7743764624635952e26))، (6، 1) = إكس (هفلوت (9.701444095568667e26))، (7، 1) = إكس 1.9741498268709318e28))، (8، 1) = إكس (هفلوات (4.2920269682087554e30))})

(15)

لا شيء

# 2) البحث ج (1)

لينيرزولف (A، b1)

المصفوفة ([هفلوات (هفلوات (وندفيند))]، [هفلوت (هفلوات (وندفيند))]، [هفلوات (هفلوات (وندفيند))]، [هفلوات (هفلوات (وندفيند))]، [هفلوات (هفلوات (وندفيند) )، [هفلوات (هفلوات (وندفيند))]، [هفلوات (هفلوات (وندفيند))]، [هفلوات (هفلوات (وندفيند))]])

(16)

لا شيء


 

تحميل jam.mw

Hi everybody,

I want to solve numerically an ode and I get this error (undocumented on the maplesoft web site https://www.maplesoft.com/support/help/errors/....)

Error, (in sol) maximum number of event iterations reached (100) at t=2.6610663

I understand where this error can come from but the help pages don't say anything to fix this.
There is some stuff about round-off that could help but I don't understand how to use it.

I would be grateful if you provide me some help.
Thanks in advance


Download ErrorWithDsolve.mw

 

 

The graphic below by used maple18

contourplot(-3.392318438*exp(-4.264628895*x)*sin(6.285714286*y), x = -1/2 .. 3/2, y = -1/2 .. 3/2)

Why the graphic below the figure is not integrated, how can develop the graphic

 

 

Dear 

Hope everyone is fine. In attached file I solved system of equations. But the solution like this 

Sol[1]:={{...},{...}}

But I want the solution like

Sol[1]:={...}

Please see the attachment and fix my problem

Problem.mw

I want to suppress  ~ when using assume()

I write:

restart;
interface(showassumed = 0);
assume(s>0);
s;
 

but s still appears with tilde?!?

Hello,

I could build the table routh of the characteristic equation of the system by using the function RouthTable( )

I try to find the stability conditions as fonction as the gain g. For that purpose, i have to solve some inequalities.

Each terms of the first column of the routh table should be positive.

I would like to find the conditions on the gain g so that my system is stable.

In order to solve the inequalities as function of g, i must assume the mass, and the spring to be positive. I'm not sure that i have well assumed the parameters to be positive.

Have you some ideas to solve my inequalities and find symbolically the conditions of the gain g? 

I attach an extract of my code.

Thank you for your help

Extract of my code: 

SolvingTableRouth.mw

 

 

Hello.

Please help me. I Have to solve some equations with Adomian Decomposition Method in Maple. But i don't know it.

I just know AGM, HPM and Perturbation Method in Maple.

please send me instructions and codes.

I'm sorry, I can't speak English well. I hope you understand what I mean.

thank you

Dear

I am facing to eliminate diff(p(x, y), y, x) from Eq1 and Eq2. My procedure is given below:

Eq1 := 2*rho[nf]*a^2*x*(diff(f(eta), eta, eta))*(diff(f(eta), eta))/h+rho[nf]*sqrt(nu[f])*(diff(f(eta), eta))*a*x*(diff(f(eta), eta, eta))/h^2+rho[nf]*sqrt(nu[f])*f(eta)*a*x*(diff(f(eta), eta, eta, eta))/h^2+2*rho[nf]*omega[0]*a*x*(diff(g(eta), eta))/h = -(diff(p(x, y), y, x))+mu[nf]*a*x*(diff(f(eta), eta, eta, eta, eta))/h^3-sigma[nf]*B[0]^2*a*x*(diff(f(eta), eta, eta))/h;

Eq2 := 0 = -(diff(p(x, y), y, x));

eliminate({Eq1, Eq2}, diff(p(x, y), y, x));

Dear 

I want to graw following points (u[i,j], i=0..M,j=0..N) obtained in Sol[i] in 3D where i takes along x-axes, j y-axis and u along z axes. I also want the style of point plot as surface. Same do for v and w. I am waiting your response, Thanks

3D_plots.mw

TL;DR I'm having problems with the Finite Fields, polynomials over them and related operations. I saw it has been asked  but questions were asked long time ago. Any advice would be appreciated.

I'm trying to develop some algorithms in Maple using Finite Fields. I'm finding it difficult to learn Maple as I find the information on the internet either basic (guides on making sums and so) or too advanced (most of the times Maple Help feels like swimming in the abyss).

At first I started using the Domains package but it's documentation is quite ambiguous and I felt it was too low-level. I switched then to using the Galois Field package making statements like these:

#Example of EUCLIDES algorithm in F7
p:=7:
G7:=GF(p,1);
a:=G7:-ConvertIn(6);
b:=G7:-ConvertIn(5);
gcd:=EUCLIDES(a, b, G7, p);

At this moment, things get very confusing as a and b were elements of F7 but whattype returned they were zppolys. The problem arises when I try to use polynomials in F7[x]. Intuitively, I coded this:

a := modp1(ConvertIn(3*x^6+2*x^2+x+5, x), 7); 
b := modp1(ConvertIn(6*x^4+x^3+2*x+4, x), 7);
mcd:=EUCLIDES(a,b,G7, 7);

as I found the modp1 functions diving in Maple Help. The strange thing is that a and b also claim to be zppolys. Is this normal? Do the elements and the polynomials over the elements have the same type? It's a bit odd.

Also, my implementation of EUCLIDES is as follows:

proc(a::zppoly, b::zppoly, g::symbol, p::integer)
		local r0, r1, r2;
		r0, r1 := a, b;
		while r1 <> g:-ConvertIn(0) do
			r2 := modp1(Rem(r0,r1),p);
			r0 := r1;
			r1 := r2
		end do;
		return r0
	end proc:

Which syntax I find a bit annoying.

The problem gets even worse as I try to implement the Rabin test of irreducibility https://en.wikipedia.org/wiki/Factorization_of_polynomials_over_finite_fields#Rabin.27s_test_of_irreducibility

Which uses the modular composition algorithm, implemented as follows:

modcomp := proc(f::zppoly, g::zppoly, h::zppoly, p::integer)
	local n, m, A, B, i, pol, grad, k, j, BA, b, ri;
	n := modp1(Degree(f));
	m := ceil(n^(1/2));
	A := Matrix(m,n);
	B := Matrix(m,m);

	
	for i from 1 to m do
		pol := repsqua(h, i-1, f, p);
		grad := modp1(Degree(pol));

		for k from 0 to grad do
			A[i, k+1] := modp1(Coeff(pol, k)); 
		end do;

		for j from 1 to m do
			B[i, j] := modp1(Coeff(g, (j-1)+(i-1)*m)); 
		end do;
	end do;

	BA := B.A;
	b := modp1(ConvertIn(0,x),p);

	for i from 1 to m do
		ri := modp1(ConvertIn(0,x),p); 
		pol := 0; 
		for j from 1 to m do
			ri := modp1(Add(ri,modp1(ConvertIn(BA[i,j]*x^(j-1), x),p))); 
                        if j <= numelems(A[i]) then
				pol := pol + A[i, j]*x^(j-1);
			end if;
		end do;
		pol := modp1(ConvertIn(pol,x),p);
		pol := repsqua(pol, i-1, f, p);
		b := modp1(Add(b, modp1(Rem(modp1(Multiply(pol, ri)), f)))); 
	end do;
	return b;
end proc:

That ceirtainly is an annoying syntax plus the fact that the whole implementation of the algorithm doesn't work. I upload a file in case someone has some time to have a look. testIrrFq.mw

I'm quite lost in all that goes about Polynomials and Finite Fields and so in Maple, so any help is appreciated.

I have written the following code; 

Do := proc( F::algebraic , Q::list)
local n:=nops(F), m:=nops(Q);
seq(F[i]~(Q[i]), i=1..n);
end proc:

 

which does not work

I know there is a really simple mistake but i just cannot see it.

 

Dear

I want to draw the graphs of the attached system of PDEs for different values of M in 3D please fix my problem. I am waiting your positive response.

graphs_for_pde.mw

It seems rather arbitrary that proc..end proc is allowed inside functions, but none of the other statements from ?index,statement are:

seq(try ln(i) catch: -infinity end try, i=0..2)
seq(proc() try ln(i) catch: -infinity end try end proc(), i=0..2)

Only the second one works, even though syntactically it doesn't seem to be different from the first one.

It would be really convenient to have any statement allowed inside a function, including assignments (as :=, not as assign()) and compound statements:

s:=0: seq(s:=s+i, i=1..10)
s:=0: seq(proc() global s:=s+i end proc(), i=1..10)

This is more compact than using a loop.

how I can  select 2D function (sigma) that these boundary conditions are satisfied?

thanks

sigma(1, z) = 0, sigma(r, 0) = 1, diff(sigma(0, z), r) = 0, diff(sigma(r, 1), z) = 0

First 827 828 829 830 831 832 833 Last Page 829 of 2355