Maple 2018 Questions and Posts

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

how I can find an non-trial solution (non-zero) for differential equations?

Thanks

y.mw
 

restart; Nb := 2; Nt := .5; f1 := Nb*(diff(sigma(y), y, y))+Nt*(diff(theta(y), y, y)) = 0; f2 := diff(theta(y), y, y)+Nb*(diff(sigma(y), y))*(diff(theta(y), y))+Nt*(diff(theta(y), y))^2 = 0; f3 := (D(sigma))(0) = 0; f4 := (D(theta))(0) = 0; f5 := sigma(1) = 0; f6 := theta(1) = 0; f7 := dsolve({f1, f2, f3, f4, f5, f6}, {sigma(y), theta(y)}, numeric, output = listprocedure); plots:-odeplot(f7, [[y, sigma(y)]], y = 0 .. 1, legend = [y], labels = [y, sigma(y)]); plots:-odeplot(f7, [[y, theta(y)]], y = 0 .. 1, legend = [y], labels = [y, theta(y)])

2

 

.5

 

2*(diff(diff(sigma(y), y), y))+.5*(diff(diff(theta(y), y), y)) = 0

 

diff(diff(theta(y), y), y)+2*(diff(sigma(y), y))*(diff(theta(y), y))+.5*(diff(theta(y), y))^2 = 0

 

(D(sigma))(0) = 0

 

(D(theta))(0) = 0

 

sigma(1) = 0

 

theta(1) = 0

 

