MaplePrimes Questions

Hello dear Maple,

My name is Bulat, I'm student of Kazan National Research Technical University ( Russia). In our High Program we used your product ( Maple V, Release 4). Now I have two problems and I haven't no idea how I resolve their. I am forced to ask for your help. I upload PrintScreen of my two problems. Please help me to solve them. I' ll be grateful for your help. Sorry for my English :(.

Yours very truly, Bulat

I'm trying to use the Grid package to speed up my computations somewhat, however Grid[Map] does not seem to play well with add.

Erroran := proc (e, g, f, T)
 local k, errorterm, terms, n, ma, i;

 ma := proc (n) options operator, arrow; evalf(T*(1/2)*maximize(int(f*f, x = 0 .. 1)-add(int(f*sqrt(2)*sin(k*Pi*x), x = 0 .. 1), k = 0 .. n), s = 0 .. T)/(Pi*Pi)) end proc;

 errorterm := proc (n) options operator, arrow; int(g*g, x = 0 .. 1, numeric)-add(int(g*sqrt(2)*sin(k*Pi*x), x = 0 .. 1, numeric), k = 1 .. n)+ma(n) end proc;

 i := 1;

 while e < Grid[Map](errorterm, i) do i := i+1 
end do;
 return i
 end proc

h := piecewise(x <= 0, 0, 0 < x and x < 1, 3, x >= 1, 0)

Erroran(0.1e-3, h, 1, 1)

 

When I run the above code I get the error "Error, (in Grid:-Map) unable to execute add." Does anyone know of a workaround to this? Or another way to speed up my code? If so it would be much appreciated. 

The code works perfectly well if I don't use Grid and just use "errorterm(i)" in my while loop instead.

Hi,

Ive been trying to use the global optimization toolbox to optimize a model I extract from the maplesim environment.
It works fine with the regular Optimization toolbox. but when I run the optimization on the Global toolbox I get this error:

Warning, Error at t=0.0000000000000000e+000: index-1 and derivative evaluation failure

to explain a little,
I use the getCompiledProc command to turn the maplesim model into a module to be used in maple.

pjf

with(plots):
with(Grid):

HeatPC := proc (f, g, n, lambda, N, T)
 local k, u, i, L,fcoef;
 fcoef := proc (y) options operator, arrow; sqrt(2)*sin(lambda*y) end proc;
 u := proc (y, t) options operator, arrow; sum((int(fcoef(x)*g, x = 0 .. 1, numeric))*exp(-k*lambda*t)+exp(-k*lambda*t)*(int(exp(k*lambda*s)*(int(f, x = 0 .. 1, numeric)), s = 0 .. t, numeric)), k = 1 .. n) end proc;
 L := [Grid[Seq](plot(u(x, (i*T-T)/N), x = 0 .. 1, color = COLOR(HUE, i/N), legend = typeset((i*T-T)/N, "s")), i = 1 .. N)]; 
return u(1, 1), display(L, legendstyle = [location = right])
 end proc;

h := piecewise(x <= 0, 0, 0 < x and x < 1, 3, x >= 1, 0)

HeatPC(1, h, 100, Pi, 10, 1.5)

I'm trying to use the above procedure to plot graphs for different inputs. To make the code easier on the eye I want to split my main function u into several smaller functions. To that end I added the function fcoef. Now when I try to run the procedure for simple input values I get the error "Warning, expecting only range variable x in expression 100.*int(fcoef(x)*piecewise(x <= 0.,0.,0. < x and x < 1.,1.,1. <= x,0.),x = 0. .. 1.) to be plotted but found name fcoef". However u still evaluates nicely at (1,1) so obviously my function fcoef is well defined. How do I go about getting plot to recognize this?

 

 

Dear Friends, 

I would appreciate your help in resolving some issues. Let me describe my dummy code and the issues I am having. 

1. I have two functions f(x,a) and g(x,a) are well defined. 

2. I need to get roots of f(x,a). I am using the command soln := Roots(f(x,a)) which gives me a list of all possible values of x. 

3. I need to choose only one element -- say x* -- from the list "soln" such that x*=argmax{g(x,a) | g(x,a)>0 for x in soln}.

I am not able to find a technique (i) to evaluate g(x,a) for all elements of the list "soln", (ii) and select x* that maximizes g(x,a). 

Picking and choosing elements of the list one by one is difficult since the number of elements in the list can vary with parameter "a" and it would complicate the matter in numerical studies. 

I would sincerely appreciate any inputs in this regard. 

Thank you,

Omkar

 

