MaplePrimes Questions

Look at the following code:

M1 := (t,lambda1,k,lambda2) -> exp( -(1/2)*(log(1-2*lambda1*t) + k*log(1-2*lambda2*t)) )

int( diff(M1(z,2,9,1/2),z)/sqrt(abs(z)),z=-infinity..0 )/GAMMA(1/2) 

simplify(%)

evalf(%)

returns:    -4.682354481-5.587737200*I

 

which cannot be true. 

I tried a number of "simplify" options, none of which yielded the desired simple result.

In Maple12 and 2017 we can load a .wav file and Preview no problems. 

The problem occurs when we apply a moving average from the Statistics package and then attempt to Preview the result. Warning - if you don't limit the size of the number of elements when executing the Preview you will freeze and lock up your computer as it attempts to output to the display the errors on each element.

For example.

Using the windows Ding.wav

with(AudioTools):
a:=Read("c:/test/Ding.wav"): #just a random test location I have the Ding.wav file in.
b:=ToMono(a): #changing to Mono.
c:=b^2: #squaring the signal.

with(Statistics):

d:=MovingAverage(c,30):

Preview(d[1..5]) #selecting a small number of values so I don't lock up my system.

Now Preview(d) works in M12 (ie there were no errors and a plot was presented). 

Why doesn't this work in 2017? 

Hello,

I need to construct a sequence of matrices of different sizes, but with similar structure, and to study their determinants etc.

I wrote the following code:

restart: with(LinearAlgebra):
for n from 5 to 8 do:
for i from 1 to n do for j from 1 to n do A[i,j]:=0 od: od:
for i from 1 to n-1 do A[i,i+1]:=3 od:
for i from 1 to n do A[i,i]:=4 od:
for i from 2 to n do A[i,i-1]:=5 od:
A:=([seq([seq(A[i,j],j=1..n)],i=1..n)]);
Determinant(evalm(1-t*A));
od:

 

However, I get the following error message: "Error, out of bound assignment to a list".

If I add evalm to A:=..., it changes to "Error, 2nd index, 6, larger than upper array bound 5".

I don't see why. I think that by the moment that i and/or j can assume 6, n is already 6.

So what is wrong, and how can this be fixed? Thanks in advance.

I wish to solve three linear simultaneous equations and obtain the solutions in floating point form.

the following works...

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

...but the solutions are given in either symbolic, or equation form.  I would like numbers - floating point form.

Below is my attempt to solve this.  with(plots) & with(plottools) is not necessary for this - but I was doing some related graphic work.  I did try with(RealDomain), but it seemedto make little difference.  I have done a copy & paste of an rtf file, but the Maple output has not come out so well.  Any help would be appreciated. 

> restart:

with(plots):

with(plottools):

with(RealDomain);

#Masses in kg (or pounds!)

m1:=70.0:m2:=25.0:m3:=3.0:

#Equations

solvec:=fsolve({T+N1-m1=0, N2-N1-m2=0,T-N2-m3=0}, {T,N1,N2});

#Above gives the solutions in symbolic or equation form, as well as putting the solutions in a set.  How can the programme distinguish between the various values?

 

# From here is my attempt to form floating point values – to no avail.

NTab:=convert([solvec],table);

N1A:=evalf(solvefor[N1](T+N1-m1*g=0, N2-N1-m2*g=0,T-N2-m3*g=0));

N1B:=convert(N1A, float);

 

#Problem to isolate the solutions in the vector in floating form,

#and also get the correct ones.  NB the solution is a set - not an ordered list.

maxvec:=max(solvec[1],solvec[2],solvec[3]);

#maxvec:=convert(max(solvec[1],solvec[2],solvec[3]), float);

maxvec:=convert(solvec[2], float);

solvec[2];

whattype(solvec[2]);

type(N2,symbol);

type(solvec[2],equation);

N2_fl:=evalf(solvec[2]);

N2_fl:=convert(solvec[2], float);

 

N3:=N2_fl+3;

#Actual true answers

#T:=(m1+m2+m3)/2;

#N1:=(m1-m2-m3)/2;

#N2:=T-m2;

 

OUTPUT:

 

 

Error, (in simpl/max) arguments must be of type algebraic

 

Error, (in simpl/relopsum) invalid terms in sum

Is there a way for Maple to tell where the error occurs? For example I am not able to find the error that says 'Error, missing operator or `;'' in the following code.

 

