tomleslie

13876 Reputation

20 Badges

15 years, 181 days

MaplePrimes Activity


These are replies submitted by tomleslie

@xinwmath 

You have to "zero in" a little on the part you want simplified. Consider the attached

  restart;
  expr:= (L__b+lambda)^2*(I*sqrt(3)*lambda-2*L__b+lambda)^7*(I*sqrt(3)*lambda+2*L__b-lambda)^7
         /
         (16384*(L__b^2-lambda*L__b+lambda^2)^5*lambda^3);
  expr2:=-320*L__a
          /
          ( 3*(L__a-lambda)^3*(I*sqrt(3)*lambda+2*L__a+lambda)^3*(I*sqrt(3)*lambda-2*L__a-lambda)^3);
  f:=x-> simplify(factor(expand(numer(x)))/factor(expand(denom(x)))):
  f(expr);
  f(expr2);

(1/16384)*(L__b+lambda)^2*(I*3^(1/2)*lambda-2*L__b+lambda)^7*(I*3^(1/2)*lambda+2*L__b-lambda)^7/((L__b^2-L__b*lambda+lambda^2)^5*lambda^3)

 

-(320/3)*L__a/((L__a-lambda)^3*(I*3^(1/2)*lambda+2*L__a+lambda)^3*(I*3^(1/2)*lambda-2*L__a-lambda)^3)

 

-(L__b+lambda)^2*(L__b^2-L__b*lambda+lambda^2)^2/lambda^3

 

(5/3)*L__a/((L__a-lambda)^3*(L__a^2+L__a*lambda+lambda^2)^3)

(1)

 

Download simpfun.mw

@siddikmaple 

I have had to guess what sort of format you might want in the Excel spreadsheet(s).

In order to successfully run the attached, you will have to change the entry

 fname:= "C:/Users/TomLeslie/Desktop/":

to a path appropriate for your installation.

As written, the attached generates two Excel files "OPTLSres.xlsx" and "OPTDSres.xlsx" and saves these to my (Windows) desktop. (I have included copies of these files below)

restart; with(DirectSearch)

[BoundedObjective, CompromiseProgramming, DataFit, ExponentialWeightedSum, GlobalOptima, GlobalSearch, Minimax, ModifiedTchebycheff, Search, SolveEquations, WeightedProduct, WeightedSum]

(1)

``

Loading LinearAlgebra

 

lambda[0] := 0.1e-5

0.1e-5

(2)

lambda[1] := 0.1e-5

0.1e-5

(3)

lambda[2] := 0.1e-5

0.1e-5

(4)

lambda[3] := 0.1e-5

0.1e-5

(5)

