Maple 2016 Questions and Posts

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

Hi

Please download and check the attached file.
It seems when you run the code more than one time, various results are obtained each time.

What is the reason? How it can be fixed?

Thanks


 

restart; Digits := 20; tm := time(); with(LinearAlgebra); m := 6; a := .1; b := 10*a; E := 1; h := 1; nu := .3; ur := -w*z+u0; u0 := 0; ut := add(add(T[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m); w := (r-b)^2*(r-a)^2*add(add(W[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m); er := diff(ur, r); et := ur/r+(diff(ut, t))/r; ert := 1/2*(diff(ut, r)-ut/r+(diff(ur, t))/r); u := -(1/2)*E*(2*er*et*nu+er^2+et^2)/(nu^2-1)+2*E*ert^2/(2+2*nu); N := sum(i+1, i = 0 .. m); PI := int(int(int(u*r, z = -(1/2)*h .. (1/2)*h), t = 0 .. 2*Pi), r = a .. b)-.5*P*(int(int(r*(diff(w, r))^2, r = a .. b), t = 0 .. 2*Pi)); s1 := seq(indets(add(add(T[n, i], n = 0 .. i), i = 0 .. m))[k] = c[k], k = 1 .. N); s2 := seq(indets(add(add(W[n, i], n = 0 .. i), i = 0 .. m))[k] = c[k+N], k = 1 .. N); PI := subs(s1, s2, PI); for k to 2*N do diff(PI, c[k]); if % = 0 then ex := `union`({}, {k}) else eq[k] := % end if end do; NE := seq(ex[j], j = 1 .. numelems(ex)); M := GenerateMatrix([`$`(eq[j], j = 1 .. 2*N)], [`$`(c[j], j = 1 .. 2*N)])[1]; M := DeleteColumn(DeleteRow(M, NE), NE); Determinant(M); 12*fsolve(%, P = 0 .. 1)*(-nu^2+1)*a^2/(E*h^3); Time = time()-tm

Time = 85.363

(1)

``


 

Download Stability.mw

hello guys, I can't take the real part of this formula that you can see in the picture that I upload for you.
please help me!!!!!!!!
sorry for uploading photo...so surry

Plot3d in this worksheet calls a procedure which conditionally returns the values for a parametrically defined ellipsoid, but the plot command fails. However the procedure passes the correct list of parametric values when it is called directly.

Is there a way to call a procedure within plot3d which successfully plots a parametrically defined surface?

Plot3d_proc_parametric.mw

Hello, everybody,

If I had the graph of a function just like plot(sin(x), x=-2..2)

The question is I want to plot this function is discrite form    by the pair of points (x[i], sin9x[i]) and i=1...N, where N is an integer number

The edges of the red and blue surfaces are ragged. Can they be made smoother when displayed?

Intersecting_surfaces.mw

Supposing as a nice simple example I use the power series command,

series(ex, x=0,8)

to get,

1+x+12x+ 16x+ 124x+ 1120x+ 1720x+ 15040x7

Is there automated anyway to get this as a Sigma representation? 

Hello, I have been attempting to plot a sequence of arrows in order to display how the vectors of the Frenet-Serret frame change throughout an helix-like trajectory. I came up with the following:

(With p1 being a plot I made earlier)

for t from 0 by 0.1e-1 to 12.5663706144 do plots[display](p1, plottools[arrow](Vector([cos(t), sin(t), t/(7.5)]), Vector([-(1/2)*sqrt(2)*sin(t), (1/2)*sqrt(2)*cos(t), (1/2)*sqrt(2)]), .1, .2, .3, cylindrical_arrow)) end do

This plots the desired arrow representing the tangent vector; however, it creates a plot for each step, while what I want is for it to display the arrow on each step in the same plot (as an animation).

I have attempted using the seq command, but I can't seem to get it right.

plots[display](p1, plottools[arrow](seq([Vector([cos(t), sin(t), t/(7.5)]), Vector([-(1/2)*sqrt(2)*sin(t), (1/2)*sqrt(2)*cos(t), (1/2)*sqrt(2)]), .1, .2, .3, cylindrical_arrow], t = 0 .. 4*Pi, 0.1e-1)))

With this code, the sequence won't be able to be executed.

Any ideas on how to do this? How can I use the sequence command in combination with plottools[arrow]?

Hello everyone.and complements

Please I am trying to obtain series expansion of the expression below in u but encounter difficulties particularly when b=0. I am very optimistic that when b=0 there will be a result not division by 0. Can I get help on the code?

Thank you in anticipation of your quick and positive responses and suggestions

# for k=2 CHEBY HYBRID WITH mu=(1-(1/2)*sqrt(2)))) AND v=(1+(1/2)*sqrt(2))))
restart:
omega:=u/h:
t:=(sum(a[j]*x^j,j=0..3)+a[4]*sin(omega*x)+a[5]*cos(omega*x)):
F:=diff(t,x):
G:=diff(t,x,x):
p1:=simplify(eval(t,x=q))=y[n]:
p2:=simplify(eval(t,x=q+(1-(1/2)*sqrt(2))*h))=y[n+mu]:
p3:=simplify(eval(t,x=q+h))=y[n+1]:
p4:=simplify(eval(t,x=q+(1+(1/2)*sqrt(2))*h))=y[n+v]:
p5:=simplify(eval(F,x=q+2*h))=f[n+2]:
p6:=simplify(eval(G,x=q+2*h))=g[n+2]:

vars:= seq(a[i],i=0..5):
Cc:=eval(<vars>, solve({p||(1..6)}, {vars})):
for i from 1 to 6 do
	a[i-1]:=Cc[i]:
end do:
Cf:=t:

K:=collect(combine(simplify(eval(Cf,x=q+2*h),size),trig),{y[n],y[n+mu],y[n+1],y[n+v],f[n+2], g[n+2]},factor):


Num := numer(K):
Den := denom(K):

N := 20:   # order of expansion
Num_N :=(convert(series(Num, u, N),polynom)):
Den_N := (convert(series(Den, u, N),polynom)):
b:=y[n+2]=(convert(series(Num_N/Den_N, u, N),polynom)):

eval(b,u=0); 

 

how can solve this nonlinear integral eq?

Hi there

I am trying to solve the ODE below

schechter_guo_v2.mw
 

odeSG := {diff(z(t), t) = (-phi*z(t)*sqrt(F*phi*z(t)/(5*t))/(3*t)+1-H/(1-z(t)))/(phi*(S_oi-S_or-sqrt(F*phi*z(t)/(5*t)))), z(t0) = z0}

{diff(z(t), t) = (-(1/15)*phi*z(t)*5^(1/2)*(F*phi*z(t)/t)^(1/2)/t+1-H/(1-z(t)))/(phi*(S_oi-S_or-(1/5)*5^(1/2)*(F*phi*z(t)/t)^(1/2))), z(t0) = z0}

(1)

solSG := dsolve(odeSG, numeric, method = lsode, parameters = [phi, F, H, S_oi, S_or, t0, z0])

proc (x_lsode) local _res, _dat, _vars, _solnproc, _xout, _ndsol, _pars, _n, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](x_lsode) else _xout := evalf(x_lsode) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _n, _y0, _ctl, _octl, _reinit, _errcd, _fcn, _i, _yini, _pars, _ini, _par; option `Copyright (c) 2002 by the University of Waterloo. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _ctl := array( 1 .. 39, [( 1 ) = (1), ( 2 ) = (t0), ( 3 ) = (t0), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (10), ( 7 ) = (0), ( 9 ) = (0.1e-6), ( 8 ) = (z0), ( 11 ) = (0), ( 10 ) = (0.1e-6), ( 13 ) = (0), ( 12 ) = (0), ( 15 ) = (0), ( 14 ) = (0), ( 18 ) = (0), ( 19 ) = (0), ( 16 ) = (0), ( 17 ) = (0), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = (0), ( 21 ) = (0), ( 27 ) = (0), ( 26 ) = (0), ( 25 ) = (0), ( 24 ) = (0), ( 31 ) = (-1), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 36 ) = (0), ( 37 ) = (0), ( 38 ) = (0), ( 39 ) = (0), ( 32 ) = (7), ( 33 ) = (0), ( 34 ) = (0), ( 35 ) = (0)  ] ); _octl := array( 1 .. 39, [( 1 ) = (1), ( 2 ) = (t0), ( 3 ) = (t0), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (10), ( 7 ) = (0), ( 9 ) = (0.1e-6), ( 8 ) = (z0), ( 11 ) = (0), ( 10 ) = (0.1e-6), ( 13 ) = (0), ( 12 ) = (0), ( 15 ) = (0), ( 14 ) = (0), ( 18 ) = (0), ( 19 ) = (0), ( 16 ) = (0), ( 17 ) = (0), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = (0), ( 21 ) = (0), ( 27 ) = (0), ( 26 ) = (0), ( 25 ) = (0), ( 24 ) = (0), ( 31 ) = (-1), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 36 ) = (0), ( 37 ) = (0), ( 38 ) = (0), ( 39 ) = (0), ( 32 ) = (7), ( 33 ) = (0), ( 34 ) = (0), ( 35 ) = (0)  ] ); _n := trunc(_ctl[1]); _yini := Array(0..8, {(1) = t0, (2) = z0, (3) = undefined, (4) = undefined, (5) = undefined, (6) = undefined, (7) = undefined, (8) = undefined}); _y0 := Array(0..8, {(1) = t0, (2) = z0, (3) = undefined, (4) = undefined, (5) = undefined, (6) = undefined, (7) = undefined, (8) = undefined}); _fcn := proc (N, X, Y, YP) option `[Y[1] = z(t)]`; if Y[3]*Y[2]*Y[1]/X < 0 then YP[1] := undefined; return 0 end if; YP[1] := (-.149071198499986*Y[2]*Y[1]*evalf((Y[3]*Y[2]*Y[1]/X)^(1/2))/X+1-Y[4]/(1-Y[1]))/(Y[2]*(Y[5]-Y[6]-.447213595499958*evalf((Y[3]*Y[2]*Y[1]/X)^(1/2)))); 0 end proc; _pars := [phi = phi, F = F, H = H, S_oi = S_oi, S_or = S_or, t0 = t0, z0 = z0]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then return _y0[0] elif _xout = "method" then return "lsode" elif _xout = "numfun" then return trunc(_ctl[24+trunc(_ctl[1])]) elif _xout = "initial" then return [seq(_yini[_i], _i = 0 .. _n)] elif _xout = "parameters" then return [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_yini[_i], _i = 0 .. _n)], [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _ctl[2]-_y0[0] = 0. then error "no information is available on last computed point" else _xout := _ctl[2] end if elif _xout = "enginedata" then return eval(_octl, 1) elif _xout = "function" then return eval(_fcn, 1) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _yini) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n, _ini, _yini, _pars) end if; if _pars <> [] then _par := {seq(rhs(_pars[_i]) = _yini[_n+_i], _i = 1 .. nops(_pars))}; for _i from 0 to _n do _y0[_i] := subs(_par, _yini[_i]) end do; for _i from _n+1 to _n+nops(_pars) do _y0[_i] := _yini[_i] end do else for _i from 0 to _n do _y0[_i] := _yini[_i] end do end if; _octl[2] := _y0[0]; _octl[3] := _y0[0]; for _i to _n do _octl[_i+7] := _y0[_i] end do; for _i to nops(_pars) do _octl[2*_n+30+_i] := _y0[_n+_i] end do; for _i to 39 do _ctl[_i] := _octl[_i] end do; if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [seq(_yini[_i], _i = 0 .. _n)] elif _xout = "parameters" then return [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] else return [seq(_yini[_i], _i = 0 .. _n)], [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] end if else return "procname" end if end if; if _xout-_y0[0] = 0. then return [seq(_y0[_i], _i = 0 .. _n)] end if; _reinit := false; if _xin <> "last" then if 0 < 0 and `dsolve/numeric/checkglobals`(0, table( [ ] ), _pars, _n, _yini) then _reinit := true; if _pars <> [] then _par := {seq(rhs(_pars[_i]) = _yini[_n+_i], _i = 1 .. nops(_pars))}; for _i from 0 to _n do _y0[_i] := subs(_par, _yini[_i]) end do; for _i from _n+1 to _n+nops(_pars) do _y0[_i] := _yini[_i] end do else for _i from 0 to _n do _y0[_i] := _yini[_i] end do end if; for _i to _n do _octl[_i+7] := _y0[_i] end do; for _i to nops(_pars) do _octl[2*_n+30+_i] := _y0[_n+_i] end do end if; if _pars <> [] and select(type, {seq(_yini[_n+_i], _i = 1 .. nops(_pars))}, 'undefined') <> {} then error "parameters must be initialized before solution can be computed" end if end if; if not _reinit and _xout-_ctl[2] = 0 then [_ctl[2], seq(_ctl[_i], _i = 8 .. 7+_n)] else if sign(_xout-_ctl[2]) <> sign(_ctl[2]-_y0[0]) or abs(_xout-_y0[0]) < abs(_xout-_ctl[2]) or _reinit then for _i to 39 do _ctl[_i] := _octl[_i] end do end if; _ctl[3] := _xout; if Digits <= evalhf(Digits) then try _errcd := evalhf(`dsolve/numeric/lsode`(_fcn, var(_ctl))) catch: userinfo(2, `dsolve/debug`, print(`Exception in lsode:`, [lastexception])); if searchtext('evalhf', lastexception[2]) <> 0 or searchtext('real', lastexception[2]) <> 0 or searchtext('hardware', lastexception[2]) <> 0 then _errcd := `dsolve/numeric/lsode`(_fcn, _ctl) else error  end if end try else _errcd := `dsolve/numeric/lsode`(_fcn, _ctl) end if; if _errcd < 0 then userinfo(2, {dsolve, `dsolve/lsode`}, `Last values returned:`); userinfo(2, {dsolve, `dsolve/lsode`}, ` t =`, _ctl[2]); _i := 8; userinfo(2, {dsolve, `dsolve/lsode`}, ` y =`, _ctl[_i]); for _i from _i+1 to 7+_n do userinfo(2, {dsolve, `dsolve/lsode`}, `	 `, _ctl[_i]) end do; if _errcd+1. = 0. then if _ctl[14+trunc(_ctl[1])] <> 0 then error "an excessive amount of work was done, maxstep may be too small" else error "an excessive amount of work (greater than mxstep) was done" end if elif _errcd+2. = 0. then error "too much accuracy was requested for the machine being used" elif _errcd+3. = 0. then error "illegal input was detected" elif _errcd+4. = 0. then error "repeated error test failures on the attempted step" elif _errcd+5. = 0. then error "repeated convergence test failures on the attempted step" elif _errcd+6. = 0. then error "pure relative error control requested for a variable that has vanished" elif _errcd+7. = 0. then error "cannot evaluate the solution past %1, maxfun limit exceeded (see <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> for details)", evalf[8](_ctl[2]) else error "unknown error code returned from lsode %1", trunc(_errcd) end if end if; if _Env_smart_dsolve_numeric = true then if _y0[0] < _xout and procname("right") < _xout then procname("right") := _xout elif _xout < _y0[0] and _xout < procname("left") then procname("left") := _xout end if end if; [_xout, seq(_ctl[_i], _i = 8 .. 7+_n)] end if end proc, (2) = Array(0..0, {}), (3) = [t, z(t)], (4) = [phi = phi, F = F, H = H, S_oi = S_oi, S_or = S_or, t0 = t0, z0 = z0]}); _vars := _dat[3]; _pars := map(rhs, _dat[4]); _n := nops(_vars)-1; _solnproc := _dat[1]; if not type(_xout, 'numeric') then if member(x_lsode, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(x_lsode, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(x_lsode, ["last", 'last', "initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x_lsode, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(x_lsode), 'string') = rhs(x_lsode); if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else error "initial and/or parameter values must be specified in a list" end if; if lhs(_xout) = "initial" then return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(x_lsode), 'string') = rhs(x_lsode)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _vars end if; if procname <> unknown then return ('procname')(x_lsode) else _ndsol; _ndsol := pointto(_dat[2][0]); return ('_ndsol')(x_lsode) end if end if; try _res := _solnproc(_xout); [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] catch: error  end try end proc

(2)

solSG(parameters = [.1, 1, .1, 1, .1, 0.1e-3, 0])

[phi = .1, F = 1., H = .1, S_oi = 1., S_or = .1, t0 = 0.1e-3, z0 = 0.]

(3)

``

Loading plots

odeplot(solSG, t = 0.1e-3 .. 10)

 

plots:-odeplot(solSG, t = 0.1e-3 .. 1)

 

plots:-odeplot(solSG, t = 0.1e-3 .. .1)

 

``


 

Download schechter_guo_v2.mw

My questions are:

1. Why does the solution for the longer time span (t<10) looks different from the shorter time span (t<0.1)? I have read about stiff ODEs and probably this has something to do with it. I am trying to figure out what is going on with the solutions.

2. I tried dsolve with stiff methods (lsode and rosenbrock) and both gave me the same solutions as above. I have not tried the advance options yet. How do I set dsolve so that the solution for the longer span (t>10) looks similar to shorter span?

Many thanks for your answers/suggestions.

 

I would like procedure P to perform inside the map statement exactly as it does outside the map statement. Can this be done?

Map_Procedure.mw

 

Can anyone tell me why maple wont accept my constraint?

Code:

LPSolve(3*x__1+14*x__2+18*x__3+6*x__4+2*x__5, {3*x__1+5*x__2+6*x__3+2*x__4+x__5 <= 10}, x__1 = 0 .. 1, x__2 = 0 .. 1, x__3 = 0 .. 1, x__4 = 0 .. 1, x__5 = 0 .. 1, maximize = true)

It returns the error "Warning, problem appears to be unbounded", when i can clearly see that it is bounded!

Im trying to solve the LP-relaxation of a binary problem which is why i have a 0..1 bound on every variable. Running Maple 2016.1 on windows if thats a help.

Request help in solving the equation:

Eq_H_1 := C[11*m]*(int((t-(j-1)*T)*alpha*(-alpha*(K*T*beta+T*beta*j-K*T-T*beta-T*j-beta*t+T+t))^(-beta/(beta-1))*exp(-R[m]*t), t = (j-1)*T .. (K+j-1)*T))

 

Thanks

Hey mapleprimes

I am trying to get the sum function to give me n variables, well not sure how to explain it, so let me show:

sum(x__i, i = 0 .. 2)

I was expecting to get x__0 + x__1 + x__2

But instead i got:   3*x__i

Thanks for the help in advance :)

Edit:

My problem is gone, but must be some weird character that is playing games with me or something


 

Hi everybody,

I have two questions about DataSummarize when used with "summarize=embed"

  1. Is it possible to set the width of the table DataSummarize returns ?
    (I thought DataSummarize used DocumentTools[Tabulate] but the option "width=..." doesn't work)
  2. Is it possible to save this table programmatically (for instance in a jpeg file) ?
     

Thanks in advance.

 

 

 

First 16 17 18 19 20 21 22 Last Page 18 of 60