Preben Alsholm

13471 Reputation

22 Badges

20 years, 249 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

By separating variables in the two ode's (ode1 and ode2) you obtain from E = 1, you find the solutions y(x) = sin(arcsinh(x)) and y(x) = - sin(arcsinh(x)).

However, there are infinitely many solutions since y = 1 and y = -1 are constant solutions which are reached in finite "time" x.

The solution y(x) = sin(arcsinh(x)) reaches 1 for x = x1 = sinh(Pi/2), and infinitely many solutions can be constructed by beginning with sin(arcsinh(x)) until x = x1, then let y(x) = 1 for x1 < x < x2, then switch to a decreasing solution obtained from ode2. And when that reaches -1 you can let the solution be -1 on an interval of arbitrary length then switch (if you like) to an increasing solution obtained from ode1, etc.

Solving numerically your solution of ode1 stays at 1 after it reaches it.

You may try the following though.

restart;
E:=(1+x^2)*(diff(y(x),x))^2+(y(x))^2=1;
E1,E2:=solve(E,{diff(y(x),x)});
E1:=simplify(E1) assuming real;
E2:=simplify(E2) assuming real;
res1:=dsolve(E1 union {y(0)=0});
#This solution is not a solution of E2, but is a solution of E:
simplify(eval(E,res1));
plot(rhs(res1),x=0..12);

#Numerical solution:

res1num:=dsolve(E1 union {y(0)=0},numeric);

plots:-odeplot(res1num,[x,y(x)],0..12);

But as I said there are infinitely many solutions to your problem.

@amrramadaneg You can assign a value to Digits (which initially has the value 10):

Digits:=50;

Now the result of the command

evalf(sin(2)+exp(1));

is 3.6275792552847269307563073372644073404595020651479

whereas

evalhf(sin(2)+exp(1));

is unaffected by the assignment to Digits and returns

3.62757925528472658

round(evalhf(Digits)) gives you the number of digits your computer is using when computing with hardware floats.

For my computer here the value is 15.

See ?evalhf

restart;
LK1 := [1,2,3,4,5]:
#Not knowing the values of the other constants (and since you want a numerical solution) I just set them at some simple values:

K2:=1: nbo4:=2: PH2O:=3: Ti:=4:
seq(fsolve(2*x^3+(2*K1*nbo4+3*K2*nbo4*PH2O)*x^2+3*K1*x*nbo4^2*K2*PH2O-3*K1*nbo4^2*Ti*K2*PH2O = 0, x, 0 .. 10^10),K1=LK1);

(the results in this case are: 1.772001873, 2.117366598, 2.302037223, 2.420167073, 2.503066262).

Notice that for this third order polynomial equation solve can be used to find the 3 exact solutions:

restart;

solve(2*x^3+(2*K1*nbo4+3*K2*nbo4*PH2O)*x^2+3*K1*x*nbo4^2*K2*PH2O-3*K1*nbo4^2*Ti*K2*PH2O = 0, x);

Use plotsetup.

Example:

plotsetup(bmp,plotoutput="F:/testplot.bmp",plotoptions="height=100,width=400");
plot(sin(x),x=-Pi..Pi);

I would stay away from indexed variables, unless you insist. The problem is that the simultaneous use of e.g. C and C[a] can confuse Maple quite a lot. Not to speak of D, which has a special meaning as you see:

(Did you mean the equation to be third order or second order in z?)

De*diff(Ca(z,t),z$2)-lambda*R*K-S=0;

BC:= Ca(0,t)=C, D[1](Ca)(-z0,t)=0;

product((k+a)*(k+b)/((k+c)*(k+a+b-c)), k = 1 .. infinity) assuming a > 0, b > 0, c > 0, c<a+b;

Answer: GAMMA(c+1)*GAMMA(a+b-c+1)/(GAMMA(a+1)*GAMMA(b+1))

eqs:={y= 2*x^2-5*x+ 3, y= x^3 + 4*x -3};
solve(eqs,{x,y},explicit);
evalf(%);

Numerical solution:

fsolve(eqs,{x,y});

I see no difference in Maple 12 (or 14) for the V you posted:

V:=Matrix([[0.2412702414,0.4868267037+4.770943828* 10^(-17)* I,-0.3582351644-3.597026404* 10^(-14)* I,0.8897131421,0.3035225208,0.2809455226],[0.5973344699,-1.205280722,1.019534434+1.083003890* 10^(-16) *I,0.3180937441* I,1.086504807,0.8732682510],[0.2412702414,0.4868267037+4.770943828 *10^(-17)* I,-1.684358576,-0.05461705659,0.3035225208,1.541076357],[513.8528507 *I,-1036.834415 *I,902.2703878 *I,1198.784852,265.8824916 *I,22.70515338 *I],[5282.465108 *I,10658.77442 *I,-9122.190610 *I,240.7412056 *I,-1264.792778 *I,-1175.059018 *I],[3753.443600 *I,-7573.567988 *I,25898.97068 *I,-9.080952395,-972.5394523 *I,-4271.851836 *I]]);
LinearAlgebra:-Determinant(V,method=float);
LinearAlgebra:-Determinant(V,method=minor);
LinearAlgebra:-Determinant(V);

In Maple 12 the answer is 1.541660422*10^11+1.601362493*10^11*I for the float version (and for the version where Maple decides  itself). For the minor version the answer is 1.541660423*10^11+1.601362493*10^11*I.

So except for some slight roundoff effect there is no difference.

Unless you have a reason to ask for a particular method, I would let Maple decide (as in the last version).

To check signs I looked at the possibility of a stationary solution:

bc:={D(Temp)(0)=sigma*(Temp(0)^4-T1^4)/K, D(Temp)(d)=-sigma*(Temp(d)^4-T2^4)/K};
ode:=K*diff(Temp(z),z,z)=0;
res:=dsolve({ode} union bc,numeric);
plots:-odeplot(res,[z,Temp(z)],0..1);

I guess that the plot is what you expected. I don't know what is going on in the solution of the pde.

But are your boundary conditions correct, physically?

Don't use with( package) in a procedure (compv). Use long names (package:-proc, or package[proc]), or the statement

uses package;

There is a colon in NeighborsV that is rather strange:

`union(`union`({Neighbors(G, u)[]}, {Neighbors(G, v)[]}):, {u,v})

(and why not only one `union`?)

You may try this homemade procedure, RemoveAllAssumptions:

restart;
RemoveAllAssumptions:=proc() local A,Ls,L,Lc,indx;
Ls:=map(convert,[anames('user')],string);
L:=ListTools:-Enumerate([anames('user')]);
Lc:=select(hastype,eval(L),`local`);
if Lc=[] then NULL
else
   indx:=map2(op,1,Lc);
   A:=[seq(Ls[i],i=indx)];
   unassign(op(map(parse,A)));
end if
end proc:

assume(a>0,b::real,c::posint);
about(a,b,c);
d:=87: e:=2+3*I: f:=x^2:

RemoveAllAssumptions();
about(a,b,c);
d,e,f;

However, I almost never use 'assume'. I use 'assuming' instead.

It seems that your problem is that you assign the plot to a variable p1. Nothing wrong with that, and often a good idea.

But then the plot is not shown, but the result of the assignment is, i.e. p1:=PLOT(...).

PLOT(...) contains the data for the plot, try e.g. lprint(p1);

Just mentioning p1, like p1; will print the plot. Alone or with other plots p2, p3, .. you can use display(p1,p2, ..); (from the plots-package).

The same happens here:

p1:=plot(sin(x),x=0..2*Pi);
p1;

@hirnyk

Since sqrt(z1)*sqrt(z2)/sqrt(z1*z2) is not necessarily equal to one (take z1 = z2 = -1) it is good to be cautious.

Maple is in this case (when as hirnyk points out 'symbolic' is not used).

So assumptions help as also hirnyk points out:

a:= (2*x-1)/sqrt(1-4*x^2); b:=sqrt(1-2*x)/sqrt(1+2*x);
combine(a/b,radical) assuming x>1/2;
combine(a/b,radical) assuming x<-1/2;
simplify(%);
combine(a/b,radical) assuming x>-1/2,x<1/2;
simplify(%);

Now even when x is complex the result is -1, but that is not obvious (or is it?).

What you need is some understanding of chemistry, I guess.

Why do you expect to find it here?

First 143 144 145 146 147 148 149 Last Page 145 of 158