MaplePrimes Questions

i'm doing an optimaztion for my final project. when i execute the coding, it says: 

Warning, initial point [m1 = .900000000000000, m2 = .900000000000000, m3 = .900000000000000, sigma1 = .900000000000000, sigma2 = .900000000000000, sigma3 = .900000000000000] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in DirectSearch:-Search) cannot find feasible initial point; last infeasible trial point is [m1 = HFloat(0.9), m2 = HFloat(1.9), m3 = HFloat(1.9), sigma1 = HFloat(1.9), sigma2 = HFloat(0.9), sigma3 = HFloat(0.9)].

here my full coding:


restart;
with(linalg);
with(Optimization);
with(DirectSearch);
[BoundedObjective, CompromiseProgramming, DataFit, 

  ExponentialWeightedSum, GlobalOptima, GlobalSearch, Minimax, 

  ModifiedTchebycheff, Search, SolveEquations, WeightedProduct, 

  WeightedSum]
q := Array(0 .. .111, [0.586e-2, 0.67475e-3, 0.52476e-3, 0.419785e-3, 0.354814e-3, 0.324859e-3, 0.319948e-3, 0.31e-3, 0.295013e-3, 0.28e-3, 0.259974e-3, 0.25496e-3, 0.26e-3, 0.270027e-3, 0.280026e-3, 0.284987e-3, 0.274934e-3, 0.279893e-3, 0.294824e-3, 0.324765e-3, 0.374672e-3, 0.439555e-3, 0.509439e-3, 0.56934e-3, 0.60923e-3, 0.634201e-3, 0.634233e-3, 0.624319e-3, 0.61442e-3, 0.624491e-3, 0.6495e-3, 0.684465e-3, 0.714452e-3, 0.729463e-3, 0.749451e-3, 0.789387e-3, 0.864347e-3, 0.964331e-3, 0.1064261e-2, 0.119413e-2, 0.1333876e-2, 0.150354e-2, 0.1683293e-2, 0.1883023e-2, 0.2102591e-2, 0.2356929e-2, 0.2656062e-2, 0.3004981e-2, 0.3403637e-2, 0.3841874e-2, 0.4349482e-2, 0.4931339e-2, 0.5587622e-2, 0.6293742e-2, 0.7044467e-2, 0.780967e-2, 0.8563865e-2, 0.9291539e-2, 0.9987678e-2, 0.10677379e-1, 0.1139506e-1, 0.12195833e-1, 0.13108819e-1, 0.14262384e-1, 0.15557439e-1, 0.17002799e-1, 0.18574592e-1, 0.20263971e-1, 0.22103523e-1, 0.24043337e-1, 0.26165465e-1, 0.28548531e-1, 0.31489568e-1, 0.3458584e-1, 0.37891201e-1, 0.41511365e-1, 0.45444649e-1, 0.49867283e-1, 0.54877269e-1, 0.60478547e-1, 0.66532745e-1, 0.7397857e-1, 0.81900977e-1, 0.90034141e-1, 0.98921462e-1, .108746024, .11839162, .130752255, .14368791, .157201822, .169770195, .177233464, .188823516, .204733363, .224639756, .249617627, .273409998, .298674064, .304378882, .319592743, .342821691, .367512872, .395257421, .426270115, .460795318, .498484563, .537417055, .577542345, .618093683, .660441764, .703856817, 1]);
variables = [m1, m2, m3, sigma1, sigma2, sigma3];
        variables = [m1, m2, m3, sigma1, sigma2, sigma3]
psi1 := 0.11480601e-1; psi2 := 0.8890123e-2; psi3 := .979629276;
                          0.011480601
                          0.008890123
                          0.979629276
