mehdi jafari

749 Reputation

13 Badges

11 years, 87 days

MaplePrimes Activity

These are answers submitted by mehdi jafari

as maple help page :

fsolve( equations, variables, complex ); 

For a single polynomial equation of one variable with real coefficients, by default the fsolve command computes all real (non-complex) roots. It may not return all roots for exceptionally ill-conditioned polynomials.
but when u activate complex option,it does not return any complex part thus your solution does not have any complex part !

you can not solve your symbolic equation using fsolve, as u can see in the file uploaded !
hope it clearify the problem more !
good luck !


your boundary conditions should be of type numeric, when you use like "psi(h1)" maple assumes that psi is also function of h1 in addition to y, you should use definite numbers for h1 and h2 so that u can got the answer 

Download maple.mws


u should use exact arthmetic like this link :
good luck!

i also got zero in maple 17 !

in your working directory,made a text file with this name : testfile.txt
i put numbers from 1 to 15 in every line of this text file, now i read every line of this text file and put them in a Vector named A.

> restart:
> A:=Vector(15):
> FileTools[Text][Open]( "testfile.txt" );

for i to 15 do
> A[i]:=FileTools[Text][ReadFloat]( "testfile.txt" );
> od;

for i to 15 do
> A[i]
> od;


Download maple.mws






for i from 2 while i<=(n/2) do
if modp(n,i)=0 then
end if

if s=0 then
print( prime )
not prime
end if;




it computes in 8seconds, but still maple isprime is so better !
but this code in C# responses in about 1 seconds.


write down system of differential equation in a regular mode so that we can help u in solving the system? i have created the function in maple , but my question is that u have the function phi, and your differential equations are in term phi, so what is the unkonw function that dsolve is going to solve ?! or where is the system of differential equation which are going to be solved?


i think your problem is here that u forgot to write u(t) here : 

SOLN := dsolve( { a1,b1,c1, ICS }, {x1(t),y1(t),z1(t),u(t)} );
i added u(t) and it was solved in a short time :

Download maple.mws


what do u exactly want to do? do u know use of integration by parts? i think u can not use in your case , u should use integration by parts when u had an integration or your equations should be in form of integral, also u should use known functions to help u in more detailed way, for example :

V := Int(exp(x)*cos(x), x);

Parts(V, cos(x));

or in definite integral 

V := Int(exp(x)*sin(x), x = a..b);
Parts(V, sin(x));
Parts(V, exp(x));

u can refer to ?IntegrationTools,Parts for more information on integration by parts .






# u can see all of the elements are zero by this : #
for i to 80 do

# or u can make a matrix like this :#






# u can also make your matrix function of sth by this :#



(a(t))(1, 1)


# u can now make your a(t)s zero only in time 0 ,not in all of the time by this : #

for i to 80 do

# u can see that all of the elements of the matrix are zero in time 0 #
for i to 80 do



Download matrix.mws

u can also use this method :

de := diff(y(x), x$2)+4*y(x) = exp(-3*x);

`Diff(5,x)` := rhs(dsolve({de, y(0) = 2, (D(y))(0) = 0}, y(x)));

de := diff(y(x), `$`(x, 2))+4*y(x) = exp(-3*x)

`Diff(5,x)` := (3/26)*sin(2*x)+(25/13)*cos(2*x)+(1/13)*exp(-3*x)



Download try.mws

as Mr.Carl Love said. u should just type your codes or equations,so that we can help u on the issue.

here is an example :


S := [54054.054*sin(.2*Pi), 54054.054*sin(.4*Pi), 54054.054*sin(.6*Pi), 54054.054*sin(.8*Pi), 0., 54054.054*sin(1.2*Pi), 54054.054*sin(1.4*Pi), 54054.054*sin(1.6*Pi), 54054.054*sin(1.8*Pi), 0.]



[31772.17577, 51408.46030, 51408.46029, 31772.17576, 0., -31772.17580, -51408.46031, -51408.46028, -31772.17575, 0.]



Download example.mws

i think it is not a good approach to compare the abilities and facilities of a software with the other one since every software has its own goal to achieve. but if we want to treat it as a competitional issue,maybe it will be useful,maybe not. i think maple soft company should investigate their users so that findout what are the range in age of major maple users so that they decide whether it is convinient to provide more facilities for them or not.
afterall it is a nice comment and maybe practical. 

 i2 means i2=diff(y(x), x$2)? or what ?

also u have many type problems,in equation 2 and 3 u have twice wrote i2 and i3 ?

if we consider i1=diff(y(x), x).i2=diff(y(x), x$2),i3=diff(y(x), x$3)

and also your second equation to be 2*i1+i2+2*i3 ... and the third to be 1/50*i3+4*i1-2*i2

we can do sth like this :


d1:=diff(y(t),t)-diff(y(t), t$2)-diff(y(t), t$3)=0;

d1 := diff(y(t), t)-(diff(y(t), `$`(t, 2)))-(diff(y(t), `$`(t, 3))) = 0


d2:=2*diff(y(t),t)+diff(y(t), t$2)+2*diff(y(t), t$3)-30-20*cos(5)-114*sin(5)=0;

d2 := 2*(diff(y(t), t))+diff(y(t), `$`(t, 2))+2*(diff(y(t), `$`(t, 3)))-30-20*cos(5)-114*sin(5) = 0


d3:=1/50*diff(y(t), t$3)+4*diff(y(t),t)-2*diff(y(t), t$2)=0;

