MaplePrimes Questions

I need to complete the definition of P km using a for loop so that km(n,m) returns n k=1 k m whenever n, m ∈ Z, n > 0, and m ≥ 0.( You must use a for loop in the variable k, with k ranging from 1 to n, to do this question in the manner requested.)

km is defined as 

km:=
proc(n::TYPE1,m::TYPE2)
description "km(n,m) returns the sum of k^m as k ranges from 1 to n.";
---MORE STUFF HERE---
end proc; # km

Not sure where tostart..Any help appreciated...thank you

Tried different ways to apply unapply but failed:

a := .1994;

modfit3 := a*x^1.5;
 
f := unapply(rhs(modfit3), x);
%;
Error, invalid input: rhs received .1994*x^1.5, which is not valid for its 1st argument, expr

What's wrong here?

S

 

Exercise: Find all the elements of order 2 in D30 .

I set the D30 group , but I do not know how to calculate and list elements of order 2 . I thought of calculating the order of all the elements ( With PermOrder () command , perhaps) , and then use the select command to select those with order of 2. But the big problem is to calculate the order of elements.

I know only calculate the order of the group. Could anyone help me ?

I'm trying to create a routine to perform the test of rational roots , but I'm having some problems. Below is the routine I created :

But the program is only printing " aux = -24 " . I don't know what it can be .

I need to modify my code , but I don't know where. Can someone help me? Thank you!

Hi Everyone,

I want to draw a 3D cylindrical object with follwoing constraint:

(1) For z=0 to 5, it should be a cylinder with radius 2 units

(2) For z = 10 to 20, it should be a cylinder with radius 8 units

(3) Connecting piece between z=5 to 10 is a type of cylinder such that its radius increses from 2 to 8 as z moves from 5 to 10.

 

I know how to draw (1) and (2) individually, but can't make a connecting object.

Can anyone help me drawing that object?

Thanks in advance.

How can I integrate the value of different k values in the plot function, instead of assigning values to k before giving the plot comman? Can't see anything about this in the help file.

staffan

 

hw2_unfinished.mw

There is something wroung with the t0.

How to correct it?

hello all!

Pascal := proc (n::posint)

local x, y, i;

 for i from 0 to n do print(coeffs(expand((x+y)^i)))

end do end proc;
Pascal(4);

   

1
1, 1
1, 2, 1
1, 3, 3, 1
1, 4, 6, 4, 1

 How to create 

         

1
1  1
1  2  1
1  3  3  1
1  4  6  4  1

 

hello everybody!

I want to create a random symmetric matrix which have det=2. I just made it like this, no better than those ones. Thanks!

Doixung := proc (n)

local A, i, j; A := Matrix(n);

n := LinearAlgebra[Dimension](A);

for i to n do A[i, i] := RandomTools[Generate](integer(range = 1 .. 20))

   end do;

for i to n do

     for j to n do

           while j < i do A[i, j] := RandomTools[Generate](integer(range = 1 .. 20)) end do;

           while i < j do A[i, j] := A[j, i] end do

     end do

end do;

print(A) end proc

Hello everbody.

Newton:=proc(p[0],TOL,N)  

 local i,p,f;   i:=1;

 while i<= N do      

     p:=p[0]-(f(p[0]))/(diff(f(p[0]),x));    

     if abs(p-p[0])<TOL then             return p;     else i:=i+1;            p[0]:=p; end if;  

end do;

printf("The method failed after N iterations,N=%d",N);  end proc:

hi all

i have this code and want to plot(NphiB1,y). but it is not plotted.

help me plz

restart:
nB0:=1:
hb:=6.63*10^(-34):
aB:=1/(3*(3*nB0*Pi^2)^(1/3)):
gB:=4*Pi*aB/mB:
xiphase:=1/sqrt(4*mB*gB*nB0):
qcB:=8.26*10^(-3)/xiphase:
qB:=y*qcB:
v1:=-gB*nB0:
v0:=4*gB*nB0:

