Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I would like to generate a table with expansions of the formula p[t]=1/(1-psi*(beta-1))*m[t]-psi*(beta-1)/(1-psi*(beta-1))*p[t-1] for different values of t, perhaps with an Explore function over t. How could I achieve this?

I am trying to extract the coefficients of z from its series expansion. In two cases I succeed in finding the coefficients, but in the last one I fail to get the correct coefficients. Some garbage value is obtained. What is the reason behind this? I have attached my maple program.

 

 

test.mw

Hello,

I need help to classify my output. If somebody can help me to do that. I want to write the procedure MipEq where
I am interested to extract the first entries for every lists and categorize them. If the second entries are the same, then I want to classify the first entries into one output. Say, I have this output:

>MipEq(10);
{[0,[1,4,2,1]],[1,[2,1,4,2]],[2,[3,6,4,3]],[3,[3,6,4,3]],[4,[4,2,1,4]],[5,[4,3,6,4]],[6,[4,3,6,4]],[7,[5,8,6,5]],[8,[5,8,6,5]],[9,[5,8,6,5]],[10,[6,4,3,6]]}.

The bold output, its second entries are the same. Therefore I want to classify all the first entries so that it doesnt repeat.

I would like to have the new output:

{[0,[1,4,2,1]],[1,[2,1,4,2]],[[2,3],[3,6,4,3]],[4,[4,2,1,4]],[[5,6],[4,3,6,4]],[[7,8,9],[5,8,6,5]],[[10,[6,4,3,6]]}.

If the output is quite complicated to obtain, I can provide the procedures that involved in MipEq.
There are:
for parameter a,b:=3,1; 

The function F:

> Fp := proc (x) local Up, up; global a, b; Up := simplify((1/2)*(2*b-a+sqrt((2*b-a)^2+8*a*x))/a); if type(Up, integer) then up := Up+1 else up := ceil(Up) end if; return x+2*up*b-a*up^2 end proc;
> Fm := proc (x) local Um, um; global a, b; Um := simplify((1/2)*(-2*b-a+sqrt((2*b+a)^2-8*a*x))/a); um := ceil(Um); return x+2*um*b+a*um^2 end proc;
> F := proc (x) global Fp, Fm; Fm(Fp(x)); return % end proc;

The orbitPeriodic:

>OrbitPeriodic := proc (Map, ic) local orbit, t, z; z := ic; orbit[0] := z; for t while z <> ic or t = 1 do orbit[t] := z; z := Map(z); orbit[t] := z end do; return [seq(orbit[t], t = 0 .. t-1)] end proc;

The code:

>C := proc (x, Intvl) local i, n; n := nops(Intvl); if x = 0 then return 1 else for i from 2 to n do if x < Intvl[i] and Intvl[i-1] < x then return i-1 end if; if x = Intvl[i] then return i end if end do end if; "ERROR! YOU HAVE TO ADD THE INTERVALS" end proc;

Intervals:

> X := proc (m::integer) local D; D := (1/2)*a*m^2-b*m+(1/2)*a*m; return % end proc;
> Xp := proc (m::integer) local d; if 2*b < a then d := (1/2)*a*m^2-3*b*m+(3/2)*a*m-2*b+a else d := (1/2)*a*m^2+(7/2)*a*m-3*b*m+4*a-4*b end if; return % end proc;
>E := {seq(X(m), m = 0 .. 200)}; H := {seq(Xp(m), m = 0 .. 200)}; Intvl := `union`(E, H);

Equivalence Classes:

MipEq := proc (N) local Used, MinPts, IcCode, AllCodes, Codes, AC, q, ic, x, z, RT, AllPoints, Extract, EqClasses, EqClasses1; global F, C, OrbitPeriodic; Used := array(0 .. N); MinPts := array(0 .. N); IcCode := array(0 .. N); for ic from 0 to N do MinPts[ic] := true; for x in OrbitPeriodic(F, ic) do if x <= N then Used[x] := true end if end do end do; for ic from 0 to N do OrbitPeriodic(F, ic); IcCode[ic] := [ic, map(C, %, Intvl)] end do; Codes := {seq(IcCode[ic], ic = 0 .. N)}; AC := {seq(IcCode[ic][2], ic = 0 .. N)}; AllCodes := convert(AC, 'list'); RT := select(proc (x) options operator, arrow; `in`(x[1], AllCodes) end proc, Codes); return Codes, AllCodes end proc;

I hope somebody can help me.
Thank you very much for the help!

#Most  dediction of  depth of field of optical lens  involves various simplification,  hence cannot be used  for  close up photography.  With Maple, it is easy to obtain  precise   Depth of field  formuar for optical lens  without  any simplification

 

> restart; h := H = F^2/(N*coc)+F; E0 := 1/d+1/D0 = 1/F; E1 := 1/(d+e)+1/D2 = 1/F; E2 := a/(d+e) = coc/delta; E3 := a = F/N; eq := {E0, E1, E2, E3, h}; var := {D2, N, coc, d, delta}; e := -delta; sol1 := solve(eq, var); t1 := op(sol1)[1]; Dfar := op(t1)[2]; e := delta; sol2 := solve(eq, var); t2 := op(sol2)[1]; Dnear := op(t2)[2];

 

>

>
>

>
>
>

I have use a ''for cycle'' in order to get a series of points. I would like to save those points in a vector in order to use it for the ''PolynomialFit'' comand. The problem is that the points that I save are sort randomly. How can I take the value of the vector A in the right sequence? in the underline string you can plot the walue of A over t (which is not sorted). I can not use the sort command as I used for t even for A because the points are not increasing.

This is my code:

restart;

Atot := 0:

for ii from 0 by 0.01 to 2 do

PtotFkt := ii->  ii^2 :

Ptot := PtotFkt(ii):

Atot := Atot+0.01*Ptot:

A[ii] := Atot: #Save points in a Table

t[ii] := ii: #Save point in a table

end do;

AV := convert(A, list): #conversion from table to list
nops(AV);  #number of points

timme := convert(t, list): #conversion from table to list
nops(timme); #number of points

 

with(Statistics); #PolynomialFit

X := Vector(AV, datatype = float);

Y := Vector(sort(timme), datatype = float);

plot(Y, X, style = point, symbol = asterisk, color = blue);

regress := PolynomialFit(10, X, Y, time);

curve1 := plot(regress, time = 0 .. 2);

In Mathematica I've a function which allows me to send a mail. I use it when I run some long time computations and I want to get an information that they are finished, etc. Is there any way to do the same thing in maple?

 

 

Hi!I am running some grid computations and I found that I could speed up my computations if my nodes could share some partial results. It seems that Grid:-Send and Grid:-Receive is almost perfect. The problem is that Grid:-Receive blocks the computations where I cannot ensure that a message will ever be send. I've tried to run Grid:-Receive on a thread in an possible infinite loop but it still blocks.

Some pieces of code below:

SignatureReciever:=proc(SigContainer::uneval,stopValue::uneval)
  while eval(stopValue) do
    SigContainer := eval(SigContainer) union {convert(Grid:-Receive(),string)};
  end do;
end proc:

SendMessage:=proc(message::string, id::integer)
  Threads[Seq](proc(i) if i <> id then Grid:-Send(i,message) end if end proc,i=0..Grid:-NumNodes()-1);
end proc:

In the main procedure run on a node I have

Threads:-Create(SignatureReciever('Signatures','stopValue'));

....

....

SendMessage(signature,id);

....

....

stopValue := false;

 

Do you have any suggestions how to solve my problem?

in this code count.mw the error is about the dsolve between do and end do  but the dsolve actually works and can give me the value I want if there is no cycle outside like this count......mw , there is no big difference between two code about the dsolve funtion except the one in cycle is writen together not in several lines, why it happens and how to fix it?

Hello dears! Hope everything going fine with you. I have faced problem while solving the system of equations using fsolve command please find the attacment and fixed my problem.

I am very thankful to you for this favour. 

VPM_Help.mw

Mob #: 0086-13001903838

can we solve analytically a system of non-linear algebraic equation? my system is like:

 

b1 = a x + b y + c z

b2 = d x2 + e y2 + f z2

b3 = g x3 + h y3 + k z3

 

thanks

I am trying to use Compiler:-Compile with a generated function having a Vector as an argument. My function is (in a simplified form)

Mapt:=proc (pv) options operator, arrow; rtable(1 .. 6, {1 = .998026692438229*pv[1]-.605526643146912*pv[2]+0.154549004943741e-1*pv[6]+0.140818440886566e-5*pv[5], 2 = 0.651134546344795e-2*pv[1]+.998026692438228*pv[2]-0.510903331894809e-1*pv[6]+0.229399145141077e-8*pv[5], 3 = -.500000000000002*pv[3]-5.95856898901206*pv[4], 4 = .125869147673385*pv[3]-.499999999999996*pv[4], 5 = 0.510903331894806e-1*pv[1]-0.154549004943901e-1*pv[2]-40.6778361021594*pv[6]+.999998210424947*pv[5], 6 = .999998210424947*pv[6]-0.229399145141220e-8*pv[1]-0.140818440886565e-5*pv[2]+0.897571581395136e-7*pv[5]}, datatype = anything, subtype = Vector[column], storage = rectangular, order = Fortran_order) end proc;

Since this returns a Vector it cannot be compiled as is. So I split off the first output element (with the idea to later on do this with the others as well):

xpr:=eval(Mapt(<pv[1],pv[2],pv[3],pv[4],pv[5],pv[6]>))[1];
f1:=unapply(xpr,pv);
f1(<0.001,0.001,0,0,0,0>); # test f1: works
          0.000392500049291317

sf1:=Compiler:-Compile(f1); # this works, too

sf1(<0.001,0.001,0,0,0,0>); # but this fails
Error, (in sf1) invalid input: expecting a hardware float[8] rtable, but received 1


The examples in the Helpfile run so I think my installation is ok (my old Maple 15 won't even run the examples, but that is a different story). I have been banging my head against the wall here, trying many different ways, but none of them successfull. Worse, I do not understand the error message at all. Test program attached.

Mac OS X 10.10.5

Thanks for any hint,

M.D.

Compiler.mw

I tried to make a procedure that would find the determinant of any 3x3 matrix but I keep getting unterminated procedure what should I change??

Code:
DeterminantMat:=proc(matA::Array)
    local  i::integer,  j::integer,  x::integer,  y::integer,  A::integer,  B::integer,  indice::integer,  S::integer:
      A:=0:  B:=0:  S:=0: i:= 1:  j:=1:  x:=1:  y := 1:  indice:=1:

for x from 1 to 3 do
   indice := 1:  
   for i  from 1 to  3 do  
       if x = i then
           end do:
        else if x <>i then
           for j from 1 to 3 do
                  if y = j then  end do:  
                  else if indice = 1 then  A := matA(i,j):  indice := 2:  
                     else if indice = 2 then  B:=matA(i,j):  indice :=3:    
                       else if indice = 3 then  B :=B * matA(i,j):  indice :=4:    
                         else if indice = 4 then  A := A * matA(i,j):      
                             if x = 2 then  S := S + (-1 * matA(x,y)) * (A-B):
                               else  S := S + matA(x,y) * (A-B):   end if:   end if:
 end do:
 end if:
 end do:
 end do:
 end proc:

hi.i encounter with another error for solving couple equations.

bcs := {f1(0) = 0, f1(L) = 0, f2(0) = 0, f2(L) = 0, f3(0) = 0, f3(L) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(L) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(L) = 0}; sys := subs(omega^2 = omega2, {PDE[111], PDE[222], PDE[333]}); sys2 := PDEtools:-dchange({x = L*y, f1(x) = g1(y), f2(x) = g2(y), f3(x) = g3(y)}, sys, [g1, g2, g3, y]); indets(sys2, specfunc(diff)); solve(sys2, {diff(g3(y), `$`(y, 4)), diff(g1(y), y, y, y), diff(g2(y), y, y, y, y)}); sys3 := subs(omega2 = 10^19*omega3, sys2); bcs3 := {g1(0) = 0, g1(1) = 0, g2(0) = 0, g2(1) = 0, g3(0) = 0, g3(1) = 0, ((D@@1)(g2))(0) = 0, ((D@@1)(g2))(1) = 0, ((D@@1)(g3))(0) = 0, ((D@@1)(g3))(1) = 0}; extra_bcs := `minus`({seq(seq(((D@@i)(g1))(a), i = 0 .. 1), a = 0 .. 1), seq(seq(((D@@i)(g2))(a), i = 0 .. 1), a = 0 .. 1), seq(seq(((D@@i)(g3))(a), i = 0 .. 3), a = 0 .. 1)}, `~`[lhs](bcs3)); dsys4 := {bcs3, sys3}; ds := dsys4[1]; indets(dsys4[1], specfunc(diff)); solve(dsys4[1], {diff(g3(y), `$`(y, 4)), diff(g1(y), y, y, y), diff(g2(y), y, y, y, y)}); newsys := {ds[2], ds[3], diff(ds[1], y)}; indets(newsys, specfunc(diff)); S := solve(newsys, {diff(g1(y), `$`(y, 3)), diff(g2(y), `$`(y, 4)), diff(g3(y), `$`(y, 4))}); nops(%); bcs2 := eval[recurse](convert(ds[1], D), `union`({y = 0}, bcs3)); nops(`union`(bcs3, {bcs2}));

Error, (in simpl/eval) numeric exception: division by zero

division_by_zero.mw

please help.thanks..

hi.how i can allocate infinite value for a parameter such as N ,which is attached below ( N := infinite) .i encounter with error.please see it and help

thanks..

 

restart; Digits := 55; a := 0; m := 1; n := 1; x[0] := 0; a := 0; h1 := proc (theta) options operator, arrow; cos(n*theta) end proc; h3 := proc (theta) options operator, arrow; cos(n*theta) end proc; h2 := proc (theta) options operator, arrow; sin(n*theta) end proc; N := infinite; `#mover(mi("z"),mo("&circ;"))` := z+z__c; z__c := (1/2)*h; `&lambda;__c` := E__c*`&upsilon;__c`/(-`&upsilon;__c`^2+1); `&mu;__c` := E__c/(2*(1+`&upsilon;__c`)); `&eta;__c` := E__c/(-`&upsilon;__c`^2+1); `&lambda;__m` := E__m*`&upsilon;__m`/(-`&upsilon;__m`^2+1); `&mu;__m` := E__m/(2*(1+`&upsilon;__m`)); `&eta;__m` := E__m/(-`&upsilon;__m`^2+1); E__m := 42.9*10^9; `&upsilon;__m` := .325; `&rho;__m` := 6020; E__c := 170*10^9; `&upsilon;__c` := .25; `&rho;__c` := 4640; h := 10^(-9); R := 10*h; L := 20*R; `&ell;` := 0; f := 0; `&epsilon;__r` := 0; `&epsilon;` := 8.8541878176*10^(-12)*`&epsilon;__r`; f__z := 0; `f__&theta;` := 0; f__x := 0; lambda := proc (`#mover(mi("z"),mo("&circ;"))`) options operator, arrow; (`&lambda;__m`-`&lambda;__c`)*(`#mover(mi("z"),mo("&circ;"))`/h)^N+`&lambda;__c` end proc; mu := proc (`#mover(mi("z"),mo("&circ;"))`) options operator, arrow; (`&mu;__m`-`&mu;__c`)*(`#mover(mi("z"),mo("&circ;"))`/h)^N+`&mu;__c` end proc; rho := proc (`#mover(mi("z"),mo("&circ;"))`) options operator, arrow; (`&rho;__m`-`&rho;__c`)*(`#mover(mi("z"),mo("&circ;"))`/h)^N+`&rho;__c` end proc; eta := proc (`#mover(mi("z"),mo("&circ;"))`) options operator, arrow; (`&eta;__m`-`&eta;__c`)*(`#mover(mi("z"),mo("&circ;"))`/h)^N+`&eta;__c` end proc; `D__1,0` := int(eta(`#mover(mi("z"),mo("&circ;"))`), z = -z__c .. h-z__c); `D__1,1` := int(eta(`#mover(mi("z"),mo("&circ;"))`)*z, z = -z__c .. h-z__c); `D__1,2` := int(eta(`#mover(mi("z"),mo("&circ;"))`)*z^2, z = -z__c .. h-z__c); `D__3,0` := int(lambda(`#mover(mi("z"),mo("&circ;"))`), z = -z__c .. h-z__c); `D__3,1` := int(lambda(`#mover(mi("z"),mo("&circ;"))`)*z, z = -z__c .. h-z__c); `D__3,2` := int(lambda(`#mover(mi("z"),mo("&circ;"))`)*z^2, z = -z__c .. h-z__c); `D__5,0` := int(lambda(`#mover(mi("z"),mo("&circ;"))`), z = -z__c .. h-z__c); `D__5,1` := int(lambda(`#mover(mi("z"),mo("&circ;"))`)*z, z = -z__c .. h-z__c); `D__5,2` := int(lambda(`#mover(mi("z"),mo("&circ;"))`)*z^2, z = -z__c .. h-z__c); `I__1,0` := int(rho(`#mover(mi("z"),mo("&circ;"))`), z = -z__c .. h-z__c); `I__1,1` := int(rho(`#mover(mi("z"),mo("&circ;"))`)*z, z = -z__c .. h-z__c); `I__1,2` := int(rho(`#mover(mi("z"),mo("&circ;"))`)*z^2, z = -z__c .. h-z__c); with(Student[Calculus1])

[AntiderivativePlot, AntiderivativeTutor, ApproximateInt, ApproximateIntTutor, ArcLength, ArcLengthTutor, Asymptotes, Clear, CriticalPoints, CurveAnalysisTutor, DerivativePlot, DerivativeTutor, DiffTutor, ExtremePoints, FunctionAverage, FunctionAverageTutor, FunctionChart, FunctionPlot, GetMessage, GetNumProblems, GetProblem, Hint, InflectionPoints, IntTutor, Integrand, InversePlot, InverseTutor, LimitTutor, MeanValueTheorem, MeanValueTheoremTutor, NewtonQuotient, NewtonsMethod, NewtonsMethodTutor, PointInterpolation, RiemannSum, RollesTheorem, Roots, Rule, Show, ShowIncomplete, ShowSolution, ShowSteps, Summand, SurfaceOfRevolution, SurfaceOfRevolutionTutor, Tangent, TangentSecantTutor, TangentTutor, TaylorApproximation, TaylorApproximationTutor, Understand, Undo, VolumeOfRevolution, VolumeOfRevolutionTutor, WhatProblem]

(1)

NULL

 

 

infinite.mw

Hi!

 

For some reason my three equation with three unknowns won't be solved. Anyone who can help? I tried the following:

Really appreciate anyone who can help me out!

 

First 1143 1144 1145 1146 1147 1148 1149 Last Page 1145 of 2224