Maple 18 Questions and Posts

These are Posts and Questions associated with the product, Maple 18

Does any body have example of maple code for solving optimal control problem in deterministic model using Pontryagin's maximum (or minimum) principle?

Hi

I d like to limit my solution to a real (non complex) solution
There should be a simple solution to my calculation but maple can t process the solutions in one of my "solve" commands.

How can do I tell maple to limit itself to one
 

NULL

restart

with(Student[Calculus1]):


#geometry [mm]

b := 250:

h := 720:

ds := 70:

d := h-ds:

As := 3000:


#concrete [MPa]

fck := 30:

fcm := fck+8;

38

(1)

Ecm := 33000;

33000

(2)

`ϵc1` := 2.2*(1/1000);

0.2200000000e-2

(3)

eta := `ϵc`/`ϵc1`;

454.5454545*`ϵc`

(4)

Ec1 := fck/`ϵc1`;

13636.36364

(5)

k := 1.05*Ecm/Ec1;

2.540999999

(6)

sigma := fcm*(-eta^2+eta*k)/(1+(k-2)*eta);

38*(-206611.5702*`ϵc`^2+1154.999999*`ϵc`)/(1+245.9090904*`ϵc`)

(7)


#steel [MPa]

Es := 200000:

fsy := 400:

fsu := 600:

`ϵy` := fsy/Es;

1/500

(8)

`ϵsh` := 0.9e-2:

`ϵsu` := 0.75e-1:

P := 4:

`ϵs` := `ϵcm`*(d-c)/c;

`ϵcm`*(650-c)/c

(9)

i := 1;

1

(10)

for `ϵcm` from .1*(1/1000) by .1*(1/1000) to 10*(1/1000) do `ϵs` := `ϵcm`*(d-c)/c; T[1] := `ϵs`*Es*As; T[2] := fsy*As; T[3] := (fsu+(fsy-fsu)*((`ϵsu`-`ϵs`)/(`ϵsu`-`ϵsh`))^P)*As; C := b*c*(int(sigma, `ϵc` = 0 .. `ϵcm`))/`ϵcm`; eq[1] := T[1] = C; `ϵl`[1] := `ϵy`; eq[2] := T[2] = C; `ϵl`[2] := `ϵsh`; eq[3] := T[3] = C; cc := max(solve(eq[1], c)); `ϵss` := subs(c = cc, `ϵs`); Ta := subs(c = cc, T[1]); if `ϵss` >= `ϵl`[1] then cc := max(solve(eq[2], c)); Ta := subs(c = cc, T[2]); `ϵss` := subs(c = cc, `ϵs`) end if; if `ϵss` >= `ϵl`[2] then cc := max(`assuming`([solve(eq[3], c, useassumptions)], [c::real])); Ta := subs(c = cc, T[3]); `ϵss` := subs(c = cc, `ϵs`) end if; M[i] := b*cc^2*fcm*(int(sigma*`ϵc`, `ϵc` = 0 .. `ϵcm`))*10^(-6)/`ϵcm`^2+T*(d-cc)*10^(-6); phi[i] := `ϵcm`/cc; cd[i] := cc/d; print(`ϵcm`, `ϵss`, Ta/As); i := i+1 end do

0.1000000000e-3, 0.1955232439e-3, 39.10464877

 

0.2000000000e-3, 0.3845102290e-3, 76.90204580

 

0.3000000000e-3, 0.5671741821e-3, 113.4348364

 

0.4000000000e-3, 0.7437144096e-3, 148.7428819

 

0.5000000000e-3, 0.9143174400e-3, 182.8634880

 

0.6000000000e-3, 0.1079158043e-2, 215.8316087

 

0.7000000000e-3, 0.1238400148e-2, 247.6800297

 

0.8000000000e-3, 0.1392197667e-2, 278.4395334

 

0.9000000000e-3, 0.1540695238e-2, 308.1390476

 

0.1000000000e-2, 0.1684028897e-2, 336.8057793

 

0.1100000000e-2, 0.1822326682e-2, 364.4653363

 

0.1200000000e-2, 0.1955709188e-2, 391.1418377

 

0.1300000000e-2, 0.2226921078e-2, 400

 

0.1400000000e-2, 0.2583745185e-2, 400

 

0.1500000000e-2, 0.2954159196e-2, 400

 

0.1600000000e-2, 0.3336139462e-2, 400

 

0.1700000000e-2, 0.3727768551e-2, 400

 

0.1800000000e-2, 0.4127227927e-2, 400

 

0.1900000000e-2, 0.4532791280e-2, 400

 

0.2000000000e-2, 0.4942818378e-2, 400

 

0.2100000000e-2, 0.5355749454e-2, 400

 