s1(x):=exp(-(x/(m1))^((m1/(sigma1)))):  s1(x+1):=exp(-((x+1)/(m1))^((m1/(sigma1)))):  s2(x):=1-exp(-(x/(m2))^((-m2/(sigma2)))):  s2(x+1):=1-exp(-((x+1)/(m2))^((-m2/(sigma2)))):  s3(x):=exp(exp(-m3/(sigma3))-exp((x-m3)/(sigma3))): s3(x+1):=exp(exp(-m3/(sigma3))-exp((x+1-m3)/(sigma3)))  :  s(x):=(psi1*s1(x)+psi2*s2(x)+psi3*s3(x)): s(x+1):=(psi1*s1(x+1)+psi2*s2(x+1)+psi3*s3(x+1)):   qtopi(x):=1-((s(x+1))/(s(x))):
fungsikerugian := add((1-qtopi(x)/q[x])^2, x = 0 .. .110);
for x from 0 to 111 do c1[x] := 0 <= s1(x+1); c2[x] := 1 >= s1(x+1); c3[x] := 0 <= s2(x+1); c4[x] := 1 >= s2(x+1); c5[x] := 0 <= s3(x+1); c6[x] := 1 >= s3(x+1); c7[x] := 0 <= s1(x); c8[x] := 1 >= s1(x); c9[x] := 0 <= s2(x); c10[x] := 1 >= s2(x); c11[x] := 0 <= s3(x); c12[x] := 1 >= s3(x); c13[x] := 0 <= s(x); c14[x] := 1 >= s(x); c15[x] := 0 <= s(x+1); c16[x] := 1 >= s(x+1); c17[x] := 0 <= qtopi(x); c18[x] := 1 >= qtopi(x) end do;

constr := {m2 > sigma2, m3 > sigma3, seq(c1[x], x = 0 .. .110), seq(c10[x], x = 0 .. .111), seq(c11[x], x = 0 .. .111), seq(c12[x], x = 0 .. .111), seq(c13[x], x = 0 .. .111), seq(c14[x], x = 0 .. .111), seq(c15[x], x = 0 .. .110), seq(c16[x], x = 0 .. .110), seq(c17[x], x = 0 .. .110), seq(c18[x], x = 0 .. .110), seq(c2[x], x = 0 .. .110), seq(c3[x], x = 0 .. .110), seq(c4[x], x = 0 .. .110), seq(c5[x], x = 0 .. .110), seq(c6[x], x = 0 .. .110), seq(c7[x], x = 0 .. .111), seq(c8[x], x = 0 .. .111), seq(c9[x], x = 0 .. .111), m1 < sigma1, 0 <= m1 and m1 < 17, 17 <= m2 and m2 < 33, 33 <= m3 and m3 < 111};
solusi := DirectSearch:-Search(fungsikerugian, constr, assume = positive, evaluationlimit = 5555);
Warning, initial point [m1 = .900000000000000, m2 = .900000000000000, m3 = .900000000000000, sigma1 = .900000000000000, sigma2 = .900000000000000, sigma3 = .900000000000000] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in DirectSearch:-Search) cannot find feasible initial point; last infeasible trial point is [m1 = HFloat(0.9), m2 = HFloat(1.9), m3 = HFloat(1.9), sigma1 = HFloat(1.9), sigma2 = HFloat(0.9), sigma3 = HFloat(0.9)]

thanks before

The command