for n to 20 do e1 := p[s] = (n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3]))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n; e2 := p[b] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n; e3 := r[0] = lambda[0]*(20*p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+20*r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5)+p[0, b]*(11258.065*p[s]/p[b]+469.725)*(p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5))+(469.725*(-p[0, p]*r[0]+p[0, p]+r[0]))*(-4*p[0, c]^5+p[0, c]^4+p[0, c]^3+p[0, c]^2+p[0, c])+11727.79-11727.79*p[0, c]^5*(-p[0, p]*r[0]+p[0, p]+r[0])+p[0, c]^5*(20*p[0, p]*(1-r[0])*(7*p[0, b]*(1/2)+30)+3018.625*r[0]+(20*p[0, p]*(1-r[0])*(7*p[0, b]*(1/2)+30)+670*r[0])*p[0, b]*(11258.065*p[s]+469.725*p[b])/(20*p[b])+2348.625*p[0, p]*(1-r[0]))); e4 := r[1] = lambda[1]*(20*p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+20*r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5)+p[1, b]*(11258.065*p[s]/p[b]+469.725)*(p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5))+(469.725*(-p[1, p]*r[1]+p[1, p]+r[1]))*(-4*p[1, c]^5+p[1, c]^4+p[1, c]^3+p[1, c]^2+p[1, c])+11727.79-11727.79*p[1, c]^5*(-p[1, p]*r[1]+p[1, p]+r[1])+p[1, c]^5*(20*p[1, p]*(1-r[1])*(15*p[1, b]*(1/2)+62)+3738.625*r[1]+(20*p[1, p]*(1-r[1])*(15*p[1, b]*(1/2)+62)+1390*r[1])*p[1, b]*(11258.065*p[s]+469.725*p[b])/(20*p[b])+2348.625*p[1, p]*(1-r[1]))); e5 := r[2] = lambda[2]*(20*p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+20*r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5)+p[2, b]*(11258.065*p[s]/p[b]+469.725)*(p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5))+(469.725*(-p[2, p]*r[2]+p[2, p]+r[2]))*(-4*p[2, c]^5+p[2, c]^4+p[2, c]^3+p[2, c]^2+p[2, c])+11727.79-11727.79*p[2, c]^5*(-p[2, p]*r[2]+p[2, p]+r[2])+p[2, c]^5*(20*p[2, p]*(1-r[2])*(31*p[2, b]*(1/2)+478)+12218.625*r[2]+(20*p[2, p]*(1-r[2])*(31*p[2, b]*(1/2)+478)+9870*r[2])*p[2, b]*(11258.065*p[s]+469.725*p[b])/(20*p[b])+2348.625*p[2, p]*(1-r[2]))); e6 := r[3] = lambda[3]*(20*p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+20*r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5)+p[3, b]*(11258.065*p[s]/p[b]+469.725)*(p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5))+(469.725*(-p[3, p]*r[3]+p[3, p]+r[3]))*(-4*p[3, c]^5+p[3, c]^4+p[3, c]^3+p[3, c]^2+p[3, c])+11727.79-11727.79*p[3, c]^5*(-p[3, p]*r[3]+p[3, p]+r[3])+p[3, c]^5*(20*p[3, p]*(1-r[3])*(31*p[3, b]*(1/2)+478)+12218.625*r[3]+(20*p[3, p]*(1-r[3])*(31*p[3, b]*(1/2)+478)+9870*r[3])*p[3, b]*(11258.065*p[s]+469.725*p[b])/(20*p[b])+2348.625*p[3, p]*(1-r[3]))); e7 := t[0] = (-p[0, c]^5+1)/((1-p[0, c])*(r[0]+(1-r[0])/p[0, p]+(-p[0, c]^5+1)/(1-p[0, c])+(7*(p[0, b]*(1-r[0])+r[0]))/(2-2*p[0, b])+(15*p[0, c]^4+15*p[0, c]^3+15*p[0, c]^2+15*p[0, c])/(2-2*p[0, b]))); e8 := t[1] = (-p[1, c]^5+1)/((1-p[1, c])*(r[1]+(1-r[1])/p[1, p]+(-p[1, c]^5+1)/(1-p[1, c])+(15*(p[1, b]*(1-r[1])+r[1]))/(2-2*p[1, b])+(31*p[1, c]^4+31*p[1, c]^3+31*p[1, c]^2+31*p[1, c])/(2-2*p[1, b]))); e9 := t[2] = (-p[2, c]^5+1)/((1-p[2, c])*(r[2]+(1-r[2])/p[2, p]+(-p[2, c]^5+1)/(1-p[2, c])+(31*(p[2, b]*(1-r[2])+r[2]))/(2-2*p[2, b])+(511*p[2, c]^4+255*p[2, c]^3+127*p[2, c]^2+63*p[2, c])/(2-2*p[2, b]))); e10 := t[3] = (-p[3, c]^5+1)/((1-p[3, c])*(r[3]+(1-r[3])/p[3, p]+(-p[3, c]^5+1)/(1-p[3, c])+(31*(p[3, b]*(1-r[3])+r[3]))/(2-2*p[3, b])+(511*p[3, c]^4+255*p[3, c]^3+127*p[3, c]^2+63*p[3, c])/(2-2*p[3, b]))); e11 := p[0, p] = 1-exp(-lambda[0]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725)); e12 := p[1, p] = 1-exp(-lambda[1]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725)); e13 := p[2, p] = 1-exp(-lambda[2]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725)); e14 := p[3, p] = 1-exp(-lambda[3]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725)); e15 := p[0, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0]); e16 := p[1, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1]); e17 := p[2, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2]); e18 := p[3, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3]); e19 := p[0, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0]))^1; e20 := p[1, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1]))^1; e21 := p[2, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2]))^2; e22 := p[3, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3]))^6; e23 := p[0, s] = n*t[0]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0]); e24 := p[1, s] = n*t[1]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1]); e25 := p[2, s] = n*t[2]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2]); e26 := p[3, s] = n*t[3]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3]); CSTR := `~`[`=`]({p[b], p[s], p[0, b], p[0, c], p[0, p], p[0, s], p[1, b], p[1, c], p[1, p], p[1, s], p[2, b], p[2, c], p[2, p], p[2, s], p[3, b], p[3, c], p[3, p], p[3, s], r[0], r[1], r[2], r[3], t[0], t[1], t[2], t[3]}, 0 .. 1); residuals := `~`[lhs-rhs]([e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26]); ansLS[n] := Optimization:-LSSolve(residuals, op(CSTR), iterationlimit = 10000); ansDS[n] := DirectSearch:-SolveEquations(residuals, CSTR, initialpoint = ansLS[n][2]) end do

#
# Extract the parameter values from the DirectSearch and
# LSSolve results tables. Put these into matrices, together
# with an "index" row and an "index" column.
#
  LSMat:= Matrix( max([indices(ansLS, 'nolist')])+1,
                  numelems(ansLS[1][2])+1
                ):
  LSMat[1,1]:= "n":
  LSMat[1,2..-1]:= convert~( < lhs~(ansLS[1][2])[] >,
                             string
                           ):
  LSMat[2..-1,1]:= < seq
                     ( j,
                       j=1..n-1
                     )
                   >:
  LSMat[2..-1, 2..-1]:= < seq
                          ( Transpose
                            ( < rhs~(ansLS[j][2]) > ),
                            j=1..n-1
                          )
                        >:
  DSMat:= Matrix
          ( max
            ( [ indices
                ( ansDS, 'nolist')
              ]
            )+1,
            numelems
            ( ansDS[1][3] )+1
          ):
  DSMat[1,1]:= "n":
  DSMat[1,2..-1]:= convert~( < lhs~(ansDS[1][3])[] >,
                             string
                           ):
  DSMat[2..-1,1]:= < seq
                     ( j,
                       j=1..n-1
                     )
                   >:
  DSMat[2..-1, 2..-1]:= < seq
                          ( Transpose
                            ( < rhs~(ansDS[j][3]) > ),
                            j=1..n-1
                          )
                        >:
#
# So are the results from the LinearSolve() and
# DirectSearch() processes very different?? They
# shouldn't be! For amusement, find the biggest
# absolute difference for any parameter
#
   mi:= max[index](DSMat-LSMat);
  (DSMat-LSMat)[mi];
#
# Differences probably too small to be noticeable
# when data is "rounded" for export to Excel
#
# Send data to two different Excel spreadsheets,
# one for the LSSolve() results and one for the
# DirectSearch() results.
#
# OP will have to change 'fname' to something
# appropriate for his/her machine, OS
#
  fname:= "C:/Users/TomLeslie/Desktop/":
  ExcelTools:-Export( LSMat, cat(fname, "OPTLSres.xlsx"), 1, "B2"):
  ExcelTools:-Export( DSMat, cat(fname, "OPTDSres.xlsx"), 1, "B2"):

21, 6

 

HFloat(2.2644310899815057e-7)

(6)

 

 


Download toXL.mw

OPTDSres.xlsx

OPTLSres.xlsx

 

to my original post, I would come up with the attached

#############################
# Initialize and get version
#
  restart;
  kernelopts(version);
#
# OP's code
#
  imp_fun := -4*x + 10*(x^2)*(y^(-2)) + y^2 =11;
  c := 2;
  s:= evalf( solve( subs( x = c, imp_fun)));
  m1 := evalf( subs ( { x = c, y = s[1] }, implicitdiff( imp_fun, y,x)));

`Maple 2018.2, X86 64 WINDOWS, Nov 16 2018, Build ID 1362973`

 

-4*x+10*x^2/y^2+y^2 = 11

 

2

 

1.552828568, -1.552828568, 4.072925661, -4.072925661

 

.6894093684

(1)

#############################
# How I'd (probably?) do it.
#
# Initialize and get version
#
  restart;
  with(plots):
  kernelopts(version);
  xVal:=2:
#
  imp_fun := x^3+y^3 = 9*x*y;;
  s:= [ evalf
        ( solve
          ( eval
            ( imp_fun,
              x=xVal
            )
          )
        )
      ];
  m:= [ seq
        ( evalf
          ( eval
            ( implicitdiff
              ( imp_fun, y, x
              ),
              [ x=xVal, y=s[j] ]
            )
          ),
          j=1..numelems(s)
        )
      ];
#
# Plot the curve and the solution points for x=2
#
  cols:=[ red, green, blue, black]:
  display
  ( [ implicitplot
      ( imp_fun,
        x=-5..5,
        y=-5..5,
        color=black,
        gridrefine=4
      ),
      pointplot
      ( [ seq
          ( [xVal, s[j]],
            j =1..numelems(s)
          )
        ],
        color=[ red, green, blue],
        style=point,
        symbol=solidcircle,
        symbolsize=20
      ),
      plot
      ( [ seq
          ( s[j]+m[j]*(x-xVal),
            j=1..3
          )
        ],
        x=-5..5,
        color=[ red, green, blue]
      )
    ]
  );

`Maple 2018.2, X86 64 WINDOWS, Nov 16 2018, Build ID 1362973`

 

x^3+y^3 = 9*x*y

 

[4., -4.449489743, .449489743]

 

[.8000000000, -1.257321410, .4573214099]

 

 

 

Download impDiff3.mw

 

@mehdibaghaee 

plotting these "vectors" is a trivial one-liner: actually generating example data to plot takes longer. See the attached

  restart;
  with(plots):
#
# Define the data: life would be so much easier if the
# OP could be bothered to do this. It would mean that I
# don't have to spend time generating "artificial" data
#
  g:=2926: nL:=26:
  X:=<seq(j, j=0..evalf(2*Pi),evalf(2*Pi/g))>:
  M:=Matrix( nL, g, (i,j)->i/100*sin(X[j])):
#
# Now that data has been generated, which the OP should
# have provided in the first place, then do a simple
# plot of all the data
#
  display( [seq(pointplot( X, M[j,..], style=line), j=1..nL)]);

 

 

Download plotAlot.mw

 

@dorna01 

In my earlier response, the command

int(f1,y=0..infinity)

solves the integral for 'y' and thus generates an expression containing only the variable 'x' . The command

unapply(int(f1,y=0..infinity),x):

solves the integral for 'y', generating an expression containing only the variable 'x' and then converts this expression to a function whihc can be evaluated for any desired value of the variable 'x'. What else do you want?

@Subhan331 

as in the attached?


 

NULL

restart; tol := 0.1e-5; n := 10; x := Array(0 .. n); x[0] := .1; f := proc (z) options operator, arrow; z^2-3 end proc; h := unapply(diff(f(z), z), z); for k to n do x[k] := evalf(x[k-1]-f(x[k-1])/h(x[k-1])); if abs(x[k]-x[k-1]) < tol then print("Number of iterations" = k); print("approximate solution" = x[k]); print(f(x[k])); break end if; x[k-1] := x[k] end do; interface(rtablesize = n+1); x(); interface(rtablesize = n); plot([f(p), f(x[k-1])+(p-x[k-1])*h(x[k-1])], p = -1 .. 3, colour = [red, black])

0.1e-5

 

10

 

.1

 

proc (z) options operator, arrow; z^2-3 end proc

 

proc (z) options operator, arrow; 2*z end proc

 

"Number of iterations" = 9

 

"approximate solution" = 1.732050808

 

0.1e-8

 

10

 

Array(%id = 18446744074371365934)

 

11

 

 

NULL

NULL

``


 

Download netwmeth3.mw

