mehdi jafari

769 Reputation

13 Badges

11 years, 237 days

MaplePrimes Activity


These are answers submitted by mehdi jafari

i changed your x to x[k] so that u can know your x in every loop. good luck

restart:

 

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

 

for k  to 5 do

 

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

 

end do;

 

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

 

HFloat(-2.0)

 

HFloat(-1.0)

 

HFloat(-0.6666666666666666)

 

HFloat(-0.5)

 

HFloat(-0.4)

(1)

 


Download use_op.mw


restart:

restart;  local `+`;  `+`:=proc(a,b) :-`+`(a^`~2`,b^`~2`) end proc;

proc (a, b) :-`+`(a^`~2`, b^`~2`) end proc

(1)

`+`(a,b);

a^`~2`+b^`~2`

(2)

 


Download parse.mw


restart:

q := a*mu^4+b*mu^3+d*mu^2+e*mu+f = 0;PARAM := [a = -54/c^2-1269*A[1]/(8*c^2), b = 108/c^2+5013*A[1]/(8*c^2), d = 27-693/(2*c^2)+117*A[1]-7113*A[1]/(4*c^2), e = -27+585/(2*c^2)-111*A[1]+20439*A[1]/(16*c^2), f = 1-3*A[1]-18/c^2-8*A[1]/c^2];

ans:=solve(eval(q,PARAM),mu);solve(eval(q,PARAM),mu,parametric=full);

a*mu^4+b*mu^3+d*mu^2+e*mu+f = 0

 

[a = -54/c^2-(1269/8)*A[1]/c^2, b = 108/c^2+(5013/8)*A[1]/c^2, d = 27-(693/2)/c^2+117*A[1]-(7113/4)*A[1]/c^2, e = -27+(585/2)/c^2-111*A[1]+(20439/16)*A[1]/c^2, f = 1-3*A[1]-18/c^2-8*A[1]/c^2]

 

RootOf((2538*A[1]+864)*_Z^4+(-10026*A[1]-1728)*_Z^3+(-1872*c^2*A[1]-432*c^2+28452*A[1]+5544)*_Z^2+(1776*c^2*A[1]+432*c^2-20439*A[1]-4680)*_Z+48*A[1]*c^2-16*c^2+128*A[1]+288)

 

`[Length of output exceeds limit of 1000000]`

(1)

ans1:=series(ans, A[1]=0,  2);ans2:=series(ans1, c=infinity,  3);

series(RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)+((1/2208)*(89856*c^6*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)+153144*c^4*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^3-71424*c^6+1242468*c^4*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^2-4299420*c^4*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)-1932624*c^2*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^3+2223508*c^4-25730820*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^2*c^2+58185324*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)*c^2+5288922*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^3-23450550*c^2+130487517*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)^2-240569955*RootOf(108*_Z^4-216*_Z^3+(-54*c^2+693)*_Z^2+(54*c^2-585)*_Z-2*c^2+36)+82918908)/(108*c^6-3280*c^4+32871*c^2-108891))*A[1]+O(A[1]^2),A[1],2)

 

((1/108)*RootOf(_Z^4-5832*_Z^2)+(1/2208)*((208/27)*RootOf(_Z^4-5832*_Z^2)+(709/629856)*RootOf(_Z^4-5832*_Z^2)^3)*A[1])*c+O(1)

(2)

 

 

 

NULL


Download eval.mw

u can use 
interface(warnlevel=0);

to suppress all warning messages,but here as carl says your warning's was due to assigning local varibales,good luck

when u assign i to be an input thus it is a known number, but u have assigned also i in sequence which has the values from 1 to ,,, ! thus it returns an error.
after removing i from input ,there are some other errors,which u should check your code line by line ,good luck


restart:x::real;

eq:=-32.46753247/(Pi*x^2)+1.053598444*10^8*Pi^2*y/x^2-5.342210338*10^14*Pi^2*y*(2.574000000*10^8*Pi^2-.7700000000*x^2)/((-3.904240733*10^6*x^2+1.305131902*10^15*Pi^2-159.8797200*Pi^2*x^2+2.672275320*10^10*Pi^4+2.391363333*10^(-7)*x^4)*x^2)+1.504285714*10^9*Pi^4*y^3/x^2=y ;

x::real

 

-32.46753247/(Pi*x^2)+105359844.4*Pi^2*y/x^2-0.5342210338e15*Pi^2*y*(257400000.0*Pi^2-.7700000000*x^2)/((-3904240.733*x^2+0.1305131902e16*Pi^2-159.8797200*Pi^2*x^2+0.2672275320e11*Pi^4+0.2391363333e-6*x^4)*x^2)+1504285714.*Pi^4*y^3/x^2 = y

