Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Hello,

 

I want to simulating a mulitibody system, similar circular motion.

schematic diagram:

 

result:

 

Why the ball cannot keep on the circle?

 why_split.msim

Thanks

When I print a Table with graphs in it, the graphs are compressed vertically to an extreme extent. There has to be some compression from the screen, of course, since I have a wide-screen (although the actual worksheet does not use the whole screen width because of the palette and the fact that I don't use full-screen mode. However, the vertical compression  (that is, in a direction where there is plenty of room on the page) is many times more than the horizontal compression. In order to get the printed graph to look normal, I have to stretch the screen graph vertically an extreme amount, which, of course, looks horribly distorted on the screen.

Also when printing a graph as part of a Table, the graph area is clipped so that the title and legend do not print.

I thought that the Table struction would be a good way to display related graphs. But this behavior is making the use of Tables tedious and much less satisfactory because of the missing titles and legends.

None of these things happen when I print a graph in a regular execution group outside a Table structure.

Has anybody else had this problem, and have you found a way to avoid the compression and get the legends?

I have been trying to fit a function to experimental data. To do this i was using

.

The data is of the type

.

When I use initialvalues, I get a result, that fits the data well, but is clearly not the desired minimum. Maple delivers g always bigger than 10000 which is nowhere near -7, where it has to be for physical reasons. When using parameterranges I get the error

Warning, no iterations performed as initial point satisfies first-order conditions.

He stopps computing and simply prints out my initialvalues or the first value that is in the parameterrange with a huge RSS.

How can I use initialvalues and parameterranges together for my data?

Hey

As a lot of people before me I'm severely dissappointed my Maple's ability to export a .mw file to .tex.

The output looks horrible and even disappears off the side of the page in some places.

I've searched far and wide on the internet but it's difficult for me to understand the few, outdated, results I've dug up.

 

Is it completely impossible to get my hands on a good (or just working) Maple 18 to LaTex exporter? It's not possible for me to begin coding my own.

Hi all, I am new to MAPLE, I have been using Mathematica mostly. Here is what i am trying to do in MAPLE, 

Use the procedure plotmotion 2 on the plotmo worksheet to animate the motion of a marble in a bowl of the shape of the bottom half of the ellipsoid x^2/16 + y^2/12 +z^2/9 = 1

Can anyone help? It will be greatly appreciated.

Hi Maple People,

I got stuck trying to write a procedue for my project today.  My topic is Prime Constellations.

If you want to help me, please read my primer on constellations

https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwcmltZWNvbnN0ZWxsYXRpb25zfGd4OjNmOWZlNWQxZDY2ODY4YmQ

The procedure should refine an offset Vector and increase a multiplier scalar.

 

I want to delay putting the broken procedure until I can simplify it and try again.

Thanks,

Matt Anderson

hi friends

I encountered a problem and I can not draw the plot of this code

> sol := fsolve({diff(S, x) = 0, diff(S, y) = 0}, {x, y});



> with(VectorCalculus);
> with(linalg);
> s1 := evalf(subs(sol, linalg[grad](S, [x, y])));

> with(VectorCalculus);
> with(LinearAlgebra);
> s2 := evalf(subs(sol, linalg[hessian](S, [x, y]))); pmp0 := [x-subs(sol, x), y-subs(sol, y)]; sapprox := s0+evalm(`&*`(`&*`(transpose(pmp0), s2), pmp0));
> with(Statistics);
>
> with(stats); statevalf[icdf, chisquare[4]](.95);

> with(VectorCalculus);
> with(plottools);
> with(plots);
> with(linalg); ellips := {seq(stats*([statevalf[icdf, chisquare[4]]])(c) = sapprox, c = [.5, .95, .999])};
> plots(ellips(x, y), x = 950 .. 1000, y = 700 .. 750, grid = [50, 50], view = [950 .. 1000, 700 .. 750]);

 

 

can you helpe me?Thank you

Dear Friends,

I am solving 6 ODEs using maple15. then i got this error. anyone know abou this? thank you.

problem2.mw

 

 

restart:with (plots): B:=1:M:=1:Gr:=0.5:Pr:=3:w:=0.02:blt:=5:Bi:=10:

Eq1:=diff(f(eta),eta,eta,eta)-(diff(f(eta),eta))^(2)+f(eta)*diff(f(eta),eta,eta)+B*H(eta)*(F(eta)-diff(f(eta),eta))-M*diff(f(eta),eta)+Gr*theta(eta)=0;

diff(diff(diff(f(eta), eta), eta), eta)-(diff(f(eta), eta))^2+f(eta)*(diff(diff(f(eta), eta), eta))+H(eta)*(F(eta)-(diff(f(eta), eta)))-(diff(f(eta), eta))+.5*theta(eta) = 0

(1)

Eq2:=(1+Nr)*diff(theta(eta),eta,eta)+Pr*f(eta)*diff(theta(eta),eta)+(2/3)*H(eta)*B*(theta1(eta)-theta(eta))=0;

(1+Nr)*(diff(diff(theta(eta), eta), eta))+3*f(eta)*(diff(theta(eta), eta))+(2/3)*H(eta)*(theta1(eta)-theta(eta)) = 0

(2)

Eq3:=H(eta)*F(eta)+H(eta)*diff(G(eta),eta)+G(eta)*diff(H(eta),eta)=0;

H(eta)*F(eta)+H(eta)*(diff(G(eta), eta))+G(eta)*(diff(H(eta), eta)) = 0

(3)

Eq4:=F(eta)^2+G(eta)*diff(F(eta),eta)+B*(F(eta)-diff(f(eta),eta))=0;

F(eta)^2+G(eta)*(diff(F(eta), eta))+F(eta)-(diff(f(eta), eta)) = 0

(4)

Eq5:=G(eta)*diff(G(eta),eta)+B*(f(eta)+G(eta))=0;

G(eta)*(diff(G(eta), eta))+f(eta)+G(eta) = 0

(5)

Eq6:=G(eta)*diff(theta1(eta),eta)+l*B*(theta1(eta)-theta(eta))=0;

G(eta)*(diff(theta1(eta), eta))+l*(theta1(eta)-theta(eta)) = 0

(6)

bcs:=f(0)=0,(D(f))(0)=1,(D(theta))(0)=-Bi*(1-theta(0)),(D(f))(blt)=0,F(blt)=0,G(blt)=-f(blt),H(eta)=w,theta(blt)=0,theta1(blt)=0;

f(0) = 0, (D(f))(0) = 1, (D(theta))(0) = -10+10*theta(0), (D(f))(5) = 0, F(5) = 0, G(5) = -f(5), H(eta) = 0.2e-1, theta(5) = 0, theta1(5) = 0

(7)

L:=[0.5,1,1.5,2];

[.5, 1, 1.5, 2]

(8)

for k from 1 to 4 do p:=dsolve(eval({Eq1,Eq2,Eq3,Eq4,Eq5,Eq6,bcs},Nr=L[k]),[f(eta),F(eta),G(eta),H(eta),theta(eta),theta1(eta)],numeric,output=listprocedure);end do:

Error, (in dsolve/numeric/bvp) unevaluated names in system not allowed: {Y[9], Y[10]}

 

``

``

``

 

Download problem2.mw

I have generated a picture using pointplot and display that creates a grid of colors based on the angle between vectors and (1,0) in R^2. Each angle is given a unique color via the HSV color space. I would like to provide a legend explaining the colour, something along the lines of

red (brown) green (blue) red
0                Pi                 2*Pi

and possibly

red       (brown)       green 
angle1                     angle2   

Is there an easy way to do this, or will I have to mess around with a custom pointplot/textplot solution?

Is it possible to use an option similar to range when using lsode method for dsolve? The ODEs I am trying to solve is stiff and will not work with the flag stiff=true or with method=rosenbrock unless i set Digits:=20. I want to avoid doing that as much as possible, since I believe wit will be very taxing, computationally. I have a very large systeom to solve. I found that method=lsode works with the default Digits=15. 

 

However I need to have the solutions in a given range stored for future access and manipulations. Using range gives me an error: 

Error, (in dsolve/numeric/an_args/lsode) lsode keyword was range, optional keyword must be one of 'ctrl', 'initial', 'itask', 'output', 'procedure', 'procvars', 'start', 'number', 'abserr', 'relerr', 'maxfun', 'minstep', 'maxstep', 'initstep', 'startinit', 'implicit', 'optimize', 'complex'

 

I cannot figure out how to use range or something similar with lsode. Anyone knows? 

Hi! I have to solve a very large system of ODEs for a set of functions that can be indexed with two integers, n and l, call them f[n,l](x), where n ranges from 1 to an order 1000 number and l ranges from 1 to an order 10 number. 

What is the best strategy in dsolve, keeping in mind I will only need to have quick access to the values of the first few such functions, say f[0,0](x) and f[0,1](x) for any given x in a given range. I dont need to store the rest, and trying to store all of them actually will give me a warning about length of output exceeds limit of 1000000. So, having maple output the result of dsolve in a procedural form seems to be what I want. However in doing so, for evey value of x i call the solving procedure maple will solve the system each time, thus taking a long time. 

 

My dilema is: to save storage space and memory I want to use dsolve output as procedures. To save time, when accessing the functions I need (only the first few in the large set of unknown functions that obey the ODE) for a given value of x, I would like maple to have those already stored instead of computing them with each invocation. So, what I need is a somehow split behavior of output. For some of my unknown functions to act as if i use range in dsolve, so that I have access at the values without further computation, and for the rest of the solutions (most of the unknown functions) just keep them in procedural form. How do I achieve this? 

 

Below is a schematic of my probem:

 

ODEs:={Set of about 10000 coupled ODEs for functions labeled f[n,l] n ranging from 1..1000 and l from 1..10}

 

dsolve(ODEs,numeric, output=???)#What options to put in dsolve such that I have quick access to f[0,0](x) and f[0,1](x) in a given range (say xmin=0.1 and xmax=10 for example) but not store the rest. 

 

 

Hi, 

     I have a question regarding pdsolve, or Solve from the PDEtools package. I have a set of equations relating partial derivatives, and I'd like to isolate certain terms without explicitly known the functions. I can do this for a single equation, but not multiple ones. I'm curious if Maple can currently handle a system of eqns like these easily, since I will be increasing the number of eqns in the future. Here's the code 

 

 

restart;

PDEtools:-declare(H=H(x,y,t)):

H(x, y, t)*`will now be displayed as`*H

(1)

eq1:= H[tt](x,y,t) = H[xx](x,y,t) + H[yy](x,y,t);

H[tt](x, y, t) = H[xx](x, y, t)+H[yy](x, y, t)

(2)

eq2 := diff(H[tt](x,y,t), t) = diff(H[tx](x,y,t), x) + diff(H[ty](x,y,t), y);

diff(H[tt](x, y, t), t) = diff(H[tx](x, y, t), x)+diff(H[ty](x, y, t), y)

(3)

eq3 := diff(H[tx](x,y,t), t) = diff(H[xx](x,y,t), x) + diff(H[xy](x,y,t), y);

diff(H[tx](x, y, t), t) = diff(H[xx](x, y, t), x)+diff(H[xy](x, y, t), y)

(4)

eq4 :=diff(H[ty](x,y,t), t) = diff(H[xy](x,y,t), x) + diff(H[yy](x,y,t), y);

diff(H[ty](x, y, t), t) = diff(H[xy](x, y, t), x)+diff(H[yy](x, y, t), y)

(5)

PDEtools:-Solve(eq3, H[xy]);

H[xy](x, y, t) = Int(diff(H[tx](x, y, t), t)-(diff(H[xx](x, y, t), x)), y)+_F1(x, t)

(6)

PDEtools:-Solve({eq1, eq2, eq3, eq4}, H[xy]);

Error, (in pdsolve/sys) the input system cannot contain equations in the arbitrary parameters alone; found equation depending only on {H[tt](x,y,t), H[xx](x,y,t), H[yy](x,y,t)}: H[tt](x,y,t)-H[xx](x,y,t)-H[yy](x,y,t)

 

 

 

 

Download PDESolveHelp.mw

Hi! I am trying to plot and store in memory some specific combinations of the solutions of the systems of ODEs that I get numerically from dsolve for a particular range of the independent variable. 

A particular case for my problem is the following system of stiff ODEs for two unknown functions f[0,0](x) and f[1,0](x) beween xini (where the Initial conditions are defined) and xfin, an arbitrary value of x. Note that rosebrock method does not work, and I can only solve it with lsode[adamsfull] or lsode[backfull]. I am attaching a maple file that shows what I have done.


``

############## System of ODEs that needs to be solved ####################################

xini := .1

.1

(1)

xfin := 2

2

(2)

SystemToSolve := diff(f[0, 0](x), x)+(2./x^5+.5000000000/x)*f[0, 0](x) = -15.58845727*sin(.5773502693*x)/x^2+(46.76537182*(3.*sin(.5773502693*x)-1.732050808*x*cos(.5773502693*x)))/x^4, diff(f[1, 0](x), x)+(6./x^5+1.500000000/x)*f[1, 0](x)-1.*f[0, 0](x)/x = (-15.58845727*sin(.5773502693*x)/x^2+(46.76537182*(3.*sin(.5773502693*x)-1.732050808*x*cos(.5773502693*x)))/x^4)*(1.-1.*(1/x^4)^(1/4)*exp(1/x^4)*GAMMA(.7500000000, 1/x^4))-(1.*(-10.39230485*sin(.5773502693*x)/x^2+(31.17691454*(3.*sin(.5773502693*x)-1.732050808*x*cos(.5773502693*x)))/x^4+(4.*((.8660254040*(3.*sin(.5773502693*x)-1.732050808*x*cos(.5773502693*x)))/x+(.8660254040*((3.*(1.-6./x^2))*sin(.5773502693*x)+10.39230485*cos(.5773502693*x)/x))/x))/((1/x^4)^(1/4)*exp(1/x^4)*GAMMA(.7500000000, 1/x^4)*x^5)))*(1/x^4)^(1/4)*exp(1/x^4)*GAMMA(.7500000000, 1/x^4), f[0, 0](xini) = 1.503498546, f[1, 0](xini) = -.5011661819:

 

###################################################################################

 

``

ListProcs := dsolve({SystemToSolve}, numeric, method = lsode[backfull], output = listprocedure):

f00 := eval(f[0, 0](x), ListProcs);

proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 34, [( 1 ) = (2), ( 2 ) = (.1), ( 3 ) = (.1), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (22), ( 7 ) = (0), ( 9 ) = (-.5011661819), ( 8 ) = (1.503498546), ( 11 ) = (0.1e-6), ( 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 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _octl := array( 1 .. 34, [( 1 ) = (2), ( 2 ) = (.1), ( 3 ) = (.1), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (22), ( 7 ) = (0), ( 9 ) = (-.5011661819), ( 8 ) = (1.503498546), ( 11 ) = (0.1e-6), ( 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 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _n := trunc(_ctl[1]); _yini := Array(0..2, {(1) = .1, (2) = 1.503498546}); _y0 := Array(0..2, {(1) = .1, (2) = 1.503498546}); _fcn := proc (N, X, Y, YP) option `[Y[1] = f[0,0](x), Y[2] = f[1,0](x)]`; YP[1] := -15.58845727*sin(.5773502693*X)/X^2+46.76537182*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4-(2./X^5+.5000000000/X)*Y[1]; if 1/X^4 < 0 then YP[1] := undefined; return 0 end if; if 1/X^4 < 0 then YP[1] := undefined; return 0 end if; YP[2] := (-15.58845727*sin(.5773502693*X)/X^2+46.76537182*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4)*(1.-1.*evalf((1/X^4)^(1/4))*exp(1/X^4)*GAMMA(.7500000000, 1/X^4))-1.*(-10.39230485*sin(.5773502693*X)/X^2+31.17691454*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4+4.*(.8660254040*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X+.8660254040*(3.*(1.-6./X^2)*sin(.5773502693*X)+10.39230485*cos(.5773502693*X)/X)/X)*evalf(1/(1/X^4)^(1/4))/(exp(1/X^4)*GAMMA(.7500000000, 1/X^4)*X^5))*evalf((1/X^4)^(1/4))*exp(1/X^4)*GAMMA(.7500000000, 1/X^4)-(6./X^5+1.500000000/X)*Y[2]+1.*Y[1]/X; 0 end proc; _pars := []; 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 34 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 34 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(1..3, {(1) = 18446744078356217278, (2) = 18446744078356217454, (3) = 18446744078356217630}), (3) = [x, f[0, 0](x), f[1, 0](x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 2, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 2, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[2] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := `tools/gensym`("f[0,0](x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][2])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc

(3)

f10 := eval(f[1, 0](x), ListProcs);

proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 34, [( 1 ) = (2), ( 2 ) = (.1), ( 3 ) = (.1), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (22), ( 7 ) = (0), ( 9 ) = (-.5011661819), ( 8 ) = (1.503498546), ( 11 ) = (0.1e-6), ( 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 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _octl := array( 1 .. 34, [( 1 ) = (2), ( 2 ) = (.1), ( 3 ) = (.1), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (22), ( 7 ) = (0), ( 9 ) = (-.5011661819), ( 8 ) = (1.503498546), ( 11 ) = (0.1e-6), ( 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 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _n := trunc(_ctl[1]); _yini := Array(0..2, {(1) = .1, (2) = 1.503498546}); _y0 := Array(0..2, {(1) = .1, (2) = 1.503498546}); _fcn := proc (N, X, Y, YP) option `[Y[1] = f[0,0](x), Y[2] = f[1,0](x)]`; YP[1] := -15.58845727*sin(.5773502693*X)/X^2+46.76537182*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4-(2./X^5+.5000000000/X)*Y[1]; if 1/X^4 < 0 then YP[1] := undefined; return 0 end if; if 1/X^4 < 0 then YP[1] := undefined; return 0 end if; YP[2] := (-15.58845727*sin(.5773502693*X)/X^2+46.76537182*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4)*(1.-1.*evalf((1/X^4)^(1/4))*exp(1/X^4)*GAMMA(.7500000000, 1/X^4))-1.*(-10.39230485*sin(.5773502693*X)/X^2+31.17691454*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X^4+4.*(.8660254040*(3.*sin(.5773502693*X)-1.732050808*X*cos(.5773502693*X))/X+.8660254040*(3.*(1.-6./X^2)*sin(.5773502693*X)+10.39230485*cos(.5773502693*X)/X)/X)*evalf(1/(1/X^4)^(1/4))/(exp(1/X^4)*GAMMA(.7500000000, 1/X^4)*X^5))*evalf((1/X^4)^(1/4))*exp(1/X^4)*GAMMA(.7500000000, 1/X^4)-(6./X^5+1.500000000/X)*Y[2]+1.*Y[1]/X; 0 end proc; _pars := []; 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 34 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 34 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(1..3, {(1) = 18446744078356217278, (2) = 18446744078356217454, (3) = 18446744078356217630}), (3) = [x, f[0, 0](x), f[1, 0](x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := `tools/gensym`("f[1,0](x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc

(4)

ftoplot := unapply(f00(x)+0.45e-1*f10(x)/x^(3/2), x)

proc (x) options operator, arrow; f00(x)+0.45e-1*f10(x)/x^(3/2) end proc

(5)

``

plot(ftoplot(x), x = xini .. xfin)

 

``


Download Test2ODEs.mw

The approach in that file works, however I have a question regarding the efficiency of my method, since I plan to extend the system to many more ODEs besides just 2 and also extend the range to a larger xfin. In this method, since I define the function to plot in terms of f01 and f02, wich are procedures, does this mean that for each x on the grid for the plot(ftoplot,x=xini..xfin) maple actually computes the solutions f00(x) and f01(x) and then forms the ftoplot combination and plots that specific point? If the default sampling of my interval is, say 1000 points, does it mean that the way I wrote it I will have 1000 invocations of the dsolve procedure, for each x in the sample? I am not sure, it seems to me that is the case. This would imply that instead of advancing the solution at each step maple starts over again from xini. How could I just avoid this behavior and instead have access to the values of ftoplot(x) in the range xini to xfin stored from one invocation of dsolve? 

 

The ideal scenario for me would be to have f[0,0](x) and f[0,1](x) stored as an interpolated function between xini and xfin from the solutions of one invocation of dsolve prior to defining ftoplot. Can this be achieved in principle? How? Remember, i have to use method=lsode and range is not accepted.  

 

hi friends

After this cods i see very error

 > restart;

read(orbit.sav ): whit(plots):
ax := -G*Mz*x/(x^2+y^2)^(3/2);
ay := -G*Mz*y/(x^2+y^2)^(3/2);
i := 'i'; j := i+1;
for k from 0 to 3 do
x := 7*10^6; Vx := 0;
y := 0; Vy := 9000;
dt := evalf(1/2^k);
for i from 0 to 328 do
X[i] := evalf(x); Y[i] := evalf(y);
for n to 40*2^k do
x := evalf((1/2)*ax*dt^2+Vx*dt+x); y := evalf((1/2)*ay*dt^2+Vy*dt+y);
Vx := evalf(ax*dt+Vx); Vy := evalf(ay*dt+Vy)
od;
if i mod 41= 0 then
dX[k, i] := X[i]-XS[j]; dY[k, i] := Y[i]-YS[j]
fi
od;
p[k] := plot([seq([(X[i]-XS[j])*(1/1000), (Y[i]-YS[j])*(1/1000)], i = 0 .. 328)], color = green) end do;
p1 := display({seq(p[k], k = 0 .. 3)}, thickness = 3)
SI := [seq(41*i, i = 0 .. 8)]
p2 := plot({seq([seq([(1/1000)*dX[k, i], (1/1000)*dY[k, i]], k = 0 .. 1), [0, 0]], i = SI)}, color = black)
display({p1, p2}, scaling = constrained, labels = ['dx', 'dy'])
display({p1, p2}, view = [-.1 .. .5, -.4 .. .2], scaling = constrained, labels = ['dx', 'dy'])

can you help me Please?

Thank you

 

 

 

Does anyone know how to using some softward convert ?  for example  I have maple code , but I want to using mathematica code .I need fast way.

First 203 204 205 206 207 208 209 Last Page 205 of 334