[y = proc (y) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); YP := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = -.0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = -.0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = -.0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = -.0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = -.0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = -.0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = -.0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = -.0}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [4, 8, [sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(4, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(4, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)]'[i] = yout[i], i = 1 .. 4)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [4, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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}, datatype = float[8], order = C_order); yout := Vector(4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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.}, order = C_order); yout := Vector(4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}); `dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 4)] end proc, (2) = Array(1..5, {(1) = 18446746401092086174, (2) = 18446746401092086614, (3) = 18446746401092086790, (4) = 18446746401092086966, (5) = 18446746401092087142}), (3) = [y, sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], (4) = 0}); _solnproc := _dat[1]; if member(y, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(y, `=`) and member(lhs(y), ["initial", 'initial']) then if type(rhs(y), 'list') then _res := _solnproc("initial" = [0, op(rhs(y))]) else _res := _solnproc("initial" = [1, rhs(y)]) end if; if type(_res, 'list') then return _res[1] end if elif y = "sysvars" then return _dat[3] end if; y end proc, sigma(y) = proc (y) local res, data, solnproc, `sigma(y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); YP := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = -.0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = -.0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = -.0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = -.0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = -.0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = -.0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = -.0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = -.0}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [4, 8, [sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(4, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(4, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)]'[i] = yout[i], i = 1 .. 4)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [4, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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}, datatype = float[8], order = C_order); yout := Vector(4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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.}, order = C_order); yout := Vector(4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}); `dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 4)] end proc, (2) = Array(1..5, {(1) = 18446746401092086174, (2) = 18446746401092086614, (3) = 18446746401092086790, (4) = 18446746401092086966, (5) = 18446746401092087142}), (3) = [y, sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `sigma(y)` := pointto(data[2][2]); return ('`sigma(y)`')(y) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, diff(sigma(y), y) = proc (y) local res, data, solnproc, `diff(sigma(y),y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); YP := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = -.0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = -.0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = -.0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = -.0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = -.0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = -.0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = -.0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = -.0}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [4, 8, [sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(4, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(4, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)]'[i] = yout[i], i = 1 .. 4)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [4, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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}, datatype = float[8], order = C_order); yout := Vector(4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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.}, order = C_order); yout := Vector(4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}); `dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 4)] end proc, (2) = Array(1..5, {(1) = 18446746401092086174, (2) = 18446746401092086614, (3) = 18446746401092086790, (4) = 18446746401092086966, (5) = 18446746401092087142}), (3) = [y, sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `diff(sigma(y),y)` := pointto(data[2][3]); return ('`diff(sigma(y),y)`')(y) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc, theta(y) = proc (y) local res, data, solnproc, `theta(y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); YP := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = -.0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = -.0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = -.0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = -.0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = -.0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = -.0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = -.0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = -.0}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [4, 8, [sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(4, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(4, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)]'[i] = yout[i], i = 1 .. 4)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [4, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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}, datatype = float[8], order = C_order); yout := Vector(4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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.}, order = C_order); yout := Vector(4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}); `dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 4)] end proc, (2) = Array(1..5, {(1) = 18446746401092086174, (2) = 18446746401092086614, (3) = 18446746401092086790, (4) = 18446746401092086966, (5) = 18446746401092087142}), (3) = [y, sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `theta(y)` := pointto(data[2][4]); return ('`theta(y)`')(y) end if end if; try res := solnproc(outpoint); res[4] catch: error  end try end proc, diff(theta(y), y) = proc (y) local res, data, solnproc, `diff(theta(y),y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); YP := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = -.0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = -.0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = -.0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = -.0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = -.0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = -.0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = -.0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = -.0}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .1428571428571428, (3) = .2857142857142856, (4) = .4285714285714285, (5) = .5714285714285715, (6) = .7142857142857144, (7) = .8571428571428572, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [4, 8, [sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(4, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(4, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 4, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)]'[i] = yout[i], i = 1 .. 4)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 2 elif outpoint = "error" then return HFloat(-0.0) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [4, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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}, datatype = float[8], order = C_order); yout := Vector(4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 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.}, order = C_order); yout := Vector(4, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.}); `dsolve/numeric/hermite`(8, 4, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 4)] end proc, (2) = Array(1..5, {(1) = 18446746401092086174, (2) = 18446746401092086614, (3) = 18446746401092086790, (4) = 18446746401092086966, (5) = 18446746401092087142}), (3) = [y, sigma(y), diff(sigma(y), y), theta(y), diff(theta(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `diff(theta(y),y)` := pointto(data[2][5]); return ('`diff(theta(y),y)`')(y) end if end if; try res := solnproc(outpoint); res[5] catch: error  end try end proc]

 

 

 

NULL


 

Download y.mw

 

I wish to process a string of letters into a list of one or more characters which are comma separated at each change of character. The following function will achieve this, but its output is not as list [ ] in the format required.  

Below is a routine to split a character string based on change of character: (ref: https://rosettacode.org/wiki/Split_a_character_string_based_on_change_of_character#Maple)

splitChange := proc (str::string) local start, i, len; start := 1; len := StringTools:-Length(str); for i from 2 to len do if str[i] <> str[start] then printf("%s, ", str[start .. i-1]); start := i end if end do; printf("%s", str[start .. len]) end proc;
splitChange("WPKCPYWYYYXHYY");# 

Here is the output:
W, P, K, C, P, Y, W, YYY, X, H, YY

This print-to screen output is not usable, instead I need the output in list format i.e. ListY:= ["W", "P", "K", "C", "P", "Y", "W", "YYY", "X", "H", "YY"].

Background

 In my model, each of these character strings is a node of a graph, and their adjacencies represent an edges of a graph.  I aim to automatically map strings into a set of directed adjacencies as output; for example:  

AdjSet:= {[W, P], [P, K], [K, C], [C, P], [P, Y], [Y, W], [W,YYY],[YYY, X], [X, H], [H,YY]}.

This set will be the input to a directed graph, e.g: 
M := Digraph(AdjSet); DrawGraph(M);
from which our objective, the adjacency matrix of the nodes can be obtained in MAPLE.  

Help

Can someone please help me by modifying the SplitChange rountine so that it produces output in the form of ListY above? 

Thanks in anticipation of your help

Melvin Brown
 

Hi,

In a recent post acer made me discover the joy of Typesetting to customize the outputs (acer, if you read this question: big thanks to you, really funny and powerful!)

I'm interested in using Typesetting for output coloring (for instance) but I would like that these outputs to be left justified.
Up to now I used to use printf to manage the outputs the way I wanted, but I failed combining Typesetting and printf.

Is it possible to exploit the capabilities of Typesetting in printf commands?
Or, at least, is it possible to "left-justify" print outputs programatically?

Thanks for your answers


I have assumed lambda <-1 yet signum(lambda) returns lambda~.  It should be -1. I need to show that the expression lambda is used in is negative. 

restart

NULL

assume(t > 0, k > 1, lambda = 'real', mu = 'real', mu = 'real', lambda+mu+nu = 1)

about(lambda)

Originally lambda, renamed lambda~:

  Involved in the following expressions with properties
    -real+lambda assumed `property/object`[0]
    lambda+mu+nu assumed `property/object`[1]
  also used in the following assumed objects
  [-real+lambda] assumed 0
  [lambda+mu+nu] assumed 1

 

signum(lambda)

signum(lambda)

(1)

additionally(lambda <= -1)

about(lambda)

Originally lambda, renamed lambda~:

  Involved in the following expressions with properties
    -real+lambda assumed `property/object`[0]
    lambda+mu+nu assumed `property/object`[1]
  is assumed to be: RealRange(-infinity,-1)
  also used in the following assumed objects
  [-real+lambda] assumed 0
  [lambda+mu+nu] assumed 1

 

signum(lambda)

signum(lambda)

(2)

sCDB := (4*(k-1))*(k+1)*`&lambda;`*t^3/((t^2+1)^2*(k^2*t^2+1))

4*(k-1)*(k+1)*lambda*t^3/((t^2+1)^2*(k^2*t^2+1))

(3)

signum(sCDB)

signum(lambda)

(4)

``


 

Download signum_problem.mw

Hi,


When you do this a := plot(1/x, x=0..1);  the figure contains a "smart" graph which extends roughly from 0 to 30 in the vertical direction.
(no discont=true nor smartview=false used here, numpoints set to its default falue)

If you use plottools:-getdata(a); you find that the vertical range is about  0..1800.
It seems to mean that smartview=true (the default setting) overrides the range determined from the values of discont and numpoints?
 

My question is: Is it possible to retrieve the vertical range that plot uses when it displays the graph?
 

Hello Dr/Pof/Colleague

Please help me on the ODE BVP problem

my target i want RUN double loop


 

restart

with(plots)

b := 0; c := 0; k[1] := 1; k[2] := 0; Un := 0; d := 0

Eq1 := (101-100*lambda)*(1+a*phi(eta))*(diff(f(eta), `$`(eta, 3)))+(diff(f(eta), `$`(eta, 2)))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(f(eta), eta))^2+k[2]+Un*(k[2]-(1/2)*eta*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))) = 0