@Subhan331 
if you really need this info, then consider the attached


 

  tol:= 1e-06;
#
# Define value for maximum number of iterations
#
  n:= 10;
#
# Inuitialze array for results of successive iterations
#
  x:= Array(0..n):
  x[0]:= 0.1;
#
# Define a couple of functions
#
  f:= z -> z^2-3;
  h:= z -> 2*z;
#
# Perform successive iterations
#
  for k from 1 to n do
      x[k]:= evalf(x[k-1]-f(x[k-1])/h(x[k-1]));
      if   abs(x[k]-x[k-1]) < tol
      then print("Number of iterations"=k);
           print("approximate solution"=x[k]);
           print( f(x[k]) );
           break;
      end if;
   # x[k-1]:= x[k]; this line does nothing useful so comment out
  end do:
#
# Display values of successive iterations
# (allowing for Maple's reluctance to display
# large amounts of data whan this isn't necessary)
#
  interface(rtablesize=n+1);
  x();
  interface(rtablesize=10);
#
# Produce plot
#
  plot( [f(p), f(x[k-1])+(p-x[k-1])*h(x[k-1])], p=-1..3, colour=[red,black]);
 

0.1e-5

 

10

 

proc (x) options operator, arrow; x^2-3 end proc

 

.1

 

proc (x) options operator, arrow; 2*x end proc

 

"Number of iterations" = 9

 

"approximate solution" = 1.732050808

 

0.1e-8

 

10

 

Array(%id = 18446744074363730030)

 

 

11

(1)

 


 

Download newtMeth2.mw

@student_md 

Although I'd adjust the plot title option on the first - becuase you are no longer plotting

title=typeset(diff(u(t),t), " vs ", t)

You are plotting

title= typeset(sin(Pi*x)*diff(u(t),t), " vs ", t and x)

 

 

 

 

 

@student_md 

see the attached - although it may be more convenient to change the output format from the dsolve() command, depending on what you subsequently want to do with the data, which I have added in the attached

(For some reason this woksheet is not displaying here(!?), so you willl have to download :-(


odeprob.mw

in the most complicated way possible - just don't.

I have already shown how to construct the matrix which you want - all you have to do is provide a definition of psi[n,m](t) which depends on n,m and t. Instead you provide a definition (eq3 in your edited post) which depends on n,m,t - and also k and nhat -whihc are what exactly!!?

Don't worry about the Legendre polynomials they are trivial to define in Maple. If you don't believe me just try

simplify( LegendreP(m,t))

which will produce the Legendre polynomial of degree 'm' in the variable 't'

Please stop writing pointless code - focus on one thing and one thing only: write/provide a definition of psi[n,m](t) which depends only on n, m, and t.

If you can't then I would suggest that you do not understand the problem you are trying to solve - just writing random code, hoping something "miraculuous" will happen. (It won't!)

Just for a moment, assume the solution

V(t)=0,
q(t)=0,
r[1](t)=0

All of your ODEs are satisfied, and all of your boundary conditions are satisfied.

I'm guessing that you don't like this solution.

Bad news, it is a perfectly valid solution and Maple will find it.

The great thing is, it doesn't really matter what the value of U[0] is - the numeric solution is that all dependent variables are identically zero for all time.

Do you have any reason to believe that any other solution exists??

@666 jvbasha 

Unfortuantely the plots:-shadebetween() command only become available in Maple 2015 (fairly old, but not as old as Maple 18). The only way I can think of doing this in Maple 18 is to utilise the plots:-inequal() command as in the attached which I tested/developed in Maple 18

I don't think that the resulting graph is as "smooth" as that obtained by using the newer shadebetween() command.

  restart;
  kernelopts(version);
  with(plots):
  fcns := {T(eta), f(eta)}:
  ep:= .1: M := 1: kp := .5: n := 1:
  ec:= .1: pr := 1: s := .1: N := 5:
  sys:= diff(f(eta),eta$3)+f(eta)*diff(f(eta),eta$2)-diff(f(eta),eta)*diff(f(eta),eta)+ep*ep+(M+1/kp)*(ep-diff(f(eta),eta)) = 0,
        diff(T(eta),eta$2)+pr*(f(eta)*diff(T(eta),eta)-n*diff(f(eta),eta)*T(eta))+pr*(ec*diff(f(eta),eta$2)*diff(f(eta), eta$2)+ec*(M+1/kp)*diff(f(eta),eta)^2+s*T(eta)) = 0:
  bc:= f(0)=0, D(f)(0)=1, D(f)(N) = ep, T(0) = 1, T(N) = 0:
  R:= dsolve(eval({bc, sys}), numeric, output=listprocedure):
  psi := [-0.9e-1, -0.7e-1, -0.4e-1, -0.1e-1, 0, 0.1e-1, 0.4e-1, 0.7e-1, 0.9e-1]:
  for i to 9 do
      plt[i]:=odeplot( R, [eta, psi[i]/f(eta)], eta=0..5, axes=boxed);
  end do:
  display( [seq(plt[i], i=1..9)]);

`Maple 18.02, X86 64 WINDOWS, Oct 20 2014, Build ID 991181`

 

 

  cols:= [ "Purple", "Maroon", "Red", "Orange",
           "Gold", "Yellow", "Green", "LightSkyBlue", "Blue"]:
  plts2:= seq
          ( inequal
            ( [ y>psi[j]/eval( f(eta), R)(eta),
                y<psi[j+1]/eval( f(eta), R)(eta)
              ],
              eta=0..5,
              y=-2..2,
              color=cols[j],
              nolines
            ),
            j=1..8
          ):
  plts3:= seq
          ( plot
            ( psi[j]/eval( f(eta), R)(eta),
              eta=0..5,
              color=cols[j]
            ),
            j=1..9
          ):
  display([plts2, plts3]);

 

 


 

Download odeProb3.mw

@Preben Alsholm 

although the fact the variables r[0], r[1], r[2], r[3] are on the constraint limit still makes me suspicious

@666 jvbasha 

in your ODEs, the 'eta' is the independent variable. Now if you state that

"eta(N) represent eta at N value".

then eta is no longer the independent variable in your ODEs. Either

  1. Reconsider the above statement on the definition of eta(N), or
  2. Rewrite your ODE system interm of the *real* independent variable, which would seem to be 'N'

@siddikmaple 

The attached performs the same calculation as my original worksheet, ie no constraints on variables, and then does the same calculation again with the constraint that all variables lie in the range 0..1.

In both cases, "solutions" are obtained.

However wihtout constraints, the residuals are quite high, indicating that the solution may not be very good - and I hit the evaluationlimit: increasing the latter *may* provide a *better* solution, but I'm unwilling to spend the time on this. If yu really want to, try increasing the evaluationlimit by a factor of 10, and go do somethining interesting for an hour or so.

Adding the constraints that all variables are required to lie in the range 0..1, produces a solution, much more quickly, but the residuals are even higher, indicating that this really isn't a very good solution. Furthermore, in the returned solution, several of the variables are on the constraint limits - indicating that a "better" solution might be obtained if the constraints were removed.

Do you have any reason to believe that a "solution" (with small residuals) actually exists????

If you want to try re-executing this worksheet, then keep an eye on the "annunciator" in the bottom left corner of the Maple window - so long as it says "Executing", then do nothing; this may involve ignoring "warning" messages
 

restart; with(DirectSearch)

[BoundedObjective, CompromiseProgramming, DataFit, ExponentialWeightedSum, GlobalOptima, GlobalSearch, Minimax, ModifiedTchebycheff, Search, SolveEquations, WeightedProduct, WeightedSum]

(1)

NULL

Loading LinearAlgebra

lambda[0] := 0.8e-3

0.8e-3

(2)

lambda[1] := 0.8e-3

0.8e-3

(3)

lambda[2] := 0.8e-3

0.8e-3

(4)

lambda[3] := 0.8e-3

0.8e-3

(5)

n := 4

4

(6)

e1 := p[s] = (n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3]))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n

