Maple 17 Questions and Posts

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

(a) Design your own 3-stage explicit Runge-Kutta method with one-step error O(h4).

(b) Test your method by solving y= −y. Confirm that the global error in your numerical solution

is O(h3).



BCs := {D[1](f)(0,t)=cos(t), f(0,t)=0,D[1](f)(L,t)=0};

ICs := {f(x,0)=0};

smod3:= pdsolve(Eq1,ICs union BCs,numeric,range=0..L);

smod3:-plot(t=0,  color=red):

it seems to me that the problem is due to the mixed bcs. Any way around?


Good afternoon sir.


I am working on problems related to functions which require dynamic geometry program or

the Geometers sketch pad. I request to you to kindly suggest me with regard to the above cited query.



With thanks & Regards



Assistant Professor in Mathematics

SR International Institute of Technology,

Hyderabad, Andhra Pradesh, INDIA.

Dear Experts,

When I run this code in maple I am facing with "Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging".


ics := x[1](0)=1.7*10^8, x[2](0)=0,x[3](0)=400,psi[1](50)=0,psi[2](50)=0,psi[3](50)=0:

ode1:=diff(x[1](t), t)=lambda-mu*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)+delta*x[2](t),
 diff(x[2](t), t) =(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)-sigma*x[2](t),
 diff(x[3](t), t) =(1+psi[3](t)*k*x[2](t)/A[2])*k*x[2](t)-gamma*x[3](t),
 diff(psi[1](t), t) =-1+1/A[1]*beta^2*x[1](t)*x[3](t)^2*(psi[1](t)-psi[2](t))^2-psi[1](t)*(-mu+beta^2*x[3](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t))-psi[2](t)*(-beta^2*x[3](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t)),
> diff(psi[2](t), t) =1/A[2]*psi[3](t)^2*k^2*x[2](t)-psi[1](t)*delta+psi[2](t)*sigma-psi[3](t)*(psi[3](t)*k^2/A[2]*x[2](t)+(1+psi[3](t)*k*x[2](t)/A[2])*k),
> diff(psi[3](t), t) = 1/A[1]*beta^2*x[1](t)^2*x[3](t)*(psi[1](t)-psi[2](t))^2-psi[1](t)*(beta^2*x[1](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))-psi[2](t)*(-beta^2*x[1](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))+psi[3](t)*gamma;

sol:=dsolve([ode1,ics],numeric, method = bvp[midrich]);

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

Please help me to solve this equation on Maple.


I understand that the question is not really Maple related, but I still hope for some help.

See the worksheet below. I defined a pure sine wave and determined the complex Fourier coefficients for it which I used to plot the amplitude and power spectra. It is easy to see the relations in terms of amplitude and power between the time and frequency signal.

The Fourier Transform of the sine wave logically shows the Dirac distribution, but I can't see the relation in terms of amplitude and power to the original time signal. Taking the integral of the transformed signal (A) wil result in a step of Pi at w=-1 and again at w=1. What am I missing here?


restart; with(inttrans); with(plots); with(DynamicSystems)


Define a signal:


T := 2*Pi;






Determine the waveform power:


F := (int(f^2, t))/T+C:

C := simplify(solve(subs(t = 0, F) = 0, C)):

eval((int(f^2, t = -(1/2)*T .. (1/2)*T))/T)



plot([f, f^2, F], t = -Pi .. Pi, gridlines = true)



Determine the complex Fourier series coefficients and plot the spectra:


q := proc (n) options operator, arrow; (int(f*exp(-(2*I)*n*Pi*t/T), t = -(1/2)*T .. (1/2)*T))/T end proc:




ComplexCoefficients := evalf(`<,>`(seq(q(n), n = -1 .. 1)))

ComplexCoefficients := Vector(3, {(1) = .5000000000*I, (2) = 0., (3) = -.5000000000*I})


B := evalf(`<,>`(seq(sqrt(Re(q(n))^2+Im(q(n))^2), n = -3 .. 3))):


C := evalf(`<,>`(seq(Re(q(n))^2+Im(q(n))^2, n = -3 .. 3))); -1; DiscretePlot(C, -3, 1, titlefont = ["ARIAL", "bold", 14], title = "Power Spectrum", color = "Red", gridlines = true, style = stem)


So, the signal power for f of 1/2 can be found directly within the power spectrum plot "(2*1/(4))."


I would expect to be able to directly see the amplitude and power relation to the time signal from the Fourier Transform of f but i can't.


A := fourier(f, t, w);






Hi everyone

I am currently trying to make my own simple package including a few procedures. So far I have been able to write some "code" that actually works when I open the document and hit "enter". I would, however, like to save the package so it can be accessed during any Maple session using the command "with". I have unsuccesfully tried to comprehend the Maple help pages regarding this question but I definitely don't want to mess things up.

This is what I have written:

mat := module ()
description "useful procedures for mathematics, physics and chemistry";
export AtomicWeight;
option package;

   AtomicWeight := proc (x) description "returns the average atomic mass of the naturally ocurring element";
   Units:-AddSystem(NewSystem, Units:-GetSystem(SI), u);
   return evalf(ScientificConstants:-Element(x, atomicweight, system = NewSystem, units))
   end proc

end module;

What should I do to save it correctly?

Thank in advance,





I received an unexpected error message when trying to minimize a function: evaluating

returns the error message

Error, (in @) too many levels of recursion

Why am I getting this message?  It's hard for me to see how minimizing a function involves recursion, unless Maple is trying to iteratively approximate a solution.

I have a question regarding following problem:

assume(a > 0, a < 1, t > 0, Z0 > 0, z > 0)

f1 := proc (z) options operator, arrow; 1/z end proc