L:=1.5*xiphase:
k2:=sqrt(qB^2+2*mB*v1):
k3:=sqrt(qB^2-2*mB*v0):
beta:=k3*L:
W:=2*cos(beta)*(qB/k2-k2/qB):
Q:=sin(beta)*(qB/k3-k3/qB+qB*k3/k2^2-k2^2/k3/qB):
P:=sin(beta)*(qB/k3-k3/qB-qB*k3/k2^2+k2^2/k3/qB):
theta1 := -arctan((Q*(-P*Q+sqrt(Q^2*W^2+W^4-W^2*P^2))/(Q^2+W^2)+P)/W):
b1:=(theta1+k2*L)/(2*k2):
Stheta1 := -(Q*(-P*Q+sqrt(Q^2*W^2+W^4-W^2*P^2))/(Q^2+W^2)+P)/(W*sqrt(1+(Q*(-P*Q+sqrt(Q^2*W^2+W^4-W^2*P^2))/(Q^2+W^2)+P)^2/W^2)):
Ctheta1 := 1/sqrt(1+(Q*(-P*Q+sqrt(Q^2*W^2+W^4-W^2*P^2))/(Q^2+W^2)+P)^2/W^2):
phiB1=evalf(-arctan((1/4)*(cos(2*qB*b1)*(sin(beta)*(-qB/k3-k3/qB+qB*k3/k2^2+k2^2/qB/k3)+cos(theta1)*sin(beta)*(-qB/k3-k3/qB-qB*k3/k2^2-k2^2/qB/k3)+2*sin(theta1)*cos(beta)*(-qB/k2-k2/qB))+sin(2*qB*b1)*(4*cos(theta1)*cos(beta)-2*sin(theta1)*sin(beta)*(k2/k3+k3/k2)))/(-sin(2*qB*b1)*(sin(beta)*(-qB/k3-k3/qB+qB*k3/k2^2+k2^2/qB/k3)+cos(theta1)*sin(beta)*(-qB/k3-k3/qB-qB*k3/k2^2-k2^2/qB/k3)+2*sin(theta1)*cos(beta)*(-qB/k2-k2/qB))+cos(2*qB*b1)*(4*cos(theta1)*cos(beta)-2*sin(theta1)*sin(beta)*(k2/k3+k3/k2))))):
NphiB1:=evalf(phiB1/Pi);
#SNphiB1:=simplify(NphiB1);
plot(NphiB1,y);

Hello everbody!

Jacobi:=proc(A::Matrix,b::Vector,x,epsilon,m)  

uses LA=LinearAlgebra;  

local      i,k,n:= LA:-RowDimension(A),    

        x:= Vector(LA:-RowDimensions(A)),    

        p:= Vector(LA:-RowDimensions(A));  

k:=1;

 while  k<=n do      

       for i to n while i<>j do          

          x[i]:=1/(A[i,i])*(-add(A[i,j]*p[j],j=1..n)+b[i]);       end do;      

        if abs(x-p)<epsilon do return x; end if;    

       k:=k+1;    

       p:=x;

 end do;  

x;  

end proc:

Why the interface typesettings option doesn't affect the content of a MathContainer?

I opened a new document. Then I inserted the command interface(typesetting=extended); to improve the visualization of a disequation's solution. It works in the worksheet, but it doesn't work in the content of a MathContainer.

Hello! I have written a algorithm. Can you help me find errors? thank you very much. sorry, my English is not very good!

LL:=proc(A::Matrix)
uses LA= LinearAlgebra;
local i, j, k, n:= LA:-RowDimension(A),
L:= Matrix(LA:-Dimensions(A));
L[1,1]:=sqrt(A[1,1]);
for j from 2 to n do
L[j,1]:=(A[j,1])/(L[1,1]);
end do;
for i from 2 to n-1 do
L[i,i]:=(A[i,i]-add(L[i,k]^(2),k=1..i-1))^(1/(2));
for j from i+1 to n do
L[j,i]:=(1/L[i,i])*(A[j,i]-add(L[j,k]*L[i,k],k=1..i-1));
end do;
end do;
L[n,n]:=(A[n,n]-add((L[n,k])^(2),k=1..n-1)^(1/(2));
L;

I want to know the mistakes i have made in the documents attached to get the expected results every time.

NULL

Case 1: control = works fine now.

M1 := K__1*A*(Matrix(2, 2, {(1, 1) = 1, (1, 2) = -1, (2, 1) = -1, (2, 2) = 1}))/l__1 = Matrix(2, 2, {(1, 1) = 0.30e-2, (1, 2) = -0.30e-2, (2, 1) = -0.30e-2, (2, 2) = 0.30e-2})

NULL

NULL

Case 2: control = prints answer in next line.M1 := K__1*A*(Matrix(2, 2, {(1, 1) = 1, (1, 2) = -1, (2, 1) = -1, (2, 2) = 1}))/l__1 = Matrix([[K__1*A/l__1, -K__1*A/l__1], [-K__1*A/l__1, K__1*A/l__1]]) = Matrix(2, 2, {(1, 1) = 0.300000000000000e-2, (1, 2) = -0.300000000000000e-2, (2, 1) = -0.300000000000000e-2, (2, 2) = 0.300000000000000e-2})

NULL

control = prints expression and answer in the next line.

case 3

M1 := K__1*A*(Matrix(2, 2, {(1, 1) = 1, (1, 2) = -1, (2, 1) = -1, (2, 2) = 1}))/l__1 = Matrix([[K__1*A/l__1, -K__1*A/l__1], [-K__1*A/l__1, K__1*A/l__1]]) = Matrix(2, 2, {(1, 1) = 0.300000000000000e-2, (1, 2) = -0.300000000000000e-2, (2, 1) = -0.300000000000000e-2, (2, 2) = 0.300000000000000e-2})

NULL

Numeric formating does not function in case2 and cae 3. I dont know shat hv i done for these things to occur. But what should i do?

NULL

 

Download onlineResultandNumeric_format_doesnot_work_in_some_casesWhy.mwonlineResultandNumeric_format_doesnot_work_in_some_casesWhy.mw

Ramakrishnan V

rukmini_ramki@hotmail.com

First 1202 1203 1204 1205 1206 1207 1208 Last Page 1204 of 2434