Preben Alsholm

13743 Reputation

22 Badges

20 years, 341 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@bails123 Did you use the thick green arrow in the icon panel? It's the last one in the second row.

If for some reason that proves impossible could you give us the Maple syntax from your worksheet as text?

There is no file attached.

@96mhaynes 
P must be negative since otherwise f''(x) > 0 for all x > 0 for which the solution exists, in which case f would never attain the value 0.
In fact we must demand at least initially that f''(0) < 0. Thus we at least have
eval(rhs(ode),{x=0,f(x)=1})<0;
which returns P < -1/20.

For guess work let us assume that f''(x) < 0 for 0 < x < a. Thus f'(x) > f'(a) = -1/sqrt(3) for 0 < x < a.
Integrating this inequality from x = 0 to x = a we get
f(a) - f(0) > (-1/sqrt(3))*a.
Thus by f(a) = 0 and f(0) = 1 we get a > sqrt(3).
This gives us some idea about the size of a; remember we don't know that f''(x) < 0 on the whole interval 0..a.

The guessing values for a and P in
sol:=fsolve([p1,p2],[1.9,-.6]);
conforms to the estimates for a and P given above.

Remark.
As it turns out our solution does indeed satisfy f''(x) < 0 for 0 < x < a:
plots:-odeplot(res,[x,eval(rhs(ode),P=sol[2])],0..10);

Additional remarks.
The maximal interval of definition of the solution found has upper bound something like 10.877911. Try
plots:-odeplot(res,[[x,f(x)],[x,diff(f(x),x)]],0..11);

If you are new to using the parameters option in dsolve/numeric you must realize that by doing
res(parameters=[-.5678]);
you are changing the parameter P in the ode and thus the solution. Plotting after a change in P gives a different graph (solution) than before. Notice that the procedure p sets the parameter and by using fsolve on p1,p2 many changes are made. The last value (when fsolve succeeds) corresponds to the one you want.

@Carl Love In 2D input space is interpreted as multiplication. One of the very good reasons to stay away from 2D input.

@96mhaynes fsolve is given two arguments: The first the list of 4 procedures each accepting 4 arguments a,b,f0,omega. The second argument to fsolve is a list of starting values for a,b,f0,omega. Good starting values may require some exploration and luck.

@96mhaynes You talked about a and b that is why I asked for two K's.

You must mean K = 1/sqrt(3) and not -1/sqrt(3).
Otherwise f'(a) would be positive since you said that f'(a) = -K.

I posted a solution with only the a-part.

@96mhaynes What are the values of the two K's?
In my simple example they were 1 and -1.

@96mhaynes If f has only 2 zeros a and b, then f´(a) + K =0 and f'(b) + K = 0 cannot both hold unless K = 0 (assuming smoothness of f).
Or do you use different values of K for a and b, one negative and the other positive?

@sarunas 
evalf(arctan(519/520));
convert(%,degrees);
evalf(%);
#Or in one step:
evalf(convert(arctan(519/520),degrees));


In your code Q appears. I don't see it in the image. There I see a Q[0], but only in the initial conditions.
And what is it?

Could you rephrase that question?
What are X, Y, and A?
The dot product of u and v can be found in Maple by doing
<2,5>.<4,9>;

You need exp(-l/a) instead of exp^(-l/a).

Even with all constants set to 1 Maple doesn't find an antiderivative:

Int(2/(1+eval(P,{k=1,y=1,v=1,a=1})),o);
value(%);
# returns unevaluated.

If the constants are known and the integral is definite and over a known range then numerical integration can be used.
Example:
evalf(Int(2/(1+eval(P,{k=1,y=1,v=1,a=1})),o=0..10));



@Hamzaan It is still not clear to me why you cannot use D as in
restart;
f:=x-> x*U(x);
Fprime:=f:
to 20 do Fprime:=D(Fprime); Fprime(0) end do;

or

restart;
f:=x-> V(x)*U(x);
Fprime:=f:
to 5 do Fprime:=D(Fprime); Fprime(0) end do;


Maybe it would help if you presented the problem in its entirety or a simplified version of it containing the essential features.

@nm You could introduce u = (z-1)^(-1) thus z = 1/u+1 and do:
restart;
f:=z->(3*z+1)/(z^2-1);
numapprox:-laurent(f(1/u+1),u=0);
subs(u=(z-1)^(-1),%);


@Hamzaan 
For the sake of clarity I have given new names to the iterated versions of FPrime:
restart;
f:=(x)-> x*U(x);

FPrime:=unapply('eval(diff(f(y),y),y=x)',x);
FPrime(0);
FPrime2:=unapply('eval(diff(FPrime(y),y),y=x)',x);
FPrime2(0);
convert(%,D);
FPrime2a:=unapply(PDEtools[dsubs](diff(U(x),x)=D(U)(x),diff(FPrime(x),x)),x);
FPrime2a(0);

Is there a problem?


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