p[s] = (4*t[0]/(1-t[0])+4*t[1]/(1-t[1])+4*t[2]/(1-t[2])+4*t[3]/(1-t[3]))*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4

(7)

e2 := p[b] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n

p[b] = 1-(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4

(8)

e3 := r[0] = lambda[0]*(20*p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+20*r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5)+p[0, b]*(11258.065*p[s]/p[b]+469.725)*(p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5))+(469.725*(-p[0, p]*r[0]+p[0, p]+r[0]))*(-4*p[0, c]^5+p[0, c]^4+p[0, c]^3+p[0, c]^2+p[0, c])+11727.79-11727.79*p[0, c]^5*(-p[0, p]*r[0]+p[0, p]+r[0]))

r[0] = 0.160e-1*p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+0.160e-1*r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5)+0.8e-3*p[0, b]*(11258.065*p[s]/p[b]+469.725)*(p[0, p]*(1-r[0])*((7/2)*p[0, b]-(7/2)*p[0, b]*p[0, c]^5+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-30*p[0, c]^5)+r[0]*(7/2+(15/2)*p[0, c]+(15/2)*p[0, c]^2+(15/2)*p[0, c]^3+(15/2)*p[0, c]^4-(67/2)*p[0, c]^5))+.3757800*(-p[0, p]*r[0]+p[0, p]+r[0])*(-4*p[0, c]^5+p[0, c]^4+p[0, c]^3+p[0, c]^2+p[0, c])+9.382232-9.382232*p[0, c]^5*(-p[0, p]*r[0]+p[0, p]+r[0])

(9)

e4 := r[1] = lambda[1]*(20*p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+20*r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5)+p[1, b]*(11258.065*p[s]/p[b]+469.725)*(p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5))+(469.725*(-p[1, p]*r[1]+p[1, p]+r[1]))*(-4*p[1, c]^5+p[1, c]^4+p[1, c]^3+p[1, c]^2+p[1, c])+11727.79-11727.79*p[1, c]^5*(-p[1, p]*r[1]+p[1, p]+r[1]))

r[1] = 0.160e-1*p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+0.160e-1*r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5)+0.8e-3*p[1, b]*(11258.065*p[s]/p[b]+469.725)*(p[1, p]*(1-r[1])*((15/2)*p[1, b]-(15/2)*p[1, b]*p[1, c]^5+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-62*p[1, c]^5)+r[1]*(15/2+(31/2)*p[1, c]+(31/2)*p[1, c]^2+(31/2)*p[1, c]^3+(31/2)*p[1, c]^4-(139/2)*p[1, c]^5))+.3757800*(-p[1, p]*r[1]+p[1, p]+r[1])*(-4*p[1, c]^5+p[1, c]^4+p[1, c]^3+p[1, c]^2+p[1, c])+9.382232-9.382232*p[1, c]^5*(-p[1, p]*r[1]+p[1, p]+r[1])