(1)

plots:-implicitplot(eq,x=0..10,y=0..x);

 

 


Download implicitplot.mw


restart:a:=8:b:=10:

integral:=evalf(Int(1/(-98*x+75*x*ln(1+2*x)),x=a..b,digits=50,method = _Gquad));

0.18256292616567537274951218880902874601774538604592e-2

(1)

 


Download int.mw

A.as maple help page :

To export a plot:
1. Select the plot you want to export.
2. From the Plot menu, select Export.
Alternatively, right-click (Control-click, for Macintosh) the plot you want to export. The context menu appears. Select Export.
3. Select a format.
4. Specify the location and the name of the exported file.
Click Save.

 

B. you can easily right click on your plot,select copy and open a word file and select paste . now your plot has been copied.

C. u can export your plot data into excel and thus save your plot as a picture file,

D. if u have windows 7 , go to start-all programs-Accessories-Snipping tool, double click on it, and it will provied you a frame to choose and give you back the pictrue u want from every where.

E. you can also take a picture from your screen by PrtSc and save it into a document and then snip your plot from it . 

good luck!


restart:

with(plottools):

with(plots):

display(cylinder([1, 1, 1], 1, 3), orientation = [45, 70], scaling = constrained, grid = [2, 2, 2]);

 

 

op(op(1,%));