# ctrl + del to delete a Maple cell
# golden search implementation
# chapra 7th ed
golden_search := proc(f, xl, xu, es100, maxiter)
description "find the optimal point using golden-search optimization method";
locals R, d, xopt, x1, x2, f1, f2, iter, ea, xint;
R := (sqrt(5)-1)/2;
d := R*(xu-xl);
x1 := xl + d;
x2 := xu - d;
f1 := evalf(eval(f, x = x1));
f2 := evalf(eval(f, x = x2));
# declare iterator and ea
iter := 1;
ea := 1.00;
# start while
while ea*100 > es100 and iter < maxiter do
    d := R*d; # new golden ratio
    xint := xu - xl;
    if f1 > f2 then
        xopt := x1;
        fx := f1;
        x1 := x2;
        x2 := x1;
        x1 := x1 + d;
        f2 := f1;
        f1 := evalf(eval(f, x = x1));
    else
        xopt := x2;
        fx := f2;
        xu := x1;
        x1 := x2;
        x2 := xu - d;
        f1 := f2;
        f2 := evalf(eval(f, x = x2));
    end if
    # calculate new ea
    if xopt <> 0 then
        ea := (1 - R)* abs(xint/xopt);
    end if
    iter = iter + 1;
end do;
# return xopt and fx here
xopt;
end proc:
 

While using a version of Maple on the inverse symbolic calculator I first described my idea for a new constant in 1999 and other people named it after me, calling it the MRB constant. While looking for an applied math purpose for the MRB constant =sum((-1)^k (k^(1/k)-1),k=1..infinity), I noticed that the absolute value of its summand is the interest rate to multiply an investment k times in k years=k^(1/k)-1. Any ideas on how this might be related to other subjects?


 

NULL

restart

with(plots)

Pr := 0.1e-1

0.1e-1

(1)