0.2200000000e-2, 0.5770100024e-2, 400

 

0.2300000000e-2, 0.6184456101e-2, 400

 

0.2400000000e-2, 0.6597469817e-2, 400

 

0.2500000000e-2, 0.7007855358e-2, 400

 

0.2600000000e-2, 0.7414385220e-2, 400

 

0.2700000000e-2, 0.7815886744e-2, 400

 

0.2800000000e-2, 0.8211238846e-2, 400

 

0.2900000000e-2, 0.8599369121e-2, 400

 

0.3000000000e-2, 0.8979250971e-2, 400

 

Error, complex argument to max/min

 

`ϵcm` := 0.35e-2; `ϵs` := `ϵcm`*(d-c)/c; T[1] := `ϵs`*Es*As; T[2] := fsy*As; T[3] := (fsu+(fsy-fsu)*((`ϵsu`-`ϵs`)/(`ϵsu`-`ϵsh`))^P)*As; C := b*c*(int(sigma, `ϵc` = 0 .. `ϵcm`))/`ϵcm`; eq[1] := T[1] = C; `ϵl`[1] := `ϵy`; eq[2] := T[2] = C; `ϵl`[2] := `ϵsh`; eq[3] := T[3] = C; cc1 := max(solve(eq[1], c)); `ϵss1` := subs(c = cc, `ϵs`); Ta1 := subs(c = cc, T[1]); cc2 := max(solve(eq[2], c)); `ϵss1` := subs(c = cc, `ϵs`); Ta2 := subs(c = cc, T[2]); cc3 := max(solve(eq[3], c)); `ϵss3` := subs(c = cc, `ϵs`); Ta3 := subs(c = cc, T[3]); M[i] := b*cc^2*fcm*(int(sigma*`ϵc`, `ϵc` = 0 .. `ϵcm`))*10^(-6)/`ϵcm`^2+T*(d-cc)*10^(-6); phi[i] := `ϵcm`/cc; cd[i] := cc/d; print(`ϵcm`, `ϵss`, Ta/As); i := i+1

7501.663386*c

 

308.9753080

 

0.1055633997e-1

 

6333803.979

 

159.9645223

 

0.1055633997e-1

 

1200000

 

Error, complex argument to max/min

 

0.1055633997e-1

 

1254623.652

 

0.35e-2, 0.9349901112e-2, 400

(11)

``

``

``

``

``

NULL

NULL

``

``

``

``

``

``

``

``

``

``

``

``

``

NULL

``

``

``

``

``

``

``

``

``


 

Download mathias.mw

simple non complex solutions ?

Hi

I m trying to do a nested loop but for some reason maple tells me my for loop is unterminated 

I d love some feedback on my code and on how to make it work
 

NULL

restart

with(Student[Calculus1]):


#geometry [mm]

b := 250:

h := 720:

ds := 70:

d := h-ds:

As := 3000:


#concrete [MPa]

fck := 30:

fcm := fck+8;

38

(1)

Ecm := 33000;

33000

(2)

`ϵc1` := 2.2*(1/1000);

0.2200000000e-2

(3)

eta := `ϵc`/`ϵc1`;

454.5454545*`ϵc`

(4)

Ec1 := fck/`ϵc1`;

13636.36364

(5)

k := 1.05*Ecm/Ec1;

2.540999999

(6)

sigma := fcm*(-eta^2+eta*k)/(1+(k-2)*eta);

38*(-206611.5702*`ϵc`^2+1154.999999*`ϵc`)/(1+245.9090904*`ϵc`)

(7)


#steel [MPa]

Es := 200000:

fsy := 400:

fsu := 600:

`ϵy` := fsy/Es;

1/500

(8)

`ϵsh` := 0.9e-2:

`ϵsu` := 0.75e-1:

P := 4:

`ϵs` := `ϵcm`*(d-c)/c;

`ϵcm`*(650-c)/c

(9)

i := 1;

1

(10)

"for epsiloncm from 0.1/(1000) by 0.1/(1000)to (3.5)/(1000) do  print(epsiloncm);     epsilons:=(epsiloncm)/(c)*(d-c):  T[1]:=epsilons*Es*As:  T[2]:=fsy*As:  T[3]:=fsu+(fsy-fsu)*((epsilonsu-epsilons)/((epsilonsu-epsilonsh)))^(P):  T[4]:=0:  C:=(b*c)/(epsiloncm)*int(sigma,epsilonc=0..epsiloncm):  eq[1]:=T[1]=C:  epsilonl[1]:=epsilony:  eq[2]:=T[2]=C:  epsilonl[2]:=epsilonsh:  eq[3]:=T[3]=C:  a:=1          for j from 1 by 1 to 3 do          if a=1 then          cc:=max(solve(eq[j],c)):          epsilons:=subs(c=cc,epsilons):          if epsilons<=epsilonl[j] then T:=subs(c=cc,T[j]): a:=0:          end if:          end if:          end do:  M[i]:=(b*cc^(2)*fcm)/(epsiloncm^(2))*int(sigma*epsilonc,epsilonc=0..epsiloncm)*10^(-6)+T*(d-cc)*10^(-6):  phi[i]:=(epsiloncm)/(cc):  T[i]:=T:  cd[i]:=(cc)/(d):    print(M[i],epsiloncm,phi[i]);  i:=i+1:  end do:                                        "