[[2., 1., HFloat(1.0)], [1.965925826, 1.258819045, HFloat(1.0)], [1.866025404, 1.500000000, HFloat(1.0)], [1.707106781, 1.707106781, HFloat(1.0)], [1.500000000, 1.866025404, HFloat(1.0)], [1.258819045, 1.965925826, HFloat(1.0)], [.9999999998, 2., HFloat(1.0)], [.7411809545, 1.965925826, HFloat(1.0)], [.4999999995, 1.866025404, HFloat(1.0)], [.2928932182, 1.707106781, HFloat(1.0)], [.1339745957, 1.499999999, HFloat(1.0)], [0.340741734e-1, 1.258819044, HFloat(1.0)], [0., .9999999986, HFloat(1.0)], [0.340741741e-1, .7411809533, HFloat(1.0)], [.1339745971, .4999999984, HFloat(1.0)], [.2928932202, .2928932174, HFloat(1.0)], [.5000000019, .1339745951, HFloat(1.0)], [.7411809572, 0.340741731e-1, HFloat(1.0)], [1.000000003, 0., HFloat(1.0)], [1.258819048, 0.340741744e-1, HFloat(1.0)], [1.500000003, .1339745977, HFloat(1.0)], [1.707106784, .2928932211, HFloat(1.0)], [1.866025406, .5000000030, HFloat(1.0)], [1.965925827, .7411809584, HFloat(1.0)], [2., 1.000000004, HFloat(1.0)], [2., 1., HFloat(1.0)]], [[2., 1., HFloat(4.0)], [1.965925826, 1.258819045, HFloat(4.0)], [1.866025404, 1.500000000, HFloat(4.0)], [1.707106781, 1.707106781, HFloat(4.0)], [1.500000000, 1.866025404, HFloat(4.0)], [1.258819045, 1.965925826, HFloat(4.0)], [.9999999998, 2., HFloat(4.0)], [.7411809545, 1.965925826, HFloat(4.0)], [.4999999995, 1.866025404, HFloat(4.0)], [.2928932182, 1.707106781, HFloat(4.0)], [.1339745957, 1.499999999, HFloat(4.0)], [0.340741734e-1, 1.258819044, HFloat(4.0)], [0., .9999999986, HFloat(4.0)], [0.340741741e-1, .7411809533, HFloat(4.0)], [.1339745971, .4999999984, HFloat(4.0)], [.2928932202, .2928932174, HFloat(4.0)], [.5000000019, .1339745951, HFloat(4.0)], [.7411809572, 0.340741731e-1, HFloat(4.0)], [1.000000003, 0., HFloat(4.0)], [1.258819048, 0.340741744e-1, HFloat(4.0)], [1.500000003, .1339745977, HFloat(4.0)], [1.707106784, .2928932211, HFloat(4.0)], [1.866025406, .5000000030, HFloat(4.0)], [1.965925827, .7411809584, HFloat(4.0)], [2., 1.000000004, HFloat(4.0)], [2., 1., HFloat(4.0)]], [[2., 1., HFloat(1.0)], [2., 1., HFloat(4.0)], [1.965925826, 1.258819045, HFloat(4.0)], [1.965925826, 1.258819045, HFloat(1.0)]], [[1.965925826, 1.258819045, HFloat(1.0)], [1.965925826, 1.258819045, HFloat(4.0)], [1.866025404, 1.500000000, HFloat(4.0)], [1.866025404, 1.500000000, HFloat(1.0)]], [[1.866025404, 1.500000000, HFloat(1.0)], [1.866025404, 1.500000000, HFloat(4.0)], [1.707106781, 1.707106781, HFloat(4.0)], [1.707106781, 1.707106781, HFloat(1.0)]], [[1.707106781, 1.707106781, HFloat(1.0)], [1.707106781, 1.707106781, HFloat(4.0)], [1.500000000, 1.866025404, HFloat(4.0)], [1.500000000, 1.866025404, HFloat(1.0)]], [[1.500000000, 1.866025404, HFloat(1.0)], [1.500000000, 1.866025404, HFloat(4.0)], [1.258819045, 1.965925826, HFloat(4.0)], [1.258819045, 1.965925826, HFloat(1.0)]], [[1.258819045, 1.965925826, HFloat(1.0)], [1.258819045, 1.965925826, HFloat(4.0)], [.9999999998, 2., HFloat(4.0)], [.9999999998, 2., HFloat(1.0)]], [[.9999999998, 2., HFloat(1.0)], [.9999999998, 2., HFloat(4.0)], [.7411809545, 1.965925826, HFloat(4.0)], [.7411809545, 1.965925826, HFloat(1.0)]], [[.7411809545, 1.965925826, HFloat(1.0)], [.7411809545, 1.965925826, HFloat(4.0)], [.4999999995, 1.866025404, HFloat(4.0)], [.4999999995, 1.866025404, HFloat(1.0)]], [[.4999999995, 1.866025404, HFloat(1.0)], [.4999999995, 1.866025404, HFloat(4.0)], [.2928932182, 1.707106781, HFloat(4.0)], [.2928932182, 1.707106781, HFloat(1.0)]], [[.2928932182, 1.707106781, HFloat(1.0)], [.2928932182, 1.707106781, HFloat(4.0)], [.1339745957, 1.499999999, HFloat(4.0)], [.1339745957, 1.499999999, HFloat(1.0)]], [[.1339745957, 1.499999999, HFloat(1.0)], [.1339745957, 1.499999999, HFloat(4.0)], [0.340741734e-1, 1.258819044, HFloat(4.0)], [0.340741734e-1, 1.258819044, HFloat(1.0)]], [[0.340741734e-1, 1.258819044, HFloat(1.0)], [0.340741734e-1, 1.258819044, HFloat(4.0)], [0., .9999999986, HFloat(4.0)], [0., .9999999986, HFloat(1.0)]], [[0., .9999999986, HFloat(1.0)], [0., .9999999986, HFloat(4.0)], [0.340741741e-1, .7411809533, HFloat(4.0)], [0.340741741e-1, .7411809533, HFloat(1.0)]], [[0.340741741e-1, .7411809533, HFloat(1.0)], [0.340741741e-1, .7411809533, HFloat(4.0)], [.1339745971, .4999999984, HFloat(4.0)], [.1339745971, .4999999984, HFloat(1.0)]], [[.1339745971, .4999999984, HFloat(1.0)], [.1339745971, .4999999984, HFloat(4.0)], [.2928932202, .2928932174, HFloat(4.0)], [.2928932202, .2928932174, HFloat(1.0)]], [[.2928932202, .2928932174, HFloat(1.0)], [.2928932202, .2928932174, HFloat(4.0)], [.5000000019, .1339745951, HFloat(4.0)], [.5000000019, .1339745951, HFloat(1.0)]], [[.5000000019, .1339745951, HFloat(1.0)], [.5000000019, .1339745951, HFloat(4.0)], [.7411809572, 0.340741731e-1, HFloat(4.0)], [.7411809572, 0.340741731e-1, HFloat(1.0)]], [[.7411809572, 0.340741731e-1, HFloat(1.0)], [.7411809572, 0.340741731e-1, HFloat(4.0)], [1.000000003, 0., HFloat(4.0)], [1.000000003, 0., HFloat(1.0)]], [[1.000000003, 0., HFloat(1.0)], [1.000000003, 0., HFloat(4.0)], [1.258819048, 0.340741744e-1, HFloat(4.0)], [1.258819048, 0.340741744e-1, HFloat(1.0)]], [[1.258819048, 0.340741744e-1, HFloat(1.0)], [1.258819048, 0.340741744e-1, HFloat(4.0)], [1.500000003, .1339745977, HFloat(4.0)], [1.500000003, .1339745977, HFloat(1.0)]], [[1.500000003, .1339745977, HFloat(1.0)], [1.500000003, .1339745977, HFloat(4.0)], [1.707106784, .2928932211, HFloat(4.0)], [1.707106784, .2928932211, HFloat(1.0)]], [[1.707106784, .2928932211, HFloat(1.0)], [1.707106784, .2928932211, HFloat(4.0)], [1.866025406, .5000000030, HFloat(4.0)], [1.866025406, .5000000030, HFloat(1.0)]], [[1.866025406, .5000000030, HFloat(1.0)], [1.866025406, .5000000030, HFloat(4.0)], [1.965925827, .7411809584, HFloat(4.0)], [1.965925827, .7411809584, HFloat(1.0)]], [[1.965925827, .7411809584, HFloat(1.0)], [1.965925827, .7411809584, HFloat(4.0)], [2., 1.000000004, HFloat(4.0)], [2., 1.000000004, HFloat(1.0)]]