(101-100*lambda)*(1+a*phi(eta))*(diff(diff(diff(f(eta), eta), eta), eta))+(diff(diff(f(eta), eta), eta))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(f(eta), eta))^2 = 0

(1)

Eq2 := (101-100*lambda)*(1+a*phi(eta))*(diff(g(eta), `$`(eta, 3)))+(diff(g(eta), `$`(eta, 2)))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(g(eta), eta))^2+k[2]+Un*(k[2]-(1/2)*eta*(diff(g(eta), `$`(eta, 2)))-(diff(g(eta), eta))) = 0

(101-100*lambda)*(1+a*phi(eta))*(diff(diff(diff(g(eta), eta), eta), eta))+(diff(diff(g(eta), eta), eta))*(f(eta)+g(eta)+a*(diff(phi(eta), eta)))-(diff(g(eta), eta))^2 = 0

(2)

NULL

Valpha := [0, .1, .2]; Va := [0, 0]

etainf := 100

bcs := (D(f))(0) = k[1], (D(g))(0) = alpha, f(0) = 0, g(0) = 0, (D(f))(etainf) = k[2], (D(g))(etainf) = k[2]

(D(f))(0) = 1, (D(g))(0) = alpha, f(0) = 0, g(0) = 0, (D(f))(100) = 0, (D(g))(100) = 0

(3)

dsys := {Eq1, Eq2, bcs}

for j to 2 do for i to 3 do a := Va[j]; alpha := Valpha[i]; dsol[j][i] := dsolve(dsys, numeric, continuation = lambda); print(alpha); print(a); print(dsol[j][i](0)) end do end do

Error, incorrect number of arguments to _Inert_FORFROM

"for j from 1 to 2 do   for i from 1 to 3 do a:=Va[j]; alpha:=Valpha[i];  dsol[j][i]:=dsolve(dsys,numeric, continuation=lambda);  print(alpha);    print(a);  print(dsol[j][i](0));  od  end"

 

NULL

 


 

Download 3DAKc2alpha.mw

I am developping an algorythm in which I need to obtain a 3D plot and its respective colorbars. As far as I know, Maple does not have a function with includes such a colorbar automatically (like Matlab, for example). So, I have had to get 3D plot and colorbar separatelly, as independent plots. It has worked fine, but now I need to export such graphics as EPS files, which imply merging them as a single graphic.

Here is a small example, where I try to put such graphics inside a table for then exporting it as EPS:

restart:

with(plots):
with(DocumentTools):

graph:= plot3d(x^2+y^2, x = -10..10, y = -10..10, colorscheme = ["zgradient", ["Red","Blue"]]):

grad_min, grad_max:= (min, max)(op([1,3], indets(graph, specfunc(anything, GRID)))):