(10)

e5 := r[2] = lambda[2]*(20*p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+20*r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5)+p[2, b]*(11258.065*p[s]/p[b]+469.725)*(p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5))+(469.725*(-p[2, p]*r[2]+p[2, p]+r[2]))*(-4*p[2, c]^5+p[2, c]^4+p[2, c]^3+p[2, c]^2+p[2, c])+11727.79-11727.79*p[2, c]^5*(-p[2, p]*r[2]+p[2, p]+r[2]))

r[2] = 0.160e-1*p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+0.160e-1*r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5)+0.8e-3*p[2, b]*(11258.065*p[s]/p[b]+469.725)*(p[2, p]*(1-r[2])*((31/2)*p[2, b]-(31/2)*p[2, b]*p[2, c]^5+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-478*p[2, c]^5)+r[2]*(31/2+(63/2)*p[2, c]+(127/2)*p[2, c]^2+(255/2)*p[2, c]^3+(511/2)*p[2, c]^4-(987/2)*p[2, c]^5))+.3757800*(-p[2, p]*r[2]+p[2, p]+r[2])*(-4*p[2, c]^5+p[2, c]^4+p[2, c]^3+p[2, c]^2+p[2, c])+9.382232-9.382232*p[2, c]^5*(-p[2, p]*r[2]+p[2, p]+r[2])

(11)

e6 := r[3] = lambda[3]*(20*p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+20*r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5)+p[3, b]*(11258.065*p[s]/p[b]+469.725)*(p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5))+(469.725*(-p[3, p]*r[3]+p[3, p]+r[3]))*(-4*p[3, c]^5+p[3, c]^4+p[3, c]^3+p[3, c]^2+p[3, c])+11727.79-11727.79*p[3, c]^5*(-p[3, p]*r[3]+p[3, p]+r[3]))

r[3] = 0.160e-1*p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+0.160e-1*r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5)+0.8e-3*p[3, b]*(11258.065*p[s]/p[b]+469.725)*(p[3, p]*(1-r[3])*((31/2)*p[3, b]-(31/2)*p[3, b]*p[3, c]^5+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-478*p[3, c]^5)+r[3]*(31/2+(63/2)*p[3, c]+(127/2)*p[3, c]^2+(255/2)*p[3, c]^3+(511/2)*p[3, c]^4-(987/2)*p[3, c]^5))+.3757800*(-p[3, p]*r[3]+p[3, p]+r[3])*(-4*p[3, c]^5+p[3, c]^4+p[3, c]^3+p[3, c]^2+p[3, c])+9.382232-9.382232*p[3, c]^5*(-p[3, p]*r[3]+p[3, p]+r[3])

(12)

e7 := t[0] = (-p[0, c]^5+1)/((1-p[0, c])*(r[0]+(1-r[0])/p[0, p]+(-p[0, c]^5+1)/(1-p[0, c])+(7*(p[0, b]*(1-r[0])+r[0]))/(2-2*p[0, b])+(15*p[0, c]^4+15*p[0, c]^3+15*p[0, c]^2+15*p[0, c])/(2-2*p[0, b])))

t[0] = (-p[0, c]^5+1)/((1-p[0, c])*(r[0]+(1-r[0])/p[0, p]+(-p[0, c]^5+1)/(1-p[0, c])+7*(p[0, b]*(1-r[0])+r[0])/(2-2*p[0, b])+(15*p[0, c]^4+15*p[0, c]^3+15*p[0, c]^2+15*p[0, c])/(2-2*p[0, b])))

(13)

e8 := t[1] = (-p[1, c]^5+1)/((1-p[1, c])*(r[1]+(1-r[1])/p[1, p]+(-p[1, c]^5+1)/(1-p[1, c])+(15*(p[1, b]*(1-r[1])+r[1]))/(2-2*p[1, b])+(31*p[1, c]^4+31*p[1, c]^3+31*p[1, c]^2+31*p[1, c])/(2-2*p[1, b])))

t[1] = (-p[1, c]^5+1)/((1-p[1, c])*(r[1]+(1-r[1])/p[1, p]+(-p[1, c]^5+1)/(1-p[1, c])+15*(p[1, b]*(1-r[1])+r[1])/(2-2*p[1, b])+(31*p[1, c]^4+31*p[1, c]^3+31*p[1, c]^2+31*p[1, c])/(2-2*p[1, b])))

(14)

e9 := t[2] = (-p[2, c]^5+1)/((1-p[2, c])*(r[2]+(1-r[2])/p[2, p]+(-p[2, c]^5+1)/(1-p[2, c])+(31*(p[2, b]*(1-r[2])+r[2]))/(2-2*p[2, b])+(511*p[2, c]^4+255*p[2, c]^3+127*p[2, c]^2+63*p[2, c])/(2-2*p[2, b])))

t[2] = (-p[2, c]^5+1)/((1-p[2, c])*(r[2]+(1-r[2])/p[2, p]+(-p[2, c]^5+1)/(1-p[2, c])+31*(p[2, b]*(1-r[2])+r[2])/(2-2*p[2, b])+(511*p[2, c]^4+255*p[2, c]^3+127*p[2, c]^2+63*p[2, c])/(2-2*p[2, b])))

(15)