d3 := (1/50)*(diff(y(t), `$`(t, 3)))+4*(diff(y(t), t))-2*(diff(y(t), `$`(t, 2))) = 0


sys:={seq}(d || i ,i=1..3);

sys := {diff(y(t), t)-(diff(y(t), `$`(t, 2)))-(diff(y(t), `$`(t, 3))) = 0, (1/50)*(diff(y(t), `$`(t, 3)))+4*(diff(y(t), t))-2*(diff(y(t), `$`(t, 2))) = 0, 2*(diff(y(t), t))+diff(y(t), `$`(t, 2))+2*(diff(y(t), `$`(t, 3)))-30-20*cos(5)-114*sin(5) = 0}


with(inttrans): with(plots):


Lap1 := {s*laplace(y(t), t, s)-y(0)-s^2*laplace(y(t), t, s)+(D(y))(0)+s*y(0)-s^3*laplace(y(t), t, s)+((D@@2)(y))(0)+s*(D(y))(0)+s^2*y(0) = 0, (1/50)*(s^3*laplace(y(t), t, s))-(1/50)*((D@@2)(y))(0)-(1/50)*(s*(D(y))(0))-(1/50)*(s^2*y(0))+4*s*laplace(y(t), t, s)-4*y(0)-2*s^2*laplace(y(t), t, s)+2*(D(y))(0)+2*s*y(0) = 0, 2*s*laplace(y(t), t, s)-2*y(0)+s^2*laplace(y(t), t, s)-(D(y))(0)-s*y(0)+2*s^3*laplace(y(t), t, s)-2*((D@@2)(y))(0)-2*s*(D(y))(0)-2*s^2*y(0)-30/s-20*cos(5)/s-114*sin(5)/s = 0}



Lp1 := {s*Y(s)-y(0)-s^2*Y(s)+(D(y))(0)+s*y(0)-s^3*Y(s)+((D@@2)(y))(0)+s*(D(y))(0)+s^2*y(0) = 0, (1/50)*(s^3*Y(s))-(1/50)*((D@@2)(y))(0)-(1/50)*(s*(D(y))(0))-(1/50)*(s^2*y(0))+4*s*Y(s)-4*y(0)-2*s^2*Y(s)+2*(D(y))(0)+2*s*y(0) = 0, 2*s*Y(s)-2*y(0)+s^2*Y(s)-(D(y))(0)-s*y(0)+2*s^3*Y(s)-2*((D@@2)(y))(0)-2*s*(D(y))(0)-2*s^2*y(0)-30/s-20*cos(5)/s-114*sin(5)/s = 0}



ans := {(s^2*y(0)+s*y(0)+s*(D(y))(0)-y(0)+(D(y))(0)+((D@@2)(y))(0))/(s*(s^2+s-1)), (s^2*y(0)-100*s*y(0)+s*(D(y))(0)+200*y(0)-100*(D(y))(0)+((D@@2)(y))(0))/(s*(s^2-100*s+200)), (2*s^3*y(0)+s^2*y(0)+2*s^2*(D(y))(0)+2*s*y(0)+s*(D(y))(0)+2*((D@@2)(y))(0)*s+20*cos(5)+114*sin(5)+30)/(s^2*(2*s^2+s+2))}


for i to 3 do

soln[1] := y(0)-(D(y))(0)-((D@@2)(y))(0)+(1/5)*((5*((D(y))(0)+((D@@2)(y))(0))*cosh(t*5^(1/2)/2)+sinh(t*5^(1/2)/2)*5^(1/2)*(3*(D(y))(0)+((D@@2)(y))(0)))*exp(-t/2))

soln[2] := y(0)-(1/2)*(D(y))(0)+(1/200)*((D@@2)(y))(0)+(1/4600)*((23*cosh(10*t*23^(1/2))*(100*(D(y))(0)-((D@@2)(y))(0))+5*23^(1/2)*(-96*(D(y))(0)+((D@@2)(y))(0))*sinh(10*t*23^(1/2)))*exp(50*t))

soln[3] := -15/2+y(0)+(1/2)*(D(y))(0)+((D@@2)(y))(0)-5*cos(5)-(57/2)*sin(5)+(1/30)*((15*cos(15^(1/2)*t/4)*(-(D(y))(0)-2*((D@@2)(y))(0)+10*cos(5)+57*sin(5)+15)+15^(1/2)*(-70*cos(5)-399*sin(5)+7*(D(y))(0)-2*((D@@2)(y))(0)-105)*sin(15^(1/2)*t/4))*exp(-t/4))+(10*cos(5)+57*sin(5)+15)*t



Download laplace.mws

u can plot these answer by assigning initial conditions like your last question.
u can easily subs your initial conditions in the answers and plot them.

u can do like this :

 ics := y(0)=0, D(y)(0)=0;



for two others,u can do sth simillar.

u can solve the odes in this way 


which gives u the general answer,but u can not plot the answer since it has a general form, and for plotting u should choose initial conditions like i did and thus u will need dsolve(numeric). 

u can write your sequence like this :

seq(f, i = m..n, step):

so that 


u can also refer to

?kronecker to see more about kronecker function in maple.

u can also create matrix in one of these forms :

M1 := `<|>`(0.1e-2, 0.5e-1, .151, .201, .301, .951, 2);

or as Markiyan says 

M2 := Matrix([0.1e-2, 0.5e-1, .151, .201, .301, .951, 2]);

and there are so many ways to define a matrix, u can also apply a funtion to your matrix with the command map .

but we do not know here what do u want exacly?

First 7 8 9 Page 9 of 9