proc (z) options operator, arrow; 1/z end proc


I_1 := int(f1(z)*ln((a*z+1)/(1+z/a)), z = 0 .. Z0); 1; MultiSeries:-asympt(%, Z0, 3)



Using the representation which should hold for all a>0 and z>0

int(z*exp(t)*(a^2-1)/((exp(t)+a*z)*(exp(t)*a+z)), t = 0 .. infinity); 1; combine(%)



I'm calculating the result the other way around

int(z*exp(t)*(a^2-1)*f1(z)/((exp(t)+a*z)*(exp(t)*a+z)), z = 0 .. Z0); 1; I_2 := int(%, t = 0 .. infinity); 1; MultiSeries:-asympt(%, Z0, 3)



plot(eval([I_1, I_2], a = 1/2), Z0 = 0 .. 10)


So the results are the same.

But if I calculate this with another function

f2 := proc (z) options operator, arrow; 1/(z*(z+a)) end proc

proc (z) options operator, arrow; 1/(z*(z+a)) end proc


I_3 := int(f2(z)*ln((a*z+1)/(1+z/a)), z = 0 .. Z0); 1; MultiSeries:-asympt(%, Z0, 3)



int(z*exp(t)*(a^2-1)*f2(z)/((exp(t)+z*a)*(exp(t)*a+z)), z = 0 .. Z0); 1; I_4 := IntegrationTools:-Change(int(%, t = 0 .. infinity), t = ln(z)); 1; MultiSeries:-asympt(%, Z0, 3); 1; simplify(convert(convert(MultiSeries:-series(I_4, Z0, 1), polynom), polynom))



I get another result :-/ The Integral doesn't even vanish in the limit Z0 -> 0

Though if I take the limit prior:

int(z*exp(t)*(a^2-1)*f2(z)/((exp(t)+z*a)*(exp(t)*a+z)), z = 0 .. infinity);



the result is correct. What is the problem here?



Hi MaplePrimers!

I have a simulation in MapleSIM, exported as a compiled procedure in maple using -LinkModel(), and -GetCompiledProc.

I'm trying to do parameter estimation on my MapleSIM model.  Within a optimization scheme, I call the MapleSIM model, and it will output a curve.  Using a least squares method, I compare this measurements to synthetic experimental data (I know the actual values), and generate an objective function.  The optimization algorithm will try different parameter values, and try to minimze the objective function.  When the curves are exactly the same, the objective function will be zero.

The problem I am having is certain parameter sets will cause the model to require very small steps.  I wish to put a timeout on these experiments, because speed is important.  However, I would also like to see the results up to the point of requiring very small steps.  For timeout, I was using code along the lines of:

out:= timelimit(30,cProc(params = PData)); #simulate with 30s limit

where PData are the parameter guessses, and cProc is the compiled MapleSim model.

I would like 'out' to be assigned whatever the results were after 30 seconds, even if the model had not finished integrating.


Thanks in advance for any help!


     there is a common  differential equation in my maple note,the solution of the eq. can be expressed by

associated Legendre function(s),but i get a result by hypergeometric i can translate the later into a  single Legendre fun?

 Thank you in advance  

ode := 'sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))'/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2



Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2)


`assuming`([simplify(dsolve(ode))], [l::posint, m::integer, l >= m])

Theta(theta) = ((1/2)*cos(2*theta)-1/2)^((1/2)*m)*(sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)*_C1+2^(1/2)*(1-cos(2*theta))^(1/2)*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*_C2)/(1-cos(2*theta))^(1/2)


convert(Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2), `2F1`)

Theta(theta) = (1/2)*_C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*Pi^(1/2)*GAMMA(-(1/2)*m-(1/2)*l)*JacobiP(-(1/2)*m-(1/2)*l-1, 1/2, m, -cos(2*theta))/((1-cos(2*theta))^(1/2)*GAMMA(1/2-(1/2)*m-(1/2)*l))+_C2*Pi^(1/2)*GAMMA(1-(1/2)*m+(1/2)*l)*JacobiP(-(1/2)*m+(1/2)*l, -1/2, m, -cos(2*theta))*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/((1-cos(2*theta))^(1/2)*GAMMA(-(1/2)*m+(1/2)*l+1/2))






I have an ipad air 16G running ios 7.0.4 and downloaded the MaplePlayer APP.  t seems to crash on several of the routines for example, "Approximaing Sphere" and "Linear System Tutor". The app was last updated in 2011.  Do you have plans to any upgrades plan in the near future?

Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

I have theoretically 3(could eventually be more) layers with an incident wave with a wave equation for that wave.

It refracts into the 2nd layer from the first and now has a 2nd wave equation, then from the 2nd into the 3rd layer with a 3rd wave equation.

All the wave equations are of the form, Psi(z) = A_1psi_1(z) + B_1psi_2(z); this is just a general solution where psi_1&2 are linearly independant solutions that make up the general equation above and A_1 and B_1 are constant coefficients that would be A_2,B_2 and A_3,B_3 for the 2nd and 3rd layers respectively.

Transfer matrix method gives A_1,B_1 in terms of A_2,B_2(as it transfers from layer 1 to 2 they equate under boundary conditions so you can solve the simultaneous equations for results). You create a matrix of these results and multiply it with the respective matrix of the 2nd layer to 3rd layer to give you the overall transfer matrix from one side of the system to the other.

I think something to do with transfer function but not sure how to use it or set up the problem. 

Thanks in advance for any pointers.


Good afternoon sir.


I request your kind support to the above cited query.



With thanks & Regards



Assistant Professor in Mathematics

SR International Institute of Technology,

Hyderabad, Andhra Pradesh, INDIA.

First 6 7 8 9 10 11 12 Last Page 8 of 61