MaplePrimes Questions

Consider, say, the following third order derivative:

expr := diff(f(x,y),x,y$2);

Does there in Maple exist some built-in functions for extracting from such an expression 1.) the function being differentiated, and 2.) the coordinates being differentiated with respect to? Using op(expr) is of no immediate avail as it returns only a second order derivative (as the first operand), and one of the coordinates being differentiated with respect to (as the second operand).

It is, of course, possible to make ones own function for extracting these two quantities, a crude example being

splitDeriv := proc(expr,coords::expects(list) := [])
   if PDETools:-difforder(expr) > 0 then
      splitDeriv(op(1,expr),[coords[],op(2,expr)])
   else
      expr,coords
   end if
end proc:

for which

splitDeriv(expr);

But it would be much nicer to use built-in functions. And perhaps such functions do exist. If so, I am unable to locate them. Perhaps I am just being stupid, for the problem seems rather elementary.

Hello,

I have just noticed that solving a nonhomogeneous linear ode using maple dsolve gives a different solution when compared to hand calculation by method of undetermined coefficient. For instance, this equation equation is  

has the solution

Using dsolve for the same function give something completely different. Any assistance on how I can resolve this will be highly appreciated

 

 

I have the mathematica code given below. I am using Wolfram Mathematica Online.
I am very new to Mathematica. When I put this code, I do not get any output.
It just does not show me anything.




\[Alpha] = 3; F[s_] := Exp[-A*s^(2/\[Alpha])]; integral = Re[Assuming[{A > 0, t > 0, {t, A} \[Element] Reals}, Integrate[F[s]*Exp[s*t] /. s -> I*y, {y, 0, Infinity}]/Pi]]

Can some help me?

Dear all

I have problem related to collection of coefficient of differtials in differential expression containing multiple dependent variables and we want to collect coefficient wrt to selected dependent variables. Please see attached Maple file for details.

 


with(PDEtools):