e10 := t[3] = (-p[3, c]^5+1)/((1-p[3, c])*(r[3]+(1-r[3])/p[3, p]+(-p[3, c]^5+1)/(1-p[3, c])+(31*(p[3, b]*(1-r[3])+r[3]))/(2-2*p[3, b])+(511*p[3, c]^4+255*p[3, c]^3+127*p[3, c]^2+63*p[3, c])/(2-2*p[3, b])))

t[3] = (-p[3, c]^5+1)/((1-p[3, c])*(r[3]+(1-r[3])/p[3, p]+(-p[3, c]^5+1)/(1-p[3, c])+31*(p[3, b]*(1-r[3])+r[3])/(2-2*p[3, b])+(511*p[3, c]^4+255*p[3, c]^3+127*p[3, c]^2+63*p[3, c])/(2-2*p[3, b])))

(16)

e11 := p[0, p] = 1-exp(-lambda[0]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725))

p[0, p] = 1-exp(.3597800*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-9.0064520*(4*t[0]/(1-t[0])+4*t[1]/(1-t[1])+4*t[2]/(1-t[2])+4*t[3]/(1-t[3]))*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-.3757800)

(17)

e12 := p[1, p] = 1-exp(-lambda[1]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725))

p[1, p] = 1-exp(.3597800*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-9.0064520*(4*t[0]/(1-t[0])+4*t[1]/(1-t[1])+4*t[2]/(1-t[2])+4*t[3]/(1-t[3]))*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-.3757800)

(18)

e13 := p[2, p] = 1-exp(-lambda[2]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725))

p[2, p] = 1-exp(.3597800*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-9.0064520*(4*t[0]/(1-t[0])+4*t[1]/(1-t[1])+4*t[2]/(1-t[2])+4*t[3]/(1-t[3]))*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-.3757800)

(19)

e14 := p[3, p] = 1-exp(-lambda[3]*(-449.725*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+(11258.065*(n*t[0]/(1-t[0])+n*t[1]/(1-t[1])+n*t[2]/(1-t[2])+n*t[3]/(1-t[3])))*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n+469.725))

p[3, p] = 1-exp(.3597800*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-9.0064520*(4*t[0]/(1-t[0])+4*t[1]/(1-t[1])+4*t[2]/(1-t[2])+4*t[3]/(1-t[3]))*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4-.3757800)

(20)

e15 := p[0, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0])

p[0, c] = 1-(1-t[0])^3*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4

(21)

e16 := p[1, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1])

p[1, c] = 1-(1-t[0])^4*(1-t[1])^3*(1-t[2])^4*(1-t[3])^4

(22)

e17 := p[2, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2])

p[2, c] = 1-(1-t[0])^4*(1-t[1])^4*(1-t[2])^3*(1-t[3])^4

(23)

e18 := p[3, c] = 1-((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3])

p[3, c] = 1-(1-t[0])^4*(1-t[1])^4*(1-t[2])^4*(1-t[3])^3

(24)

e19 := p[0, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0]))^1

p[0, b] = 1-(1-t[0])^3*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4

(25)

e20 := p[1, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1]))^1

p[1, b] = 1-(1-t[0])^4*(1-t[1])^3*(1-t[2])^4*(1-t[3])^4

(26)

e21 := p[2, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2]))^2

p[2, b] = 1-(1-t[0])^8*(1-t[1])^8*(1-t[2])^6*(1-t[3])^8

(27)

e22 := p[3, b] = 1-(((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3]))^6

p[3, b] = 1-(1-t[0])^24*(1-t[1])^24*(1-t[2])^24*(1-t[3])^18

(28)

e23 := p[0, s] = n*t[0]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[0])

p[0, s] = 4*t[0]*(1-t[0])^3*(1-t[1])^4*(1-t[2])^4*(1-t[3])^4

(29)

e24 := p[1, s] = n*t[1]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[1])

p[1, s] = 4*t[1]*(1-t[1])^3*(1-t[0])^4*(1-t[2])^4*(1-t[3])^4

(30)

e25 := p[2, s] = n*t[2]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[2])

p[2, s] = 4*t[2]*(1-t[2])^3*(1-t[0])^4*(1-t[1])^4*(1-t[3])^4

(31)

e26 := p[3, s] = n*t[3]*((1-t[0])*(1-t[1])*(1-t[2])*(1-t[3]))^n/(1-t[3])

p[3, s] = 4*t[3]*(1-t[3])^3*(1-t[0])^4*(1-t[1])^4*(1-t[2])^4

(32)

ans := DirectSearch:-SolveEquations([e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26], evaluationlimit = 1000000)

Warning, complex or non-numeric value encountered; trying to find a feasible point

 

Warning, limiting number of function evaluations (1000000) is reached; set initial point equal to extremum point obtained, increase evaluationlimit option and continue search

 

