MaplePrimes Questions

Is there a difference between these two? 

with(Statistics):

Sample(Normal(0,1),100)

Sample(RandomVariable(Normal(0, 1)), 100)

 

Hello everyone,

I am trying to solve numerically int( f(t,z) , t=0..T ) = 0 , in z for a cumbersome f.

I tried z1=fsolve( int( f(t,z) , t=0..T ) = 0 , z). But then I tried int( f(t,z1) , t=0..T ) and the result is clearly not zero nor anything small.

It looks like Maple evaluates analytically the integral, and does it wrong (check this for more details) so fsolve uses the wrong equations.

Anyone knows how I can force Maple to evaluate numerically the integral at each step of the fsolve function?

Thank you!

Hello,

In the creation of package wrapping some procedures, may you tell me the differences between using a table or a module so as to wrap the procedures ?

In my case, it seems to me that table is more convenient since I can create with table packages while keeping my program with a structure of section, subsection, ...

But, I'm a beginner in the use of packages. Consequently, I'm very interested in your opinions on this question.

Thanks a lot for your help

hi,i am studying the maple most recent.But when calculating function integral,I ran into trouble.I hope to get your help.Here is the code I wrote, but it runs a very long time. How to effectively reduce the integration time?

restart;
with(student);
assume(n::integer);
Fourierf := proc (sigma, a, b, N) local A, A0, B, T, S, Ff; T := b-a; A0 := int(sigma, t = a .. b); A := int(sigma*sin(n*Pi*t/T), t = a .. b); B := int(sigma*cos(n*Pi*t/T), t = a .. b); S := sum(A*sin(n*Pi*t/T)+B*cos(n*Pi*t/T), n = 1 .. N)+(1/2)*A0; Ff := unapply(S, t) end proc;

f := proc (t) options operator, arrow; piecewise(t < .13*2.6 and 0 <= t, 100*t/(.13*2.6), .13*2.6 <= t and t < 2.6, 100, 2.6 <= t and t < 2.6*1.1, 0) end proc;

sigma := f(t);
a := 0;
b := 1.1*2.6;
s1 := unapply((Fourierf(sigma, a, b, 500))(t)/uw0, t);

s2 := unapply((Fourierf(sigma, a, b, 500))(t)/ua0, t);
A1 := (2*n+1)^2*Pi^2*(C3+1+sqrt(4*C1*C2*C3+C3^2-2*C3+1))/(8*C1*C2-8);
A2 := (2*n+1)^2*Pi^2*(C3+1-sqrt(4*C1*C2*C3+C3^2-2*C3+1))/(8*C1*C2-8);
g := -C2*Cww*(diff(s1(x), `$`(x, 2)))+Caa*(diff(s2(x), `$`(x, 2))+(n+1/2)^2*Pi^2*(diff(s2(x), x)));
f1 := -(1/2)*(n+1/2)^2*Pi^2*sqrt(4*C1*C2*C3+C3^2-2*C3+1)+C2*Cww*((D@@1)(s1))(0)-Caa*((D@@1)(s2))(0)+(n+1/2)^2*Pi^2*(C2-(1/2)*C3+1/2);

CN := ((2*(int(exp(-A1*x)*g, x = 0 .. t)-f1))*exp(A1*t)-(2*(int(exp(-A2*x)*g, x = 0 .. t)-f1))*exp(A2*t))/((n+1/2)^3*Pi^3*sqrt(4*C1*C2*C3+C3^2-2*C3+1));
ua := sum(CN*sin((n+1/2)*Pi*z), n = 0 .. 100);

 

 

I want to solve one equation with one variable and the variable is also in definite integral delimiter. When trying fsolve, I get the error:

"Error, (in fsolve) Can't handle expressions with typed procedures"

code

Here is worksheet.mw

How can I obtain solution with method other from simple manual testing Te values?

Dear All

I have started exploring Lie Algebra package in Maple 18 and it wonderful experience for me. But as I am in learning stage so I feel little difficulty to understand even its basic enviroment.

I am trying to fing quotient algebra for Normalizer of certain element W1 in Lie algebra and I don't how to do it. I have expected answer for quotient of Normlizer but don't know to obtain it. Please see following details:

 

