Preben Alsholm

13743 Reputation

22 Badges

20 years, 340 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Hamzaan The problem is that U and V are not known, thus diff(U(y),y) returns unevaluated.
unapply evaluates its arguments before processing. and
eval(diff(f(y),y), y=x) returns diff(U(x), x)*V(x)+U(x)*diff(V(x), x), thus you get the function
x->diff(U(x), x)*V(x)+U(x)*diff(V(x), x).
It would have been nice if
eval(diff(f(y),y), y=x) returned D(U)(x)*V(x)+U(x)*D(V)(x);
so that FPrime2 would return D(U)*V+U*D(V).
Notice that if f:=U(x); initially, then FPrime2:=unapply(eval(diff(f(y),y),y=x),x); returns D(U).
But the conversion to D doesn't take place in eval, but comes with using unapply.

Solutions.
Either
1. Using unevaluation quotes works:
FPrime2:=unapply('eval(diff(f(y),y),y=x)',x);
or
2. Using D(f)(x) instead of eval(diff(f(y),y),y=x).

@Markiyan Hirnyk
I'm assuming that the point of expansion is 0 and that we use the term 'power series' in the usual sense, i.e. a series of the form Sum(a[n]*x^n,n=0..infinity).

Then I didn't give nor intended to give any proof that no second power series solution exists. I just let Maple do the work.
Your own results show the appearance of a logarithmic term. That is enough do show the nonexistence of a second power series solution.

One might also try:
DEtools[indicialeq](myode,x,0,y(x)); #Roots 0 and 1 differ by an integer!
DEtools[formal_sol](myode,y(x),x=0,order=6); #Confirming earlier results
gfun[diffeqtorec](myode,y(x),u(n));
#Notice that y(0) is automatically set to 0 and that there is only one arbitrary constant.

My comment was directed at the OP, who seemed to insist on using the package powseries to find solutions.

@JoeyCard There just is no second power series solution:

dsolve(myode);
S:=series(rhs(%),x);
eval(S,_C2=0); #Power series solution
#Compare with
dsolve(myode,y(x),formal_series); #Also finds power series solution
eval(%,{infinity=5,Sum=add});

@cmcjas 
|T(z)|=1 iff |z-I|=|z+I|, meaning indeed that z has the same distance from I as from -I since z+I = z-(-I).
If L is the set of points with that property, then L must be the set of points on the real axis.

An illustration:
plots:-implicitplot(abs(T(x+I*y))=1,x=-5..5,y=-1..1,thickness=3,view=-1..1,gridrefine=1);


@IanLisle I just tried the eval trick and using mul again. It worked as I said above on my machine. Then after a restart I tried again. Then it crashed.
I got successes and failures in a few more attempts after closing the program or pasting the code into a new worksheet. So there is obviously some randomness in this.

interface(version);
Standard Worksheet Interface, Maple 17.02, Windows 7, September 5 2013 Build ID 872941
kernelopts(version);
     Maple 17.02, IBM INTEL NT, Sep 5 2013, Build ID 872941


@Carl Love Yes, you are right. So one might try

seq(simplify(T((N@@k)(z))-(T(z))^(2^k)),k=1..9);

Just a couple of observations:
Replacing add with sum doesn't help.
Replacing add with mul works (but of course produces something entirely different).
The following artificial construction works:

restart;
BlahObject := module()
    option object;
    export BlahMethod := proc()
    local C, d, i,f;
      eval(f(C[i]*d[i] + C[i], i=1..4),f=add);
    end proc;
  end module;

B := Object(BlahObject);
B:-BlahMethod();

@Kitonum I suggest replacing the print statement print(convert(.....)) with a return statement:
return convert(...);

The reason being that a print statement just does that: prints. There is no output to save to a variable as in
res:=Basises({x^2+x+4,  x+3,  2*x^2-x-5,  5*x^2+x-7});

@ecterrab I agree that these changes are welcome.

Let me use the opportunity to ask if there is any good reason why dsolve/SERIES and dsolve/INTTRANS need the indeterminate function(s) as the second argument unlike dsolve and dsolve/numeric?
Simple example:
restart;
ivp:={diff(x(t),t)=x(t),x(0)=1};
dsolve(ivp);
dsolve(ivp,numeric);
dsolve(ivp,x(t),series); #Unknown function needed
dsolve(ivp,x(t),method=laplace);#Unknown function needed


@bunmipopoola The manuals found these days in Maple itself are not bad at all.
In Maple look under the menu item Help/Manuals, Resources, and more/Manuals.

The manuals can also be downloaded from
http://www.maplesoft.com/documentation_center/

It used to be possible to subscribe to a post or question. This was useful when you didn't answer or comment yourself, but still wanted to follow the discussion. That feature seems left out.

Well, maybe it is just put under Comments feed. Haven't tried that.

@traiannp It appears to me that L1 appears in all the equations. Also if you remove the first 4 equations, then you still have 9 unknowns, viz.
{L1d, L1q, Ladssec, Laqssec, Lfd, Ll, R1d, R1q, Rfd}

I deleted my initial response as I realized that Carl had already said the same thing.

@bunmipopoola You can do like this
PrF; #Just recalling what PrF is
odeplot(sol,[t,rhs(PrF)],0..0.00431,labels=[t,Pr]);
#Analogously
odeplot(sol,[t,rhs(OF)],0..0.00431,labels=[t,O]);
#To plot D(P) we need to express it in terms of P, F, and T.
#Notice that in sys2 we have D(P) expressed in terms of D(T).
sys2;
#Thus we need to isolate the derivatives:
sys3:=solve(sys2,{D(F)(t),D(P)(t),D(T)(t)});
#(We might as well have done that earlier.)
#Thus D(P)(t) is given by
DP:=eval(D(P)(t),sys3);
odeplot(sol,[t,DP],0..0.00431,labels=[t,D(P)]);

Notice that double brackets in odeplot are not necessary if you have only one pair as we have.
If you have several, then you need them as in
odeplot(sol,[[t,log10(P(t))],[t,log10(T(t))]],0..0.00431,labels=[t,"log(P), log(T)"]);





@danlun If you set p to be what you have above (where multiplication signs are missing), you can correct that by using the following device:

indets(p,function);
nops(%); #6 multiplication signs are missing
q:=evalindets(p,function,s->op(0,s)*op(1,s)); #Correcting that
indets(q,function); #Output {}
factor(q);
nops(%);
type(q,`*`);

@Carl Love Here is a version which doesn't need unevaluation quotes, but is requires the sequence of variable names surrounded by a pair of double quotes:

restart;
a:=6: b:=7: c:=8:
p:=proc(s::string) unassign(parse(s)) end proc;
p("a,b,c");
a,b,c;
%;


One could even overload the existing unassign:

Unassign:=overload([
                    proc(s::string) option overload; unassign(parse(s)) end proc,
                    subsop(3=overload,eval(unassign))]
):
a:=6: b:=7: c:=8:
Unassign("a,b,c");
a,b,c;
%;
a:=6: b:=7: c:=8:
Unassign('a','b','c');
a,b,c;
%;

First 159 160 161 162 163 164 165 Last Page 161 of 231