DepVars := [u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

[u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

(1)

alias(u = u(x, t), v = v(x, t), a[1] = a[1](t), a[2] = a[2](t), a[3] = a[3](t), b[1] = b[1](t), b[2] = b[2](t), b[3] = b[3](t), r = r(x, t), s[1] = s[1](x, t), p[1] = p[1](x, t), s[2] = s[2](x, t), p[2] = p[2](x, t))

u, v, a[1], a[2], a[3], b[1], b[2], b[3], r, s[1], p[1], s[2], p[2]

(2)

Suppose we differential expression like:

a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]+diff(p[1], t)+a[3]*(diff(p[1], x, x, x))+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]-3*(diff(r, x))*p[1]+(diff(a[1], t))*u*(diff(u, x))+(diff(a[2], t))*v*(diff(v, x))+a[2]*(diff(v, x))*p[2]+a[2]*v^2*(diff(s[2], x))+a[2]*v*(diff(p[2], x))+a[1]*u*(diff(p[1], x))+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))+3*a[3]*(diff(s[1], x))*(diff(u, x, x))+3*a[3]*(diff(s[1], x, x))*(diff(u, x))+a[3]*(diff(r, x, x, x))*(diff(u, x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+a[3]*(diff(s[1], x, x, x))*u+3*a[3]*(diff(r, x, x))*(diff(u, x, x)) = 0

3*a[3]*(diff(diff(r, x), x))*(diff(diff(u, x), x))+3*a[3]*(diff(s[1], x))*(diff(diff(u, x), x))+3*a[3]*(diff(diff(s[1], x), x))*(diff(u, x))+a[3]*(diff(diff(diff(r, x), x), x))*(diff(u, x))+a[3]*(diff(diff(diff(s[1], x), x), x))*u+diff(p[1], t)+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-3*(diff(r, x))*p[1]+a[3]*(diff(diff(diff(p[1], x), x), x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]+a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))+(diff(a[1], t))*u*(diff(u, x))+a[1]*u*(diff(p[1], x))+a[2]*v*(diff(p[2], x))+a[2]*v^2*(diff(s[2], x))+a[2]*(diff(v, x))*p[2]+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+(diff(a[2], t))*v*(diff(v, x)) = 0

(3)

We can collect coefficients of differential like u[x], u[x, x], v[x], u, vin following manner:

The Procedure

   

 

 

Now how can we collect coefficents with respect to u[x], u[x, x], v[x], u, vso that differential expression (3) appear as
"(......)*u+(.......)*v+(......)*u[x]+(........)*uu[x]+(.........)vv[x]+(........)u[xx]  =0....................."????????""

``


Download Collecting_Coefficients_in_Differential_Expression.mw

Regards

Hey,

I have an expression like this:

a:= b(t)+diff(b(t),t)+diff(b(t),t$2)+diff(b(t),t$3)+...:

 

I want to substitute diff(b(t),t) with b_symbol_diff. I dont know how many more differentials are in the expression.

If I use subs(diff(b(t),t)=b_symbolic_diff,a)

maple also substitutes in diff(b(t),t$2). Because b_symbol_diff is not a function of t the higher order differentials are zero.

Is there a way to tell maple not to substitute those expressions that are enclosed in diff()?

I need this because I want to calculate the Jacobian of a vector and VectorCalculus[Jacobian]() does not accept functions.

Thanks in advance!

I am having difficulty helping someone series expand an eigenvector solution.  I can expand the eigenvalues easily but get a numeric exception divide by zero when I attempt to expand a component of an eigenvector.  Mathematica seems to have no problem solving this problem.  Any help would be appreciated.

 

 

 

 

 

assume(varepsilon > 0)

H := Matrix(3, 3, {(1, 1) = 0, (1, 2) = -epsilon, (1, 3) = epsilon, (2, 1) = -epsilon, (2, 2) = 2-2*epsilon, (2, 3) = 0, (3, 1) = epsilon, (3, 2) = 0, (3, 3) = 2+2*epsilon})

Matrix(%id = 18446744078100429630)

(1)

with(LinearAlgebra):

evals, evecs := Eigenvectors(H):

e1 := convert(simplify(series(evals[1], varepsilon = 0, 4)), polynom)

2+2*varepsilon+(1/2)*varepsilon^2-(7/16)*varepsilon^3

(2)

e2 := convert(simplify(series(evals[2], varepsilon = 0, 4)), polynom)

-varepsilon^2

(3)

e3 := convert(simplify(series(evals[3], varepsilon = 0, 4)), polynom)

2-2*varepsilon+(1/2)*varepsilon^2+(7/16)*varepsilon^3

(4)

simplify(series(evecs[1][1], epsilon = 0, 4))

Error, (in simplify/sqrt/local) numeric exception: division by zero

 

``

 

Download CourseraOpticsEigenvalues.mwCourseraOpticsEigenvalues.mw

Hello

How can i get whether a radio box is checked or not through another button action window. I have attached a picture of my question. Could you please help me to solve it.

 Thank you

We are running Maple16 in a virtual lab setup using Citrix, when exporting to PDF and saving the file to the local machine the PDF comes out as a 0kb file and the PDF is corrupt.  Has anyone else had an issue like this before?

without _Y(t) and DESol?

f := diff(u(t), t$2) + (2/t-1/t^2*p(1/t))*diff(u(t),t) + 1/t^4*q(1/t)*u(t) = 0;
dsolve(f,u(t));
u(t) = DESol({q(1/t)*_Y(t)/t^4+(2/t-p(1/t)/t^2)*(diff(_Y(t), t))+diff(_Y(t), t, t)}, {_Y(t)})

just would like to find u1 and u2 solution

how to transform this differential equation with a substitution?

f := diff(u(x),x$2) + p(x)*diff(u(x),x)+q(x)*u(x)=0;
transformed := subs(x=1/t, f);

 

f := diff(u(x),t$2)*diff(t,x$2) + p(x)*diff(u(x),t)*diff(t,x)+q(x)*u(x)=0;

diff(1/t,t);
diff(1/t,t$2);

 

x = 1/t
dx/dt = -1/t^2
d2x/dt2 = 2/t^3

d2u/dt2*dt2/dx2
du/dt*dt/dx
diff(u(t),t$2)*1/(2/t^3) + p(t)*diff(u(t),t)*1/(-1/t^2)+q(t)*u(t)

restart;
f := u2*1/(2/t^3) + p(t)*u1*1/(-1/t^2)+q(t)*u;
f2 := collect(f/t^3*2, {u2, u1, u});
subs(u2 = diff(u(t),t$2), subs(u1 = diff(u(t), t), subs(u=u(t), f2)));

but not equal to below which is in book, is this equation wrong in book?

f := diff(u(t), t$2) + (2/t-1/t^2*p(1/t))*diff(u(t),t) + 1/t^4*q(1/t)*u(t) = 0;

 

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!

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?

 

 

First 1167 1168 1169 1170 1171 1172 1173 Last Page 1169 of 2434