taylor( (2 * pi * n) ^ (1/(2n), n = 2)

return   1+((1/2)*ln(2*Pi)+(1/2)*ln(n))/n+O(1/n^2)

I think, this is incorrect, in my oppinion must be:

1+((1/2)*ln(2*Pi)+(1/2)*ln(n))/n+O(ln(n)^2/n^2)

Is this error in maple?

 

Assume that a[1],a[2],..a[k] are positive integer numbers. Let n be a positive integer number. 

Suppose that igcd(a[1],a[2],..a[k])=1. 

My question: Is there a command in Maple such that the output of the this command be true provided that there are "non-negative integer numbers" x[1],x[2],..x[k] which satisfy the following condition:

a1*x1+a2*x2+...+ak*xk=n

Thanks in advance

How to let sqrt(5*x+5+y) become sqrt(5*(x+1)+y) automatically?

Dear all,

Following the comments I am editing this post:

I have a function F of variables (r1,r2,theta1,theta2,r,theta,a). r1, r2,theta1,theta2 are function of r,  theta and a. I want to take derivative of F with respect to a. r and theta are independent of a . I expressed everything in terms of 'a' as a function of 'a' at first. Then I use diff(F, a). I see there is an error in the final expression G .There is a restriction that theta1 should lie between -Pi to Pi and theta2 between 0 to 2*Pi. I speculate this is the source of error. Work sheet is attached. Reason: value of G: integration in 0 to pi/4 gives some  value but for 0 to pi it evaluates to zero and so is the case with 0 to 2*Pi. As "G "physically represents energy it must be a positive value.
 


restart;

theta1 := unapply(arctan(r*sin(theta)/(r*cos(theta)-a)), a);

proc (a) options operator, arrow; arctan(r*sin(theta)/(r*cos(theta)-a)) end proc

(1)

 

## theta1 -->[-Pi,Pi] and theta2-->[0,2*Pi]

NULL

theta2 := unapply(arctan(r*sin(theta)/(r*cos(theta)+a)), a);

proc (a) options operator, arrow; arctan(r*sin(theta)/(r*cos(theta)+a)) end proc

(2)

``

r1:=unapply(sqrt((r*cos(theta)-a)^2+r^2*(sin(theta))^2),a);r2:=unapply(sqrt((r*cos(theta)+a)^2+r^2*(sin(theta))^2),a);

proc (a) options operator, arrow; ((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2) end proc

 

proc (a) options operator, arrow; ((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2) end proc

(3)

sigma12:=0;sigma22:=sigma;

0

 

sigma

(4)

plot(arctan(tan(x)), x = (1/2)*Pi .. Pi)

 

## I have to use a constraint that

assume(theta1(a) < Pi, theta1(a) > -Pi, theta2(a) > 0, theta2(a) < 2*Pi, a>0,r>0)

u1:=(1+nu)*sigma22*sqrt(r1(a)*r2(a))*(4*(1-2*nu)*cos((theta1(a)+(theta2(a)))/2)-4*r*(1-nu)*cos(theta)/sqrt(r1(a)*r2(a))-2*r^2/(r1(a)*r2(a))*(cos((theta1(a)+(theta2(a)))/2)-cos(2*theta-theta1(a)/2-(theta2(a))/2)))/(4*E)+(1+nu)*sigma12*sqrt(r1(a)*r2(a))*(2*(1-2*nu)*sin((theta1(a)+(theta2(a)))/2)-2*r*(1-nu)*sin(theta)/sqrt(r1(a)*r2(a))+1*r^2/(r1(a)*r2(a))*sin(theta)*cos(theta-theta1(a)/2-(theta2(a))/2))/(E);

 

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(5)

NULL

u2:=(1+nu)*sigma*sqrt(r1(a)*r2(a))*(8*(1-nu)*sin((theta1(a)+(theta2(a)))/2)-4*r*(nu)*sin(theta)/sqrt(r1(a)*r2(a))-2*r^2/(r1(a)*r2(a))*(sin((theta1(a)+(theta2(a)))/2)+sin(2*theta-theta1(a)/2-(theta2(a))/2)))/(4*E)+(1+nu)*sigma12*sqrt(r1(a)*r2(a))*((1-2*nu)*cos((theta1(a)+theta2(a))/2)+2*r*(1-nu)*cos(theta)/sqrt(r1(a)*r2(a))-1*r^2/(r1(a)*r2(a))*sin(theta)*sin(theta-theta1(a)/2-theta2(a)/2))/(E);

 

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(6)

 

## get u_r and u_theta as u[1] and u[2]

u[1] := u1*cos(theta)+u2*sin(theta);

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))*cos(theta)/E+(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))*sin(theta)/E

(7)

u[2] := -sin(theta)*u1+cos(theta)*u2;

-(1/4)*sin(theta)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E+(1/4)*cos(theta)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(8)

Diff_ur := simplify(diff(u[1], a));