with(DifferentialGeometry):with(LieAlgebras):``

L1 := _DG([["LieAlgebra", Alg1, [6]], [[[1, 3, 1], -1], [[1, 6, 2], -1], [[2, 3, 2], -1], [[2, 4, 1], 1], [[2, 5, 2], 1], [[4, 5, 4], -1], [[4, 6, 3], -1], [[4, 6, 5], -2], [[5, 6, 6], -1]]])

_DG([["LieAlgebra", Alg1, [6]], [[[1, 3, 1], -1], [[1, 6, 2], -1], [[2, 3, 2], -1], [[2, 4, 1], 1], [[2, 5, 2], 1], [[4, 5, 4], -1], [[4, 6, 3], -1], [[4, 6, 5], -2], [[5, 6, 6], -1]]])

(1)

DGsetup(L1)

`Lie algebra: Alg1`

(2)
Alg1 > 

MultiplicationTable("LieTable")

"[[[,`| `,e1,e2,e3,e4,e5,e6],[,-`---`,-`---`,-`---`,-`---`,-`---`,-`---`,-`---`],[e1,`| `,0,0,_DG([["vector",Alg1,[]],[[[1],-1]]]),0,0,_DG([["vector",Alg1,[]],[[[2],-1]]])],[e2,`| `,0,0,_DG([["vector",Alg1,[]],[[[2],-1]]]),_DG([["vector",Alg1,[]],[[[1],1]]]),_DG([["vector",Alg1,[]],[[[2],1]]]),0],[e3,`| `,_DG([["vector",Alg1,[]],[[[1],1]]]),_DG([["vector",Alg1,[]],[[[2],1]]]),0,0,0,0],[e4,`| `,0,_DG([["vector",Alg1,[]],[[[1],-1]]]),0,0,_DG([["vector",Alg1,[]],[[[4],-1]]]),_DG([["vector",Alg1,[]],[[[3],-1],[[5],-2]]])],[e5,`| `,0,_DG([["vector",Alg1,[]],[[[2],-1]]]),0,_DG([["vector",Alg1,[]],[[[4],1]]]),0,_DG([["vector",Alg1,[]],[[[6],-1]]])],[e6,`| `,_DG([["vector",Alg1,[]],[[[2],1]]]),0,0,_DG([["vector",Alg1,[]],[[[3],1],[[5],2]]]),_DG([["vector",Alg1,[]],[[[6],1]]]),0]]]"

(3)
Alg1 > 

W1 := [a*e3+e5]

[a*_DG([["vector", Alg1, []], [[[3], 1]]])+_DG([["vector", Alg1, []], [[[5], 1]]])]

(4)
Alg1 > 

Nor[W1] := SubalgebraNormalizer(W1)

[_DG([["vector", Alg1, []], [[[5], 1]]]), _DG([["vector", Alg1, []], [[[3], 1]]])]

(5)

How one can find Quotient alegebra "(Nor[W1])/(W1)....???`? ``The expected answer is {e3}.`"

I am trying verify 4th 2-dimensional subalgebra results given in research artcle by Coggeshall and Meyer-ter-Vehn (See pp. 3592 in article).

Download [670]_Normalizer_in_Abstract_Lie_Algebra.mw

Regards

I have tried to perform the examples given in the help section for DataSet retrival.  I cannot get Maple 2016 to access the internet available databases.  It does not return any outside of PC resources, like Maple 2015 did, on search items. Is there a setup item that I am missing or is there something amiss in Maple 2016.

This is the Error that I am getting: "Error, (in DataSets:-Search) invalid input: find_count expects its 1st argument, lst, to be of type list(nonnegint), but received [FAIL["total_count"], 0]. "

I was able to run this example in Maple 2105.  The example is the "Average Global Temperature"

 

Thanks

Bill Tolrud

I need to do this with a sequence of a large number of elements but here is my question with a sequence of fewer elements.

a:={10,11,-13,9,20,74,10}:

I want to check each element of the sequence if it is negative. And if any element is negative I want to replace with 0 (or do something else). I tried the following code but it didn't work. 

