Maple 2016 Questions and Posts

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

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.

 

 

 

Hello everybody, 

 

I used Maple to reach a function in terms of a few parameters. The issue that I'm facing is that when I copy and paste that equation to excel(after transforming that same equation to 1D math) for evaluating it's value with the real values for the parameters, the result is not the same as the one calculated by Maple 2016 with the exact same parameters. I've inserted the file with this question for further information. One of the parameters (F15) is the cell used in excel.

equation.mw

Download equation.mw

 

 

Any help regarding this problem is very much appreciated.

Wus poppin Jimbos

My function is as follows:

f(x)=(10000/1+30762*0.478^x)+5

I can then type 

maximize(f'(x))

And I get the result which is approximately 1845.361367

I then assign at a name e.g. "M"

I then try and execute the command (where I isolate the expression for x)

f'(x)=M

I get the result

 
              x = 14.00001597 - 0.00005369289477 I

Which is super annoying to look at..

Is there any way that I can remove the - 0.00005369289477 I part? And just get the answer (which should be 14)

I have no problem executing 

diff(f(x), x) = 1845.361366;
 = 
                             "(->)"

                        x = 13.99997555

However 1845.361367 once again gives me x = 14.00001597 - 0.00005369289477 I

Any help is appreciated <3

Hi,

 

I use Statistics[Biplot] and the rendering is very bad with those huge arrows.

For the moment I fix this by modifying the definitions of the curves which draw each arrow (after using getdata to recover the Biplot structure)

Does it exist a simpler way to manage the appearance of the arrows ?
(options cb, cw and ch of plottols[arrow] are incorrect in Statistics[Biplot](..., arrow=[...]).

Thanks in advance

I am trying to repeat the 'first example' in Stephani & MacCullum, Differential equations see chapter 16 and (16.5).  The differential equation is,

pde := b1(x, y)*(diff(u(x, y), x))+b2(x, y)*(diff(u(x, y), y)) = 0

and I would like to compute DeterminingPDE.  The textbook answer is linear in b1 and b2 (as my 'by hand calculation' is) but Maple's,

DeterminingPDE(pde)

contains quadratic terms such as b1^2, b1*b2 etc.  I don't understand the appearance of the quadratic terms.  Is it possible for Maple to return an answer which is linear in b1 and b2?

Good day everyone,

I am having challenges copying equations from Maple 2016 to word. Anyone with useful information should share please.

Thank you in anticipation for your kind gesture

Good day,

I have a problem with inequalities plotting (trsh_con.mw). I need to plot them(eq5,eq7) in the same box. But I get the wrong solution. The plot not giving me correct region for 2 inequalities. I attach the mw file. Are there any options to overcome such problems?

Thanks in advance.

 

I am trying to find the orthocenter in the x,y plane, given three coordinates  (x1,y1) (x2,y2) (x3,y3).

I am trying to avoid division by zero.

orthocenter.mw
 

restart:
orthocenter:=proc(x1,y1,x2,y2,x3,y3)
local m1,m2,m3,L1,L2,L3,slope;
slope:=(a,b,c,d)->(d-b)/(c-a);

if x1=x2 then L1:=x=x1;
elif y1=y2 then L1:=y=y1;
else m1:=-1/slope(x2,y2,x3,y3); L1:=y-y1=m1*(x-x1);
end if;

if x2=x3 then L2:=x=x2;
elif y2=y3 then L2:=y=y2;
else m2:=-1/slope(x1,y1,x3,y3);L2:=y-y2=m2*(x-x2);
end if;

if x1=x3 then L3:=x=x1;
elif y1=y3 then L3:=y=y1;
else m3:=-1/slope(x1,y1,x2,y2);L3:= y-y3= m3*(x-x3);
end if;
print(solve({L1,L2,L3},{x,y}));
end proc:

orthocenter(1,1,3,4,5,3);

{x = 11/4, y = 9/2}

(1)

orthocenter(0,0,0,3,4,1)

Error, (in slope) numeric exception: division by zero

 

 


 

Download orthocenter.mw

 

1 2 3 4 5 6 7 Last Page 2 of 44