colorbar:= densityplot(axis_z, axis_x = 0..0.1, axis_z = grad_max..grad_min, style = patchnogrid, size = [100,250], axes = boxed, tickmarks = [0,10], labels = ["",""], colorscheme = ["zgradient", ["Red","Blue"]]):

tab:= Tabulate([graph, colorbar], exterior = none, interior = none, weights = [4,1]):

 It has not worked, though. Can anyone suggest a solution for that? I need to export both graphics as one single file, preferably EPS, because of its high resolution.

Let us consider

plots:-inequal(max(1, min(x, 2))+max(1, min(y, 2)) <= 3, x = -4 .. 4, y = -4 .. 4);


and compare it with

plots:-implicitplot(max(1, min(x, 2))+max(1, min(y, 2)) = 3, x = -4 .. 4, y = -4 .. 4, gridrefine = 2);

The latter plot must be a subset of the former plot, but it isn't so. bug_in_inequal.mw

Hi guys! First time posting here and I'm very new to Maple too.

I'm using maple right now to calculate statics problems, and for that we've customized some units to better fit what we're working with and want to see in output. In general, it's working great, but sometimes when I try to use the solve function including these units, I get an error mesage I don't really understand..

Here's the unit customization:

restart;
with(Units); AddSystem(NewSI, GetSystem(SI), kN*m, kN/m, kN, MPa); UseSystem('NewSI');
Automatically loading the Units[Natural] subpackage 

Error, (in Units:-AddSystem) expecting a unit but got `Units:-Unit(kN*m)`
with(Units[Natural]);
 
- As said, in general I have no problems, despite the error message above, it's only when using the solve function as follows:
 