How can I get maple2016 to simplify sqrt(3579757) to 151*sqrt(157) ?

Hello.

Can I ask maple to give me a vector parametrization of any arbituary surface? Lets say I am given some surface in the form z=(g(x,y) or f(x,y,z).

In some cases finding a vector parametrization can be tidous and hard. I have looked at the algcurves help page, it is helpful in som cases but not that much for surfaces.

Lets for the purpose of this exampl say I wanted to obtain a parametrization for the torus (C-sqrt(x^2+y^2))^2+z^2=a^2

Is maple able to help me with this process beside making the plot and start the manual visualization and work?

Hello everyone.

I was wondering if anyone knew of a way to have a supscript+superscript layout on the left hand side of the equation in 1D math?

When I try to use (A)[b]^(c) from the layout palette it does not allow me to use it in 1D Math, and when using it in any of the math types (1D and both of the 2D options) it is not accepted on the left hand side of the equation.

I am writing a project where we use transformation matrices, and I seem to be unable to define them as they are supposed to be. I am left with T__40 when I want to write (T)[4)^(0).

Help would be very much appreciated.

I  encountered a non-integrable integral in the process of solving the following process, . How to achieve its numerical solution? Such as in a looping   code:

#######
pa[i] := pa[i-1]-(Int(subs(t = tau, Lpa[i-1]+Na1[i-1]-Na2[i-1]), tau = 0 .. t)); 

pw[i] := pw[i-1]-(Int(subs(t = tau, Lpw[i-1]+Nw1[i-1]-Nw2[i-1]), tau = 0 .. t)); u[i] := u[i-1]-(Int(subs(t = tau, Lu[i-1]+Nu1[i-1]+Nu2[i-1]), tau = 0 .. t));

######
Detailed code see annexBC2.mw

what does it means and what it will do. Can some one help me for solving this

Shootlib := "C:/Shoot9"; libname := Shootlib, libname; with(Shoot);

while i m receiving the following message:

"Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received Shoot "

Full program is :

restart; Shootlib := "C:/Shoot9"; libname := Shootlib, libname; with(Shoot);
with(plots):
N1 := 1.0; N2 := 2.0; N3 := .5; Bt := 6; Re_m := N1*Bt; gamma1 := 1;
FNS := {f(eta), fp(eta), fpp(eta), g(eta), gp(eta), m(eta), mp(eta), n(eta), np(eta), fppp(eta)};
ODE := {diff(f(eta), eta) = fp(eta),
        diff(fp(eta), eta) = fpp(eta),
        diff(fpp(eta), eta) = fppp(eta),
        diff(g(eta), eta) = gp(eta),
        diff(gp(eta), eta) = N1*(2.*g(eta)+(eta-2.*f(eta))*gp(eta)+2.*g(eta)*fp(eta)+2.*N2*N3*(m(eta)*np(eta)-n(eta)*mp(eta))),
        diff(m(eta), eta) = mp(eta),
        diff(mp(eta), eta) = Re_m*(m(eta)+(eta-2.*f(eta))*mp(eta)+2.*m(eta)*fp(eta)),
        diff(n(eta), eta) = np(eta),
        diff(np(eta), eta) = Re_m*(2.*n(eta)+(eta-2.*f(eta))*np(eta)+2.*N2/N3*m(eta)*gp(eta)),
        diff(fppp(eta), eta) = N1*(3.*fpp(eta)+(eta-2.*f(eta))*fppp(eta)-2.*N2*N2*m(eta)*(diff(mp(eta), eta)))
       }:
   
blt := 1.0;
IC := { f(0) = 0,
        fp(0) = 0,
        fpp(0) = alpha1,
        g(0) = 1,
        gp(0) = beta1,
        m(0) = 0,
        mp(0) = beta2,
        n(0) = 0,
        np(0) = beta3,
        fppp(0) = alpha2
      };
BC := { f(blt) = .5,
        fp(blt) = 0,
        g(blt) = 0,
        m(blt) = 1,
        n(blt) = 1};
infolevel[shoot] := 1;
 

I am having touble plotting the equation, diff(y(t), t$3)+3*(diff(y(t), t$2))+4*(diff(y(t), t))+12*y(t) = 0. With the intional conditons y'(0)=y''(0)=0 and y(0)=3.

Currently I am getting this error, "Error, (in dsolve/numeric/type_check) insufficient initial/boundary value information for procedure defined problem."

My current eqution is DEplot(ode, y(t), t = -1 .. 5, y(t) = -5 .. 5, [ivp]), with ivp := [((D@D)(y(t)))(0) = 0, (D(y(t)))(0) = 0, (y(t))(0) = 3].

HI

please help me for dsolve this nonlinear differential equations

thanls...

HAB.mw
 

restart; Digite := 100; Phi0 := 5; A := b*h; g13 := 31/250000000; g1 := 113/500000; f13 := 1/1000000000; c1 := 226000000000000; b := 10*10^(-9); J := (1/12)*b*h^3; h := 15*10^(-9); L := 100*10^(-9); E1 := (339/10000000000000000000000)*(diff(u(x), x, x, x, x))+(1017/10000000000000000000000)*(diff(w(x), x, x))*(diff(w(x), x, x, x))+(339/10000000000000000000000)*(diff(w(x), x, x, x, x))*(diff(w(x), x))-(339/10000)*(diff(u(x), x, x))-(339/10000)*(diff(w(x), x))*(diff(w(x), x, x)) = 0

E2 := -(1017/1600000000000000000000000000000000000000)*(diff(w(x), x, x, x, x, x, x))+(1589109/2500000000000000000000000)*(diff(w(x), x, x, x, x))-(339/10000*(diff(u(x), x, x)+(diff(w(x), x))*(diff(w(x), x, x))))*(diff(w(x), x))-(diff(w(x), x, x))*((339/10000)*(diff(u(x), x))+(339/20000)*(diff(w(x), x))^2+0.5824000000e-4)+(339/10000000000000000000000)*(diff(w(x), x, x))*(diff(u(x), x, x, x)+(diff(w(x), x, x))^2+(diff(w(x), x, x, x))*(diff(w(x), x)))+(339/10000000000000000000000)*(diff(w(x), x))*(diff(u(x), x, x, x, x)+3*(diff(w(x), x, x))*(diff(w(x), x, x, x))+(diff(w(x), x, x, x, x))*(diff(w(x), x)))-2 = 0:
 

E3 := -5.385803274*10^(-17)*(diff(Phi(x), x, x))+2.659881780*Phi(x)-5.125107476*10^(-20)*(diff(psi(x), x, x))+1.146681319*psi(x)+3.300000000*10^(-8)*(diff(w(x), x, x)) = 0:

E4 := -5.125107476*10^(-20)*(diff(Phi(x), x, x))+1.146681319*Phi(x)+(891/100000000000000)*(diff(psi(x), x, x))/Pi+34976.39822*psi(x)+0.4351500000e-5*(diff(w(x), x, x)) = 0:

dsys3 := {EQ1, EQ2, EQ3, EQ4, c1*J*((D@@2)(w))(0)+A*g13*((D@@2)(w))(0)-2*b*f13*Phi0-g1*J*((D@@4)(w))(0)+g1*A*(((D@@2)(u))(0)+((D@@1)(w))(0)*((D@@2)(w))(0))*((D@@1)(w))(0) = 0, c1*J*((D@@2)(w))(L)+A*g13*((D@@2)(w))(L)-2*b*f13*Phi0-g1*J*((D@@4)(w))(L)+g1*A*(((D@@2)(u))(L)+((D@@1)(w))(L)*((D@@2)(w))(L))*((D@@1)(w))(L) = 0, Phi(0) = 0, Phi(L) = 0, psi(0) = 0, psi(L) = 0, u(0) = 0, u(L) = 0, w(0) = 0, w(L) = 0, (D(u))(0) = 0, (D(u))(L) = 0, ((D@@2)(w))(0) = 0, ((D@@2)(w))(L) = 0}; dsolve(dsys3, numeric, initmesh = 3024, abserr = 0.1e-4)

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

 

``


 

Download HAB.mw

 

Why Deplot3d does not work in Maple 2016?

For example, 

with(DEtools);

DEplot3d({diff(y(x), x) = y(x)-z(x), diff(z(x), x) = z(x)-2*y(x)}, {y(x), z(x)}, x = 0 .. 3, [[y(0) = 1.638, z(0) = 2.31]], y = 0 .. 2, z = -4 .. 4, scene = [x, z(x), y(x)], linecolor = COLOR(HUE, .5));

There is nothing shown in Maple 2016.

Hi all,

 how to calculate this integral:

int(sqrt(a^2+cos(x)),x=0..Pi);

 

I uploaded this file AnimationTest.mw to the Maple Cloud. One a 3d animation and one just a 3d plot. When I open the file in the Maple Cloud from my browser,  I cannot rotate either plot with the mouse. Is there a way to change the worksheets so rotation from the browser will be possible?

First 1049 1050 1051 1052 1053 1054 1055 Last Page 1051 of 2429