Error, unterminated loop

"for epsiloncm from 0.1/1000 by 0.1/1000to 3.5/1000 do  print(epsiloncm);     epsilons:=epsiloncm/c*(d-c):  T[1]:=epsilons*Es*As:  T[2]:=fsy*As:  T[3]:=fsu+(fsy-fsu)*((epsilonsu-epsilons)/(epsilonsu-epsilonsh))^P:  T[4]:=0:  C:=(b*c)/epsiloncm*int(sigma,epsilonc=0..epsiloncm):  eq[1]:=T[1]=C:  epsilonl[1]:=epsilony:  eq[2]:=T[2]=C:  epsilonl[2]:=epsilonsh:  eq[3]:=T[3]=C:  a:=1         for j from 1 by 1 to 3 do          if a=1 then  cc:=max(solve(eq[j],c)):  epsilons:=subs(c=cc,epsilons):          if epsilons<=epsilonl[j] then T:=subs(c=cc,T[j]): a:=0:          end if:          end if:          end do:  M[i]:=(b*cc^2*fcm)/(epsiloncm^2)*int(sigma*epsilonc,epsilonc=0..epsiloncm)*10^(-6)+T*(d-cc)*10^(-6):  phi[i]:=epsiloncm/cc:  T[i]:=T:  cd[i]:=cc/d:  print(M[i],epsiloncm,phi[i]);  i:=i+1:  end do:                                        "

 

``

``

``

``

``

``

NULL

NULL

``

``

``

``

``

``

``

``

``

``

``

``

``

NULL

``

``

``

``

``

``

``

``

``


 

Download mathias.mw

 

Thanks in advance

Hello,  after almost a decade not using Maple, I am trying to get going to solve a set of differential equations and I have some problems that are probably pretty basic.

 

1.  I have the following simplification equations

which rightfully gives

and

which I hoped would give

but gives

"Error, invalid left hand side in assignment".  What am I doing wrong?

 

2.  The above simplification equations will be used to simplify this vector:

Once I get passed the "Invalid left hand side assignm,ent" issue, I would like to reorganize each line of the above vector and simplify using the small equations above.  What command do I need to use to do this?  The Phi & Beta variables are not necessarily next to one another so the equations need to be reorganized and the substitution for Omega & Omega_dot done.

Any help is appreciated! Thanks

Hi!

I'm doing an assignment where we are supposed to create a random walk with 3 options (go straight forward, turn left, turn right), and the first step is to be taken to [1,0]. I am supposed to plot the result afterwards, but when I plot it, it's empty...