Eq1 := (101-100*d)*(diff(h(eta), eta))+2*f(eta) = 0; Eq2 := (101-100*d)*(diff(f(eta), `$`(eta, 2)))-h(eta)*(diff(f(eta), eta))-f(eta)^2+g(eta)^2-beta*(f(eta)+(1/2)*eta*(diff(f(eta), eta))) = 0; Eq3 := diff(g(eta), `$`(eta, 2))-h(eta)*(diff(g(eta), eta))-2*f(eta)*g(eta)-beta*(g(eta)+(1/2)*eta*(diff(g(eta), eta))) = 0; Eq4 := diff(p(eta), eta)-2*(diff(f(eta), eta))+beta*(h(eta)+eta*(diff(h(eta), eta))) = 0; Eq5 := diff(theta(eta), `$`(eta, 2))-Pr*h(eta)*(diff(theta(eta), eta))-Pr*beta*(3*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(101-100*d)*(diff(h(eta), eta))+2*f(eta) = 0

 

(101-100*d)*(diff(diff(f(eta), eta), eta))-h(eta)*(diff(f(eta), eta))-f(eta)^2+g(eta)^2-beta*(f(eta)+(1/2)*eta*(diff(f(eta), eta))) = 0

 

diff(diff(g(eta), eta), eta)-h(eta)*(diff(g(eta), eta))-2*f(eta)*g(eta)-beta*(g(eta)+(1/2)*eta*(diff(g(eta), eta))) = 0

 

diff(p(eta), eta)-2*(diff(f(eta), eta))+beta*(h(eta)+eta*(diff(h(eta), eta))) = 0

 

diff(diff(theta(eta), eta), eta)-0.1e-1*h(eta)*(diff(theta(eta), eta))-0.1e-1*beta*(3*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(2)

NULL

NULL

`V&lambda;` := [.5, 1, 1.5]; `V&beta;` := [0.5e-1, .1, .2, .4, .7, 1, 1.50, 2]

etainf := 1

bcs := h(0) = 0, p(0) = 0, theta(0) = 1, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -lambda*f(0)^(1/3)*(1-g(0)).(1/(f(0)^2+(1-g(0))^2)^(1/3)), f(etainf) = 0, g(etainf) = 0, theta(etainf) = 0

h(0) = 0, p(0) = 0, theta(0) = 1, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -f(0)^(1/3)*(1-g(0))*lambda/(f(0)^2+(1-g(0))^2)^(1/3), f(1) = 0, g(1) = 0, theta(1) = 0

(3)

NULL

dsys := {Eq1, Eq2, Eq3, Eq4, Eq5, bcs}

for j to 3 do for i to 8 do lambda := `V&lambda;`[j]; beta := `V&beta;`[i]; dsol[j][i] := dsolve(dsys, numeric, continuation = d); print(beta); print(lambda); print(dsol[j][i](0)) end do end do

Error, (in dsolve/numeric/bvp) singularity encountered

 

NULL

NULL

NULL


 

Download compre1try3.mw


I am facing the same problem with Maple 17. Which is also discussed here

https://www.mapleprimes.com/questions/222168-Maple-Not-Evaluating-Symbolic-Variables?reply=reply

But the link provided below is dead
https://www.maplesoft.com/support/faqs/detail.aspx?sid=34802

Can you recall how to solve it?  I have tried your solution below, but it did not solve it.  

"@peacess If the file isn't there you can just create a new file with a text editor (e.g. Notepad) and add the required option.
Or you can use the maplejava.l4j.ini file inside the .zip file I've attached:  maplejava.l4j.zip"

Thank you.  

This is a very general, basic question.  

When I supply an input is the calculuation/computation performed on my computer?  Is it uploaded to a Maple server for calculating? 

 

I am assuming it takes place on my computer but just wanted to double check.  

 

Also, is there a way to see the progress of a calculation?  If it is something that might take days or even weeks..

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 am trying to use standard notation for machine constants such as Xd' and Xd'', the d being a subscript. The prims are interperted as differential operators. How can I disable the d/dx.   

I've followed all the recommendations, but I can't see the mistake yet...:

z := proc(n::integer)

local A,E,S,k,s1,s2;

if n = 0 then

matrix(2,1,[0,0]);

else if n = 1 then

matrix(2,1,[-2,epsilon^()+sqrt(epsilon^(2)+4)]);

else

A(n) := matrix([[1+epsilon^(2)-lambda^(n),epsilon^()],[epsilon^(), 1-lambda^(n)]]);

E := matrix(2,1,[epsilon^(2),epsilon^()]);

S := 0;

for k  from 1 by 1 to n-1 do

s1 := thisproc(n-k);

s1 := s1[1];

s2 := thisproc(k);

s2 := s2[1];

S := S+s1*s2;

end do;

A(n)^(-1)*E*S ;

end if;

end proc

 

I need this to do a Dynamical systems problem called Hénon map, which has by function formula:

f(x,y) = (x+epsilon*(y+epsilon*x*(1-x)), y+epsilon*x*(1-x))

so the problem consists in finding the expression of function P such that f(P(t)) = P(lambda*t), where lambda = 1+(epsilon/2)*(epsilon-sqrt(epsilon^2+4)) is one of the eigenvalues of the differential matrix of f valued on (0,0). In Maple, I've put z = (x,y) to let the problem be a vector problem. And as I made the calculations with the help of a LaTex-presentation PDF, I took the formula A(n)*z(n) = (epsilon^2;epsilon)*S, where s is the following recursive sum in the code. If I don't get the result, I won't be able to explain why Matlab plotting goes too far, even when n = 2!!! Bref, trying to put things much easier in a difficult problem, but Maple returns me the error like I did some mistake, and I tried to debug these code lines!!! Along the code, please note that lambda and epsilon are mere parametres, not local variables. If the error comes from there, please put epsilon = 0.2 and lambda as the formula just below the code.

Dear!

Hope everyone is fine. I want to write the values of "phi" with their line colors in legend or in title. I know how to make legends but the problem is here there are nine graphs and we need only three legends. Please fix my problem. I am waiting the positive response. Thanks in advance

Legend.mw

 

I want to solve this integer-linear programming problem. There are four variables (xp,xq,xifp,xifq)
Two variables are nonnegative and integer (xp,xq)

the other two variables are binary(xifp,xifq)
 

When executing this command, maple says that the problem appears to be unbounded

LPSolve(750*xp+250*xq-50000*xifq,maximize=true,
{20*xp+30*xq<=2600,
30*xp+20*xq<=1000,
20*xp+30*xq<=2000,
xq<=99999*xifq,
xq>=20*xifq,
xp<=99999*xifp,
xp>=30*xifp,
xp>=0,
xq>=0},
integervariables={xp,xq},
binaryvariables={xifp,xifq}
);

and gives this solution[0, [xifp = 0, xifq = 0, xp = 0, xq = 0]]

however if i set a range for the variables xp,xq from 0 to 99999 for example


LPSolve(750*xp+250*xq-50000*xifq,maximize=true,
{20*xp+30*xq<=2600,
30*xp+20*xq<=1000,
20*xp+30*xq<=2000,
xq<=99999*xifq,
xq>=20*xifq,
xp<=99999*xifp,
xp>=30*xifp,
xp>=0,
xq>=0},
integervariables={xp,xq},
binaryvariables={xifp,xifq},
xp=0..99999,
xq=0..99999
);
maple returns this solution 

[49950000, [xifp = 1, xifq = 1, xp = 50000, xq = 50000]]

but if xp=50000 and xq=50000 this doesnt satisfy the first constrain
because 20*xp+30*xq</=2600
why does maple gives this mistaken solution, how can i solve it ?
please help,thanks for reading

 

First 834 835 836 837 838 839 840 Last Page 836 of 2374