mehdi jafari

559 Reputation

13 Badges

6 years, 299 days

MaplePrimes Activity


These are replies submitted by mehdi jafari

@Preben Alsholm but now it is optional, and u should subscribe for receiving email notifications.

i have tried sth like this, but it has some problems, for example for an unkown number of rows and columns,i should update Matrix dimensions ! but i do not know them. i want the code be general .


restart:

M:=Matrix(2,9):N:=Matrix(3,4):

file1:="ELIST.txt":fclose(file1);

file2:="NLIST.txt":fclose(file2);

for i from 1 to 2 do

M[i]:=(fscanf(file1,"%{9}fr")[1]);

od:

for i from 1 to 3 do

N[i]:=(fscanf(file2,"%{4}fr")[1]);

od:

N;M;

Matrix(3, 4, {(1, 1) = 1., (1, 2) = 0., (1, 3) = 0., (1, 4) = 0., (2, 1) = 2., (2, 2) = 50., (2, 3) = 0., (2, 4) = 0., (3, 1) = 3., (3, 2) = 25., (3, 3) = 0., (3, 4) = 0.})

 

Matrix(2, 9, {(1, 1) = 1., (1, 2) = 1., (1, 3) = 1., (1, 4) = 1., (1, 5) = 0., (1, 6) = 1., (1, 7) = 1., (1, 8) = 3., (1, 9) = 0., (2, 1) = 2., (2, 2) = 1., (2, 3) = 1., (2, 4) = 1., (2, 5) = 0., (2, 6) = 1., (2, 7) = 3., (2, 8) = 2., (2, 9) = 0.})

(1)

``


Download matrix.mw

@Mac Dude it only imports one row ! not more !

restart:

FileTools[Text][ReadFile]("NLIST.txt");

"       1     0.00000000000       0.00000000000       0.00000000000    
       2     50.0000000000       0.00000000000       0.00000000000    
       3     25.0000000000       0.00000000000       0.00000000000
        

"

(1)

op(FileTools[Text][ReadFile]("ELIST.txt"));

"       1   1   1   1   0   1      1     3     0
       2   1   1   1   0   1      3     2     0

      
      "

(2)

M:=ImportMatrix("NLIST.txt", source=delimited, datatype=float, delimiter=" ");

Error, (in ImportMatrix) end of input encountered while reading Matrix

 

M:=ImportMatrix("NLIST.txt", source=delimited, datatype=float);

M := Matrix(5, 1, {(1, 1) = 1., (2, 1) = 0., (3, 1) = 0., (4, 1) = 0., (5, 1) = 2.})

(3)

 

``


Download convert_to_array.mw

@schloemilch please insert your original question here, and maybe i can help u and upload a working version !
actually i do not know u can not use these. until u insert your worksheet here. tnx


restart:

df1:=a-y(x)=diff(y(x),x)*bc;

a-y(x) = (diff(y(x), x))*bc

(1)

dsolve(df1);

y(x) = a+exp(-x/bc)*_C1

(2)

df2:=diff(y(x),x)*bc-a+y(x);

(diff(y(x), x))*bc-a+y(x)

(3)

dsolve(df2);

y(x) = a+exp(-x/bc)*_C1

(4)

# do u think there is a difference between a=c and a-c=0 ? and according to one theorem in differential equation,if y1 and y2 are two answer to an ODE,c1*y1+c2*y2 is also an answer ! so if y(x) is an answer,-y(x) is also an answer,please note that _C1 is a constant number and u can assume _C2= - (_C1) .

 


Download dsolve.mw

@wo0olf maybe u want to notice Mr.Kitonum's suggestion about your input correctness.

khahesh mikonam aga, deggat kon bebin oun 1/1 boode ya 1/() kolle ebarat bode? good luck.

what these expressions means ? 
Max(f1-M,0)
max(g1,0) ?
are they maximize ? or maximum elements ?!

@fereydoon_shekofte tnx Mr.shekofte for these links,very nice. thank u.

@ecterrab tnx for this comprehensive and acutally perfect answer. i learned many thing from these and actually as a Ph.d candidate in mechanical engineering field,i appreciate maple physics package to be very useful and applicable in mechenics. 'actually i face this problem when my friend and i do the same thing but me in maple and my friend mathematrica ! actullay maple do the whole things super faster than mathematica ! i got some differentials using physics package and some integrals ( i also do it by parts ) in just a few seconds ! but my friend do it in mathematica in more than some hours ! and he asked me why this takes too many hours ! and thus i make decision to ask why maple or why mathematica or why not !
anyway,i am really thankfull for your comprehensive answer ! really thank u .

for more information about breakpoint,i have a link :

http://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html


i think maple will be more perfect and flexible by adding this feature in new versions . hope maple good staff see this post.

 

 

@Preben Alsholm break point in matlab,is a tool that help u break in any line of the code ( for example in your loop) and continue your code manually ( by pressing F10 i think ) . thus the code up to the line which has a break point will go automatically and after that,u can continue computing using f10 line by line ! and if you are into the loop,thus you can continue loop manually .

please upload your worksheet here,tnx



restart:

a := Matrix([1, 2, 3, 4, 5]);

 

for k to 5 do

 

x[k]:=rhs(op(1,op(3,DirectSearch:-SolveEquations([a(1, k)*x+2+y = 0, x+y = 0]))));
y[k]:=rhs(op(2,op(3,DirectSearch:-SolveEquations([a(1, k)*x+2+y = 0, x+y = 0]))));

 

end do;

 

a := Matrix(1, 5, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (1, 4) = 4, (1, 5) = 5})

 

HFloat(-0.9449969839679876)

 

HFloat(-0.05500301603201337)

 

HFloat(-2.0)

 

HFloat(2.0)

 

HFloat(-1.0)

 

HFloat(1.0)

 

HFloat(-0.6666666666666666)

 

HFloat(0.6666666666666666)

 

HFloat(-0.5)

 

HFloat(0.5)

(1)

 



Download similar.mw

@hacker9130368 

@Alejandro Jakubi i think it will take me months to know what is going on in your complicated,but perfect code. could you please explain more ?i am really appreciate it.tnx

4 5 6 7 8 9 10 Last Page 6 of 21