(1/2)*sigma*(1+nu)*a*(-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*cos(theta)*(a-r)*(a+r)*cos(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*sin(theta)*(a^2+r^2)*sin(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+((a^2*r^2-r^4)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(3*nu-5/2)*r^2+a^2*(nu-1/2)))*cos(theta)*cos((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-sin(theta)*((2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*(a^2+r^2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(a^2+r^2)*(nu-1)))*sin((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/((-2*cos(theta)*a*r+a^2+r^2)^(3/2)*(2*cos(theta)*a*r+a^2+r^2)^(3/2)*((-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2))^(1/2)*E)

(9)

``

 

Diff_ut := simplify(diff(u[2], a));

-(1/2)*sigma*(1+nu)*a*(-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*sin(theta)*(a^2+r^2)*cos(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*cos(theta)*(a-r)*(a+r)*sin(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(theta)*((2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*(a^2+r^2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(a^2+r^2)*(nu-1/2))*(2*cos(theta)*a*r+a^2+r^2))*cos((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+((a^2*r^2-r^4)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(3*nu-2)*r^2+a^2*(nu-1))*(2*cos(theta)*a*r+a^2+r^2))*sin((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))*cos(theta))/((-2*cos(theta)*a*r+a^2+r^2)^(3/2)*(2*cos(theta)*a*r+a^2+r^2)^(3/2)*((-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2))^(1/2)*E)

(10)

``

# find the limiting case

Att := limit(Diff_ut*r*sin(2*theta), r = infinity);

(2*a*sigma*cos(theta)^3*sin(theta)^2*nu+2*a*sigma*cos(theta)*sin(theta)^4*nu+2*a*sigma*cos(theta)^3*sin(theta)^2+2*a*sigma*cos(theta)*sin(theta)^4-8*a*sigma*cos(theta)*sin(theta)^2*nu^2-6*a*sigma*cos(theta)*sin(theta)^2*nu+2*a*sigma*cos(theta)*sin(theta)^2)/(((cos(theta)^2+sin(theta)^2)/cos(theta)^2)^(1/2)*E)

(11)

Arr := limit(Diff_ur*r*(1-cos(2*theta)), r = infinity);

(-16*a*sigma*cos(theta)^6*nu^2-16*a*sigma*cos(theta)^4*sin(theta)^2*nu^2-6*a*sigma*cos(theta)^6*nu-6*a*sigma*cos(theta)^4*nu*sin(theta)^2+10*a*sigma*cos(theta)^6+10*a*sigma*sin(theta)^2*cos(theta)^4+28*a*sigma*cos(theta)^4*nu^2+20*a*sigma*cos(theta)^2*sin(theta)^2*nu^2+10*a*sigma*cos(theta)^4*nu+4*a*sigma*cos(theta)^2*sin(theta)^2*nu-18*a*sigma*cos(theta)^4-16*a*sigma*sin(theta)^2*cos(theta)^2-12*a*sigma*cos(theta)^2*nu^2-4*a*sigma*sin(theta)^2*nu^2-4*a*sigma*cos(theta)^2*nu+2*a*sigma*sin(theta)^2*nu+8*a*sigma*cos(theta)^2+6*a*sigma*sin(theta)^2)/(cos(theta)*((cos(theta)^2+sin(theta)^2)/cos(theta)^2)^(1/2)*E)

(12)

G := (1/8)*(int(Arr+Att, theta = 0 .. Pi/2))*sigma*4;

-(1/8)*Pi*a*sigma^2*(4*nu^2-nu-5)/E

(13)

simplify(G)

-(1/8)*Pi*a*sigma^2*(4*nu^2-nu-5)/E

(14)

 


Download Derivative_implicit_maplePrime.mw

 

Thanks,

Hi,

 

Is there any way to add arrows to the parametrics plot to show the direction they are going? Thanks. 

Hi,

How would I tell maple to solve for the variable t? The answer should be 4. 

[t-2,(t-2)^2]

[(3t/2)-4,(3t/2)-2]

I need to set them equal to eachother and then solve for t. 

 

Thanks!

Suppose that n is a positive integer number and [k1,k2,...,kn] is a list of non-negative integer numbers. 

My Question: How to create the procedure proc([k1,k2,...,kn]) such that the output of this procedure is in the following form:

For i1 from 0 to k1 do

for i2 from 0 to k2 do

......................

for in from 0 to kn do

i1+i2+...+in

end do; end do;...end do;

This application describes the motion of a pendulum attached to a moving pivot, all in 2D.

https://www.maplesoft.com/applications/view.aspx?SID=4888

 
How can this situation be generalized to a pendulum attached to a pivot which moves along a 3D spacecurve?

Hello,

I will explain my problem on a simple function and some data.

mg:=78.54*7.85*1e-9*1000*9.81;l:=10000;l0:=12000;h:=0;H := 28.399;
eta:=mg*l/(2*H);
zeta:=arcsinh(mg*h/(2*H*sinh(eta)))-eta;
z:=H/mg*(cosh(mg/H*x+zeta)-cosh(zeta));
plot(z,x=0..l);

Above is a definition of an initial plot. Now I would like to draw a new plot in which every x coordinate is shifted horizontally by a function:

deltax:=H*arcsinh(x)-x;

As you see I can't use translate or scale so I've tried to use a transform function but I can't do it the right way.

I would be grateful for any ideas.

 

Greetings,

Iza

Hi!

I have a rather long Maple code and want it to be executed multiple times with a parameter changed each time.

Surely this can be done with the loop structure, but it seems the whole loop structure must be contained into one single execution group, which makes it to be a little inconvenient, since the code is too long.

 

So is there any alternative way to realize this utility?

 

Best regard and thanks!

I have a function defined which maps x to a polynomial.

The coefficients are highly precise floating point numbers, which is necessary since it needs to be accurate, however when I try to print the function it looks like a massive mess.

I tried to use print(evalf[4](f)); in an attempt to simplify it however this evaluation seems to have no effect on how it is displayed.

As I said, I can't use evalf when defining the function since it needs high precision.

Is there a way to do this without creating a clone of the function with the coefficients evaluated, just to print it on screen?
 

Hi,

I'm trying to find a way to write in maple syntax a circle approximated with tangents; I'm not sure how to evaluate an equation that yields multiple functions as an output. I am able to do it in Derive6.1 and Desmos; however, I am not able to do it with maple.  Can someone people help me with the proper syntax? I'll leave a picture for what I want to be able to do in Maple.  I am trying to do with with vectors (parametrically).  

 

https://www.desmos.com/calculator/qpvldqadgb

 

Thanks

Hi there!

Basically I want to compare graphs in one coordinate system, however one of the graphs is set to 0 everywhere if the values of the y-coordinates differ too much from the values of the other graph. The procedure is below, how can I get around that?

I have already checked that all the values are calculated correctly and are displayed properly if the values of the other graph

are close enough.

Unfortunately I dont know how to send pictures.

Thanks, Daniel

 

PlottingVergleich:=proc(Unten2,Oben2,f2Nr1,G2Nr1,f2Nr2,G2Nr2,UntenN,ObenN)::plot;
local SpeichervektorX, #speichert die Stützstellen
SpeichervektorYAbs1, SpeichervektorYAbs2, #speichert die Stützwerte des späteren Splines aus den                                                 #absoluten Fehlern von f2Nr1 bzw. f2Nr2
SpeichervektorYRel1, SpeichervektorYRel2, #speichert die Stützwerte des späteren Splines aus den                                                 #relativen Fehlern von f2Nr1 bzw. f2Nr2
i2, #Laufvariable
InterpolationsfunktionAbs1,InterpolationsfunktionAbs2, #speichert den Spline aus den absoluten Fehlern                                                        #von f2Nr1 bzw. f2Nr2
InterpolationsfunktionRel1,InterpolationsfunktionRel2, #speichert den Spline aus den relativen Fehlern                                                        #von f2Nr1 bzw. f2Nr2
GraphAbs1,GraphAbs2, #speichert den Graphen aus dem Spline aus den absoluten Fehlern                                        #von f2Nr1 bzw. f2Nr2
GraphRel1,GraphRel2, #speichert den Graphen aus dem Spline aus den relativen Fehlern                                        #von f2Nr1 bzw. f2Nr2
PunkteAbs1,PunkteAbs2, #speichert den Punktgraphen aus den absoluten Fehlern                                                  #von f2Nr1 bzw. f2Nr2
PunkteRel1,PunkteRel2; #speichert den Punktgraphen aus den relativen Fehlern                                                  #von f2Nr1 bzw. f2Nr2
with(CurveFitting):
with(plots):
SpeichervektorX := Vector[row](ObenN-UntenN+1);
SpeichervektorYAbs1 := Vector[row](ObenN-UntenN+1);
SpeichervektorYRel1 := Vector[row](ObenN-UntenN+1);
for i2 from UntenN to ObenN do
  SpeichervektorX[i2-UntenN+1] := i2; #Stützstellen definieren
  SpeichervektorYAbs1[i2-UntenN+1] := GaußKronrodQuadraturKurz(Unten2, Oben2, f2Nr1, G2Nr1, i2)-(int     (f2Nr1*diff(G2Nr1,x), x = Unten2 .. Oben2)); # Bestimmen des absoluten Fehlers von f2Nr1 für n=i2
  if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then  #Bestimmen des relativen Fehlers von f2Nr1, falls dieser für beide Funktionen definiert                #ist
    SpeichervektorYRel1[i2-UntenN+1] := abs(SpeichervektorYAbs1[i2-UntenN+1]/(int(f2Nr1*diff(G2Nr1,x),     x = Unten2 ..    Oben2)))
  end if;
end do;
InterpolationsfunktionAbs1 := Spline(SpeichervektorX, SpeichervektorYAbs1, n); #Generierung des
   #  Splines aus Stützpunkten, die sich aus den absoluten Fehlern von f2Nr1 ergeben
GraphAbs1 := plot(InterpolationsfunktionAbs1, n = UntenN .. ObenN, color = green, legend = ["f1"]);
   #  Generierung des Graphen, der sich aus dem Spline aus den absoluten Fehlern von f2Nr1 ergibt
PunkteAbs1 := plot(SpeichervektorX, SpeichervektorYAbs1, style = point, color = orange);
   #  Generierung des Punktgraphen, der sich aus den absoluten Fehlern von f2Nr1 ergibt  
if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then
   # falls der relative Fehler für beide Funktionen definiert ist analoges Vorgehen für die relativen     #Fehler
  InterpolationsfunktionRel1 := Spline(SpeichervektorX, SpeichervektorYRel1, n);
  GraphRel1 := plot(InterpolationsfunktionRel1, n = UntenN .. ObenN, color = green, legend = ["f1"]);
  PunkteRel1 := plot(SpeichervektorX, SpeichervektorYRel1, style = point, color = orange);
end if;

 

SpeichervektorYAbs2:=Vector[row](ObenN-UntenN+1);
SpeichervektorYRel2:=Vector[row](ObenN-UntenN+1);
for i2 from UntenN to ObenN do
  SpeichervektorX[i2-UntenN+1]:=i2;  
  SpeichervektorYAbs2[i2-UntenN+1]:= GaußKronrodQuadraturKurz(Unten2,Oben2,f2Nr2,G2Nr2,i2)-int           (f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2); # Bestimmen des absoluten Fehlers von f2Nr2 für n=i2
  if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then  #Bestimmen des relativen Fehlers von f2, falls dieser für beide Funktionen definiert ist
    SpeichervektorYRel2[i2-UntenN+1]:= abs(SpeichervektorYAbs2[i2-UntenN+1]/
    int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2));
  end if;
end do;
InterpolationsfunktionAbs2:=Spline(SpeichervektorX,SpeichervektorYAbs2,n); #Generierung des
   #  Splines aus Stützpunkten, die sich aus den absoluten Fehlern von f2Nr2 ergeben
GraphAbs2:= plot(InterpolationsfunktionAbs2, n=UntenN..ObenN, color=red, legend = ["f2"]);
   #  Generierung des Graphen, der sich aus dem Spline aus den absoluten Fehlern von f2Nr2 ergibt
PunkteAbs2:= plot(SpeichervektorX,SpeichervektorYAbs2,style = point, color=blue);
   #  Generierung des Punktgraphen, der sich aus den absoluten Fehlern von f2Nr2 ergibt  
print(display({GraphAbs1,PunkteAbs1,GraphAbs2,PunkteAbs2}, title= "Absoluter Fehler",titlefont=["ROMAN",18])); # Ausgeben des Verleichsgraphen der absoluten Fehler
if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2) <> 0) then # falls der relative Fehler definiert ist analoges Vorgehen für die relativen Fehler
  InterpolationsfunktionRel2:=Spline(SpeichervektorX,SpeichervektorYRel2,n);
  GraphRel2:= plot(InterpolationsfunktionRel2, n=UntenN..ObenN, color=red, legend = ["f2"]);
  PunkteRel2:= plot(SpeichervektorX,SpeichervektorYRel2,style = point, color=blue);
  print(display({GraphRel1,GraphRel2,PunkteRel1,PunkteRel2}, title= "Relativer Fehler", titlefont=       ["ROMAN",18])) # Ausgeben des Verleichsgraphen der relativen Fehler, falls diese definiert sind
end if;
 print(SpeichervektorYAbs1,SpeichervektorYAbs2);
 print(GraphAbs1);
 print(PunkteAbs1)
end proc

 

I'm trying to create a list containg the indices of another list, ordered corresponding to the descending size of the first list.

Say I have the list L := [8 7 9 12];

I want to find the list i = [4 3 1 2]

I know this could be done one element at the time by doing some iterative loop:
i := [];
for j from 1 to size(L) do
    member(max(L),L,'index');
    i := [op(i),index];
    subsop(index=NULL,L);
end do;

But I was wondering if anyone knew any fancy tricks to do this more concisely(and without destroying the original list)?

First 732 733 734 735 736 737 738 Last Page 734 of 2427