for k from 1 to 7 do
  if (a[k]<0) then subs(a[k]=0, a) end if:
end do;

Please help me to figure it out. 

@ecterrab 


hello dear,

was working with tensor package using debever formalism in maple v release 5 and got this problem, 
Error, (in factor) expecting a polynomial over an algebraic number field. would u tell me how to deal with this error in maple v release 5. aprl12.mws
thanks,
suresh

Hi,

can you please help me with the usage of applyrule? I have the following problem that I cannot isolate. I have a rule that I want to apply, but instead of applying the rule to the expression, the rule seems to be applied to itself. In an isolated worksheet everything is fine:

restart;

rule:=abs(''a''::algebraic)^2=''a''^2;

abs('a'::algebraic)^2 = 'a'^2

(1)

 

myexp:=abs(548.477146186283171377723+radius_motor*q_mot_vec_2(t)-l_wire_0[2])^2

abs(548.477146186283171377723+radius_motor*q_mot_vec_2(t)-l_wire_0[2])^2

(2)

applyrule(rule,myexp);

(548.477146186283171377723+radius_motor*q_mot_vec_2(t)-l_wire_0[2])^2

(3)

rule

abs(a::algebraic)^2 = a^2

(4)

 


Download applyrule.mw

What happens when I try to use this rule in my script is this:

restart;

#read "some_long_script.mpl":

rule:=abs(''a''::algebraic)^2=''a''^2;

abs('a'::algebraic)^2 = 'a'^2

(1)

applyrule(rule,abs(x)^2)

abs(x)^2

(2)

rule

a::algebraic^2 = a^2

(3)

 

>
 

I want to clarify, that the script that is read before applying those rules does not apply a similar rule. Also the variables rule and x were free. Can you please help me to locate the problem?

Thanks!

Honigmelone

Hello everyone!

I want to generate an lower triangular matrix. Please see the attachment and help me. I am waiting your quick response. 

Help.mw

The result I am looking for is Re[Sqrt[x + I*y]] = 1/2 Sqrt[2 (SQrt[x^2+y^2]+x)]. How can I get it?

Hey,

at some point in my maple calculations I have to read some symbolic constants because otherwise the expressions become to big. All my constants are in a range 1e-3 to 1e6 or something. No matter how exact I calculate my result always has some Numbers in the range of <1e-20 (how small they actually are varies with Digits) together with numbers 1e-3..1e6. I presume those 1e-20 are just zeros. Can I somehow tell maple to forget/drop very small numbers and assume them all to be zero?

Thanks!

Honigmelone

Hey all,

I want to symbolically differentiate a function and recalculate the result later. Here is what I have tried so far:


restart;

myexp:=dfdb+sthlong

dfdb+sthlong

(1)

b:=<b1(t),b2(t)>;

b := Vector(2, {(1) = b1(t), (2) = b2(t)})

(2)

dfdb:=Physics[diff]~(f(b),b)

dfdb := Vector(2, {(1) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)})), (2) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)}))})

(3)

f:=b->b(1)^2+b(2)

proc (b) options operator, arrow; b(1)^2+b(2) end proc

(4)

eval(myexp);  #actual result

 

 

sthlong+(Vector(2, {(1) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)})), (2) = (D(f))(Vector(2, {(1) = b1(t), (2) = b2(t)}))}))

(5)

dfdb:=Physics[diff]~(f(b),b):

eval(myexp); #expected result

sthlong+(Vector(2, {(1) = 2*b1(t), (2) = 1}))

(6)

 


Download physics_diff.mw

I wonder if this is even possible, or if I missunderstand something. Can you please help me?

 

Thanks

 

Honigmelone

In Maple 17, I had

evalf(5^1.25, 30);
7.476743906

evalf(5^(5/4), 30);
7.47674390610610270955949497070

evalf(evalf(5^1.25, 30)-evalf(5^(5/4), 30), 30);
-1.0610270955949497070 *10^(-10)

I would expect the two results to be the same. 

I am using Maple 17 and windows 7 operating system. 

Is there a reason that  evalf(5^1.25, 30) will not compute 30 decimal places?

 

 

First 1135 1136 1137 1138 1139 1140 1141 Last Page 1137 of 2428