(The first # is forward, the second # is to the right, and the third # is to the left)

for i to M0 do

X[i, 0] := 1; Y[i, 0] := 0;

for j from 2 to M1 do

r := R3();

if r = 1 then X[i, j] := 2*X[i-1, j]-X[i-2, j]; Y[i, j] := 2*Y[i-1, j]-Y[i-2, j];

elif r = 2 then X[i, j] := X[i-1, j]+Y[i-1, j]-Y[i-2, j]; Y[i, j] := Y[i-1, j]-X[i-1, j]+X[1-2, j];

else X[i, j] := X[i-1, j]-Y[i-1, j]+Y[i-2, j]; Y[i, j] := Y[i-1, j]+X[i-1, j]-X[i-2, j];

end if;

end do;

end do:

Then, for the plot:

plot([[[([X[i, j], Y[i, j]], $j = 0 .. M1)], $i = 1 .. M0)], scaling = CONSTRAINED);

This is what I got for the plot:

Where have I gone wrong? 

Thanks in advance!

Hello everyone,

I am experiencing a strange result. The Theta_double_dot got equated to zero in line 1.7. Please see the red arrow.

(I am using the Physics package)

How can I solve this issue?

Dear Maple useres,

I have a polynomial in the form f(s)/g(s) where f and g are polynomial of order 4 with coefficients in symbolic form. I want to convert it in a form of (s-a)*(s-b)*(s-c)*(s-d)/(s-a1)*(s-b1)*(s-c1)*(s-d1)

When i provide the numic value of  symbolic coefficients, Maple find it easy to factor it in the desired form. Otherwise i get a messy solution in the form of root of... expression. Even with assume command, I see no difference in the result. Is there a way to get the above simple form rather than root of expression?

thanks.

 

Hello,

I used the interface(typesetting = extended) command to change the notation used for time derivative of o variable.

But it doesn't seem to be working well when the variable is in the supercript form (check the last line).

How can I solve this issue?

Mapleprimesquestion.mw

 

What is the meaning of the output of the command Weierstrassform?

E.g. what does mean x0^3 - 7*x0 + 88 +y0^2 ?

Maybe y0^2 = x0^3 + 7*x0 -88?

The graphic below by used maple18

contourplot(-3.392318438*exp(-4.264628895*x)*sin(6.285714286*y), x = -1/2 .. 3/2, y = -1/2 .. 3/2)

Why the graphic below the figure is not integrated, how can develop the graphic

 

 

Hello.

Please help me. I Have to solve some equations with Adomian Decomposition Method in Maple. But i don't know it.

I just know AGM, HPM and Perturbation Method in Maple.

please send me instructions and codes.

I'm sorry, I can't speak English well. I hope you understand what I mean.

thank you

hello , there , i want ask a Question ,

i have a vector result n hier , and there is a long part with ^1/2 (like unter) , which is not defined before , just from compute ,i want to replace this part with A, and have tried to use subs , but it didnt work . 

And i have tried to define it before compute, and then use subs , aber it also didnt work .

so how can i replace or define this part in the result?

thanks

 

I need find CPU time for a set of mathematical calculations,  what is the best method in maple 18?

Hey any one can help? I calculated the characteristical Polynom of my Matrix M:

-(lambda-2)^2*(544-lambda^9-328*lambda^7-16*cos(x-y)+6*cos(x-y)*lambda+6*cos(x+y)*lambda-408*cos(y)*lambda^2-408*cos(x)*lambda^2+540*cos(y)*lambda+540*cos(x)*lambda-28*cos(y)*lambda^4-28*cos(x)*lambda^4+152*cos(y)*lambda^3+152*cos(x)*lambda^3+2*cos(y)*lambda^5+2*cos(x)*lambda^5-256*cos(y)+17232*lambda^2-256*cos(x)-7852*lambda^5+17768*lambda^4+2088*lambda^6+28*lambda^8-16*cos(x+y)-23632*lambda^3-5844*lambda)

now I want to solve the second part of the polynomial with lambda^9 but maple gives me the RootOf-function

_Z^9-28*_Z^8+328*_Z^7-2088*_Z^6+(-2*cos(y)-2*cos(x)+7852)*_Z^5+(28*cos(y)+28*cos(x)-17768)*_Z^4+(-152*cos(y)-152*cos(x)+23632)*_Z^3+(408*cos(y)+408*cos(x)-17232)*_Z^2+(-12*cos(x)*cos(y)-540*cos(y)-540*cos(x)+5844)*_Z+32*cos(x)*cos(y)+256*cos(y)+256*cos(x)-544

How can I simplify this expression to solve over lambda.

purpose is to plot all the eigenvalues.

 

Thank you in advance.

Hello,

Why does the following work as expected...

f__c := proc (x__0, y__0) options operator, arrow; piecewise(x__0^2+y__0^2 <= 1 and (x__0-1)^2+y__0^2 <= 1 and x__0^2+(y__0-1)^2 <= 1 and (x__0-1)^2+(y__0-1)^2 <= 1, 1, not (x__0^2+y__0^2 <= 1 and (x__0-1)^2+y__0^2 <= 1 and x__0^2+(y__0-1)^2 <= 1 and (x__0-1)^2+(y__0-1)^2 <= 1), 0) end proc

But the following does not?

cnd := x__0^2+y__0^2 <= 1 and (x__0-1)^2+y__0^2 <= 1 and x__0^2+(y__0-1)^2 <= 1 and (x__0-1)^2+(y__0-1)^2 <= 1
f__c := proc (x__0, y__0) options operator, arrow; piecewise(cnd, 1, not cnd, 0) end proc

(Sorry about the lack of formatting, the forum insists my Maple syntax is invalid)

The first one produces the expected result, x__0 and y__0 are treated as variables in the condition (i.e. f__c(a, b) returns the same piecewise function with x__0 replaced with a and y__0 replaced with b); the second one does not (i.e. f__c(a, b) returns the piecewise function, still with x__0 and y__0 in the condition, and never gets evaluated).

First 6 7 8 9 10 11 12 Last Page 8 of 61