(1)

 


Download op.mw


restart:

ans:=dsolve(diff(y(x),x)=(y(x)^3+y(x)*x^2)/x^3);isolate(op(2,{ans}),ln(x));

y(x) = x/(-2*ln(x)+_C1)^(1/2), y(x) = -x/(-2*ln(x)+_C1)^(1/2)

 

ln(x) = -(1/2)*x^2/y(x)^2+(1/2)*_C1

 

ln(x) = -(1/2)*x^2/y(x)^2+(1/2)*_C1

(1)

# thus,the forth choice is correct !

ans2:=dsolve(diff(y(x),x)=(y(x)^2+y(x)*x-x^2)/(y(x)*x));

y(x) = exp(-LambertW(exp(_C1)*exp(-1)*x)+_C1-1)*x^2+x

(2)

 

isolate((ans2),_C1);

_C1 = (ln((y(x)-x)/x^2)*x+y(x))/x

(3)

#thus the best answer is the first choice # note that ln(a)-ln(b)=ln(a/b)# and x^2=abs(x)*abs(x)#

 


Download dsolve.mw

u can see the curve's function's and curve fitting equations are almost the same,good luck !

restart

F1 := plot(x^3+5*x, x = -5 .. 5, color = blue):

``

plots:-display({F1, F2, F3});

 

A1 := op([1, 1], %);

Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(1)

A1(1 .. 5, 1 .. 2);

Matrix(5, 2, {(1, 1) = -3., (1, 2) = -242.751064658161, (2, 1) = -2.96845436984925, (2, 2) = -230.232980233834, (3, 1) = -2.94100668572864, (3, 2) = -219.765005179671, (4, 1) = -2.91013889427136, (4, 2) = -208.449831829473, (5, 1) = -2.87906649105528, (5, 2) = -197.533724262111})

(2)

with(CurveFitting):

LeastSquares(A1, v, curve = a*v^3+b*v+c);

HFloat(5.904283625491002e-15)+HFloat(5.000000000000003)*v+HFloat(1.0000000000000002)*v^3

(3)

LeastSquares(A2, v, curve = a*v^5+b*exp(v)+c);

-HFloat(1.212900886475967)+HFloat(0.04419568836281536)*v^5+HFloat(0.08004496502284462)*exp(v)

(4)

LeastSquares(A3, v, curve = a*v^3+b*sin(v)+c);

HFloat(16.868484377321742)+HFloat(9.628301286816583)*v^3-HFloat(16.33957865443164)*sin(v)

(5)

PolynomialInterpolation(A1, z):

``


Download curve_fitting.mw

 


restart:

Student[Calculus1]:-Tangent(tan(3*x)-5*exp(-x^3),x=0,output=plot,axis = [gridlines = [18, color = blue]],caption="Tangent plot");

 

 


Download plot.mw

for your last step u can do :


restart:

#Parameters

L := 20; Q := 20; n := 8; h := 3; EAv := 1;

Mat := Matrix(10, 2, storage = sparse);

a := 1;

#loop L1

for L1 from .6 by .1 to 1.5 do

L1 := L1;

L2 := 2*L1;

L3 := 1.6*L2;

L4 := (1/2)*L-L1-L2-L3;

alfa1 := evalf(arctan(h/L1));

alfa2 := evalf(arctan(h/L2));