ans := [.141940800436204, Vector(26, {(1) = HFloat(-0.2446506143812796), (2) = HFloat(-0.00979984828503963), (3) = HFloat(9.770961226518438e-5), (4) = HFloat(-9.203888640492153e-4), (5) = HFloat(9.965874998165702e-4), (6) = HFloat(2.3932142061511286e-4), (7) = HFloat(0.15324932419701784), (8) = HFloat(0.14251124709556703), (9) = HFloat(0.128214830682602), (10) = HFloat(0.14388227020736405), (11) = HFloat(0.0028282884935391384), (12) = HFloat(-0.0031185639298631773), (13) = HFloat(-0.002812863846198471), (14) = HFloat(0.007891130931467788), (15) = HFloat(2.2508468523443903e-4), (16) = HFloat(0.012098161683308462), (17) = HFloat(0.01098349992314046), (18) = HFloat(0.012757175127855735), (19) = HFloat(-0.01894674061069032), (20) = HFloat(-0.004663518941388167), (21) = HFloat(-0.006074219279134796), (22) = HFloat(-0.0014677282871336124), (23) = HFloat(0.006025948054958333), (24) = HFloat(-0.0061187494181677154), (25) = HFloat(4.892417982841624e-4), (26) = HFloat(0.00644187355128744)}), [p[b] = .912940522225553, p[s] = -0.298940562826350e-1, p[0, b] = .888025243332773, p[0, c] = .907197068628697, p[0, p] = .900766630960018, p[0, s] = 0.690994943234788e-1, p[1, b] = .904520804725458, p[1, c] = .921282485350155, p[1, p] = .894819778536616, p[1, s] = 0.481054379568176e-1, p[2, b] = .986069072621362, p[2, c] = .922345426278101, p[2, p] = .895125478620281, p[2, s] = 0.460030184208134e-1, p[3, b] = .998531731500358, p[3, c] = .922511283680296, p[3, p] = .905829473397947, p[3, s] = 0.583869213838969e-1, r[0] = 3.33985020900287, r[1] = 3.31308781760733, r[2] = 7.95112999816649, r[3] = 8.03598293683291, t[0] = .169501481763805, t[1] = .149269899108790, t[2] = .128369713913217, t[3] = .143898650119695], 1000001]

(33)

#
# Generate constraints forcing all variables to be
# in the range 0..1
#
  constr:= [ seq
            ( j=0..1,
              j in `union`
                   ( indets~
                     ( [ seq
                         ( eval(cat(e,j)),
                           j=1..26
                         )
                       ],
                      'name'
                     )[]
                   )
            )
          ];

[p[b] = 0 .. 1, p[s] = 0 .. 1, p[0, b] = 0 .. 1, p[0, c] = 0 .. 1, p[0, p] = 0 .. 1, p[0, s] = 0 .. 1, p[1, b] = 0 .. 1, p[1, c] = 0 .. 1, p[1, p] = 0 .. 1, p[1, s] = 0 .. 1, p[2, b] = 0 .. 1, p[2, c] = 0 .. 1, p[2, p] = 0 .. 1, p[2, s] = 0 .. 1, p[3, b] = 0 .. 1, p[3, c] = 0 .. 1, p[3, p] = 0 .. 1, p[3, s] = 0 .. 1, r[0] = 0 .. 1, r[1] = 0 .. 1, r[2] = 0 .. 1, r[3] = 0 .. 1, t[0] = 0 .. 1, t[1] = 0 .. 1, t[2] = 0 .. 1, t[3] = 0 .. 1]

(34)

#
# Solve the problem again, this time with constraints on
# all variables. "Solution" is found much quicker, but
#
# 1. residuals are much higher (not good)
# 2. many of the variables are on the constraint limits -
#    never a good sign
#
  ans := DirectSearch:-SolveEquations
         ( [seq( cat(e,j), j=1..26)],
           constr,
           evaluationlimit = 1000000
         );

ans := [6.39599302240370, Vector(26, {(1) = HFloat(2.732283226662625e-4), (2) = HFloat(-0.4021901031286086), (3) = HFloat(0.0061338654677776105), (4) = HFloat(0.014755418930521458), (5) = HFloat(-0.04125528653351296), (6) = HFloat(0.01913751505155048), (7) = HFloat(0.9853644253978385), (8) = HFloat(0.8722258588610136), (9) = HFloat(0.7687338277160501), (10) = HFloat(0.4255085057837484), (11) = HFloat(0.5598522856486846), (12) = HFloat(0.6854727693830306), (13) = HFloat(0.4621499147079877), (14) = HFloat(0.5454971140858231), (15) = HFloat(-0.012200370938483474), (16) = HFloat(-0.008209254046319225), (17) = HFloat(-0.0018090017289594806), (18) = HFloat(-1.5352168806381794e-4), (19) = HFloat(-0.09952391631800417), (20) = HFloat(-0.059731240354404025), (21) = HFloat(-0.3839538975137221), (22) = HFloat(-8.331646483838995e-11), (23) = HFloat(0.8614451746053734), (24) = HFloat(0.6850684216200273), (25) = HFloat(0.7486696347892658), (26) = HFloat(0.7076011812805545)}), [p[b] = .597809896871391, p[s] = 0.273228322666263e-3, p[0, b] = .900476083681996, p[0, c] = .987799629061517, p[0, p] = .873098883476119, p[0, s] = .861445174605373, p[1, b] = .940268759645596, p[1, c] = .991790745953681, p[1, p] = .998719367210465, p[1, s] = .685068421620027, p[2, b] = .616046102486278, p[2, c] = .998190998271041, p[2, p] = .775396512535422, p[2, s] = .748669634789266, p[3, b] = .999999999916684, p[3, c] = .999846478311936, p[3, p] = .858743711913258, p[3, s] = .707601181280554, r[0] = .999665583978414, r[1] = .999999999999859, r[2] = .818013080084251, r[3] = .603641908770598, t[0] = .999999999999895, t[1] = .876509083943578, t[2] = .772622394210187, t[3] = .425508505784593], 3398]

(35)

 

Download eqSolve2.mw

First 78 79 80 81 82 83 84 Last Page 80 of 207