mehdi jafari

534 Reputation

13 Badges

6 years, 232 days

MaplePrimes Activity


These are questions asked by mehdi jafari

There are 10 questions. each question has one negetive point and three positive points. what is the number of students so that there will not be any repeatitive grades so all the students have distinct grades. Thanks in advance

I have a question with a proc containing "if" statement. 
i want maple to do the calculations without just like Heaviside function does. how can it be done?is it possible?

restart

f1:=proc(x)
if x>=0 then 1
else 0
fi:end proc:

Matrix(2,[[f1(x)+2,2*f1(x)],[5,4]]);

Error, (in f1) cannot determine if this expression is true or false: 0 <= x

 

P:=f1(x)*exp(x)+5*x;

Error, (in f1) cannot determine if this expression is true or false: 0 <= x

 

diff(P,x)

0

(1)

 

 


but i can do all of the above with Heaviside(x). can i do the same with my procedure?

Download if.mw

i have a matrix named S. it has two variables with the names sigma1 and tau. i do some computations with these varibels to obtain a matrix named S_NEW. when i calculate S_NEW with parameters and then i substitute parameter tau with zero i got the answer a zero Matrix. but when i put tau=0 at the initiation of my code, i got another answer. what is the problem?

the second issue is related with the name of parametes in maple. when the varible has the name sigma1 (and tau=0), the matrix S_NEW is a matrix with the only component of (1,1). when i change the parameter name to sigma the matrix S_NEW is a matrix with the only component of (3,3). where is the problem?

 

restart:with(LinearAlgebra):

tau:=0;

0

(1)

S:=Matrix(3,[[sigma1,tau,0],[tau,0,0],[0,0,0]]):B1:=Matrix(3):

A12,B12:=(Eigenvectors(S)):

V12:= Matrix(Normalize~([Column(B12,1..3)],Euclidean)):

S_NEW:=simplify(V12^+.S.V12) assuming real ;

Matrix(3, 3, {(1, 1) = sigma1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(2)

eval(S_NEW,tau=0)

Matrix(3, 3, {(1, 1) = sigma1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(3)

 

 

 

Download problem.mw



i have a question about sets. how can i keep set members in order of addition not the defualt maple ordering.
in maple help, i saw the command setsort=0..8 but i do not know how to use it.
consider exmaple below:


 

restart

L:={}:

for j in [3,5,6,1] do
birth:=j:
L:=`union`(L ,{j});
od;

3

 

{3}

 

5

 

{3, 5}

 

6

 

{3, 5, 6}

 

1

 

{1, 3, 5, 6}

(1)

 


how can i keep L as order of addition? L={3,5,6,1}. thanks in advance

Download setoder.mw

how this integral can be calculated in the simplest form ? the second question is what exactly is done when using assuming? for example when using assuming real, all the functions or parameteres are affected? thanks in advanced

 

restart:with(IntegrationTools):

(int(int(exp(-(y-beta[0]-beta[1]*x-b0-b1*x)^2/(2*sigma^2))*exp(-b0)*exp(-b1),b0=0..infinity),b1=0..infinity,continuous=true) assuming real)

signum(limit(-(1/2)*Pi^(1/2)*exp((1/2)*(2*b1+2*beta[1])*x+(1/2)*sigma^2-y-b1+beta[0])*2^(1/2)*sigma*(erf((1/2)*(sigma^2+(b1+beta[1])*x-y+beta[0])*2^(1/2)/sigma)-signum(sigma)), b1 = infinity))*infinity

(1)

 


 

Download error_function.mw

1 2 3 4 5 6 7 Last Page 1 of 18