alfa3 := evalf(arctan(h/L3));

alfa4 := evalf(arctan(h/L4));

F4 := (1/2)*Q*L4;

F3 := (1/2)*Q*L3+(1/2)*Q*L4+F4;

F2 := (1/2)*Q*L2+(1/2)*Q*L3+F3;

F1 := (1/2)*Q*L1+(1/2)*Q*L2+F2;

w1 := evalf((1+sin(alfa1)^3)*F1*L1/(EAv*sin(alfa1)^2*cos(alfa1)));

w2 := evalf((1+sin(alfa2)^3)*F2*L2/(EAv*sin(alfa2)^2*cos(alfa2)));

w3 := evalf((1+sin(alfa3)^3)*F3*L3/(EAv*sin(alfa3)^2*cos(alfa3)));

w4 := evalf((1+sin(alfa4)^3)*F4*L4/(EAv*sin(alfa4)^2*cos(alfa4)));

kkm := (w1-w2)^2+(w2-w3)^2+(w3-w4)^2; Mat(a, 1) := L1;

Mat(a, 2) := kkm;

a := a+1;

end do:

 

L := 20

 

Q := 20

 

n := 8

 

h := 3

 

EAv := 1

 

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

 

1

(1)

plots:-pointplot([seq]([Mat(i,1),Mat(i,2)],i=1..10));

 

plot([seq]([Mat(i,1),Mat(i,2)],i=1..10));

 

 

``


Download plot.mw


restart:

eq1 := 3*(1+sin(alfa1)^3)(30/tan(alfa1)+60/tan(alfa2)+60/tan(alfa3))/(sin(alfa1)^2*cos(alfa1)*tan(alfa1)) = 3*(1+sin(alfa2)^3)(30/tan(alfa2)+60/tan(alfa3))/(sin(alfa2)^2*cos(alfa2)*tan(alfa2));

 

eq2 := 3*(1+sin(alfa1)^3)(30/tan(alfa1)+60/tan(alfa2)+60/tan(alfa3))/(sin(alfa1)^2*cos(alfa1)*tan(alfa1)) = (90*(1+sin(alfa3)^3))/(sin(alfa3)^2*cos(alfa3)*tan(alfa3));

 

eq3 := 3/tan(alfa1)+3/tan(alfa2)+3/tan(alfa3) = 25/2;

 

 

3*(1+(sin(alfa1))(30/tan(alfa1)+60/tan(alfa2)+60/tan(alfa3))^3)/(sin(alfa1)^2*cos(alfa1)*tan(alfa1)) = 3*(1+(sin(alfa2))(30/tan(alfa2)+60/tan(alfa3))^3)/(sin(alfa2)^2*cos(alfa2)*tan(alfa2))

 

3*(1+(sin(alfa1))(30/tan(alfa1)+60/tan(alfa2)+60/tan(alfa3))^3)/(sin(alfa1)^2*cos(alfa1)*tan(alfa1)) = 90*(1+sin(alfa3)^3)/(sin(alfa3)^2*cos(alfa3)*tan(alfa3))

 

3/tan(alfa1)+3/tan(alfa2)+3/tan(alfa3) = 25/2

(1)

solutions := fsolve({eq1, eq2, eq3}, {alfa1, alfa2, alfa3}) assuming alfa1 > 0, alfa2 > 0, alfa3 > 0;

{alfa1 = -8.933753377, alfa2 = -8.933753377, alfa3 = -8.256941104}

(2)

 


Download fsolve.mw

for soliving your pde numerically , you should specify your P(x) and R in terms of known functions of x !
and also you need to have your boundaries !

if we change R(P) by R(x) , we can have :

restart:

sys:={dy(x)/dx +y^2 =P(x), dP(x)/dx = R(P)};

{dP(x)/dx = R(P), dy(x)/dx+y^2 = P(x)}

(1)

dsolve({sys});

Error, (in dsolve) ambiguous input: the variables {P} and the functions {P(x), R(P)} cannot both appear in the system

 

sys:={dy(x)/dx +y^2 =P(x), dP(x)/dx = R(x)};dsolve({sys});

{dP(x)/dx = R(x), dy(x)/dx+y^2 = P(x)}

 

[{{P(x) = P(x), R(x) = R(x), dP(x) = R(x)*dx, dy(x) = dx*(-y^2+P(x))}}]

(2)

 

for more detailed answer, u should specify P(x) and R(x), and u can also see ?dsolve

Download dsolve.mw

1 2 3 4 5 6 7 Page 3 of 9