(I've defined A,B,C and G, all with results in kN)
solve(OL-A-B-C-G=0,OL)
 
Then it gives me this error:
Error, (in Units:-Standard:-+) the units `1` and `kN` have incompatible dimensions
 
What I want here is to setup an equilibrium equation, and then solve for the variable OL, which should be output in kN. 
First of all, I don't really understand what Maple is trying to tell me here?
-I figure it has something to do with the new units i'm adding, and when if I'm putting the units commands into the startupcode customizer, it tells me another error:
Error: (in Units:-AddSystem) expecting a unit but got `Units:-Unit(kN*m)
 
But I don't know how to do something about this, the new units I defne is simply something I've cpoy/pasted from another source, I don't have any knowledge about how to customize the system myself..
Googling this problem only leads me to the maple help websites, but that doesn't help me as I'm completely new to all this...

So I was hoping someone could help me fix the error(s), or at least understand what the errors mean..

 

I have the following Maple code.

 

x := [5, 10, 15, 20];

y := [4.22, 7.49, 12.24, 19.60];  

yui := [2.48, 3.76, 6.11, 14.60];

yli := [2.27, 3.34, 6.09, 10.90];

 

with(Statistics): with(plots):

p1 := ErrorPlot(y, coords = x, yerrors = yui);

this produces a plot with error bars. The problem is that I acutally have unequal errors. In the ErrorPlot helpfile it says:

"This options specifies errors along the x-axis. The array of errors must have the same number of elements. To specify right errors and left errors separately, use the list of two vectors." (this pertains to xerrors obviously but below it says the same applies to yerrors)

I have tried entering the code above with yerrors=[yli,yui] and with yerrors={yli,yui}....but neither option works and I get the error:

"Error, invalid input: Statistics:-ErrorPlot expects value for keyword parameter yerrors to be of type {identical(default), [{array, list, rtable, DataFrame, DataSeries}, {array, list, rtable, DataFrame, DataSeries}], {array, list, rtable, DataFrame, DataSeries}}, but received {[2.27, 3.34, 6.09, 10.90], [2.48, 3.76, 6.11, 14.60]}"

Can anyone advise me on what I'm doing wrong - I am very new to Maple.

Jo

 

I have been trying to solve this equation by obtaining solutions for x and I actually handed in for an assignment what Maple gave me as an output. Then it turns out that Maple was wrong. This is in fact not a solution for the equation. What am I doing wrong here?
Solve_error.mw

This is my first problem with Maple but i am pretty confused as to why it would struggle with these steps.

Just using a standard worksheet, here is what i have:

> f:=(4^x)+1

>g:=x^4

> solve(g=f,x)

now, i would just expect this to come back with 3 answers, but instead i get 

Warning, solutions may have been lost
                     RootOf(-4^_Z - 1 + _Z^4)

if I do:

>fsolve(g=f,x)

It comes back with only one of the answers(2.094012853), instead of all three.

What am I doing wrong?

I mean, for example,

solve({4*x1+7*x2+6*x3 = 186, floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21});
Warning, solutions may have been lost

A finite number of the solutions can be found by DirectSearch

DirectSearch:-SolveEquations([floor((1/2)*x1)+floor((1/5)*x2)+floor((1/3)*x3) = 18, 
floor((1/5)*x1)+floor((1/2)*x2)+floor((1/4)*x3) = 21, 4*x1+7*x2+6*x3 = 186], 
{x1 >= -100, x2 >= -100, x3 >= -100, x1 <= 100, x2 <= 100, x3 <= 100}, 
AllSolutions, solutions = 3, number = 1000);

Matrix(3, 4, [[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 74.18778903830886, x2 = 58.93905207777524, x3 = -87.22075344961036], 185], 
[0., Vector[column](3, [0., 0., 0.]),
 [x1 = 71.22714241634635, x2 = 56.43467122661542, x3 = -82.32521137528222], 164],
 [0., Vector[column](3, [0., 0., 0.]), 
[x1 = 73.6407870507502, x2 = 58.33738250527096, x3 = -86.15413762331626], 165]])

I don't see a way to obtain the MMA answer (in Maple notation)

(155/2 < x1 and x1 < 78 and 744/7-4*x1*(1/7) < x2 and x2 < 62 or 72 <= x1 and x1 <= 73 and
 102-4*x1*(1/7) < x2 and x2 < 62 or 73 < x1 and x1 <= 147/2 and 102-4*x1*(1/7) < x2 and
 x2 <= 726/7-4*x1*(1/7) or 147/2 < x1 and x1 < 74 and 60 <= x2 and x2 <= 726/7-4*x1*(1/7) or
 74 <= x1 and x1 < 75 and 726/7-4*x1*(1/7) < x2 and x2 < 62 or 153/2 < x1 and x1 < 78 and
 726/7-4*x1*(1/7) < x2 and x2 < 60 or x1 = 72 and 58 <= x2 and x2 < 60 or 72 < x1 and x1 < 74 and
 58 <= x2 and x2 <= 708/7-4*x1*(1/7) or 75 <= x1 and x1 < 76 and 102-4*x1*(1/7) < x2 and x2 < 60 or
 x1 = 74 and 442/7 < x2 and x2 < 64 or 74 < x1 and x1 < 75 and 738/7-4*x1*(1/7) < x2 and 
x2 <= 744/7-4*x1*(1/7) or 74 <= x1 and x1 < 75 and 708/7-4*x1*(1/7) < x2 and x2 <= 102-4*x1*(1/7) or 
151/2 < x1 and x1 < 76 and 708/7-4*x1*(1/7) < x2 and x2 < 58 or 157/2 < x1 and x1 < 80 and
 762/7-4*x1*(1/7) < x2 and x2 < 64 or 68 <= x1 and x1 < 137/2 and 56 <= x2 and x2 <= 666/7-4*x1*(1/7) or
 x1 = 137/2 and x2 = 56 or x1 = 70 and 56 < x2 and x2 < 58 or 70 < x1 and x1 <= 71 and 56 <= x2 and
 x2 < 58 or 71 < x1 and x1 < 72 and 56 <= x2 and x2 <= 690/7-4*x1*(1/7) or 70 <= x1 and x1 <= 281/4 and
 54 <= x2 and x2 < 55 or 281/4 < x1 and x1 < 72 and 54 <= x2 and x2 <= 666/7-4*x1*(1/7)) and
 x3 = 31-2*x1*(1/3)-7*x2*(1/6)

PS. MMA_solution.pdf MMA_solution.mw

I get this message everytime I am trying to open my worksheet: "Recover Corrupt File and Save As"

2.G_anden_aflevering.mw

I've tried alot, but nothing seems to work. The problem occurres whenever im trying to use multiple SI Units in caculations that require division. Example:

"`E__n`:=n->-6.63*10^(-34)&lobrk;J&robrk;*&lobrk;s&robrk;*3*10^(8)*&lobrk;m&robrk;/(&lobrk;s&robrk;)*1.097*10^(7)&lobrk;m&robrk;^(-1)*1/(n^(2)):"

Error, null

Parse:-ConvertTo1D, "invalid input %1", 3

 

""

"eV:=x->x/(1.602*10^(-19)&lobrk;J&robrk;/(&lobrk;eV&robrk;))"

Error, null

Parse:-ConvertTo1D, "invalid input %1", 6

 

``


 

Download Maple_prob1.mw

 

 

First 32 33 34 35 36 37 38 Last Page 34 of 50