nm

4121 Reputation

17 Badges

8 years, 64 days

MaplePrimes Activity


These are answers submitted by nm

you do not have conditions defined any where. Also you scene names was not correct. Also need to use DEtools package. Try

restart;
ode:=diff(P(t),t) = P(t)*(7-P(t))-10;
DEtools:-DEplot(ode,P(t),t=-10..10,P=-10..10,scene=[t,P],number=1, stepsize=.01);

If you have initial conditions defined then

ic := [P(0)=1];
DEtools:-DEplot(ode,P(t),t=-10..10,P=-10..10,ic,scene=[t,P],number=1, stepsize=.01);

in addition to what was said in other replies.

The issues seems that Maple could not integrate 

Using another software, this has antiderivative

Copying this result to Maple to give final solution and odetest gives zero. Here is the worksheet


 

restart;

with(MmaTranslator);
ode:=diff(Q(t),t)=-alpha*beta*t^(beta-1)*Q(t)-a*p^(-b);
sol:=dsolve(ode);

[FromMma, FromMmaNotebook, Mma, MmaToMaple]

diff(Q(t), t) = -alpha*beta*t^(beta-1)*Q(t)-a*p^(-b)

Q(t) = (Int(-a*p^(-b)*exp(t^beta*alpha), t)+_C1)*exp(-t^beta*alpha)

#the above is same as
sol := Q(t) = (( -a*p^(-b)*Int(exp(t^beta*alpha), t)) + _C1)*exp(-t^beta*alpha)

Q(t) = (-a*p^(-b)*(Int(exp(t^beta*alpha), t))+_C1)*exp(-t^beta*alpha)

int(exp(t^beta*alpha), t)

int(exp(t^beta*alpha), t)

#copied antiderivative of the above
inside_integral:=FromMma(`-((t*Gamma[beta^(-1), -(alpha*(t^beta))])/(beta*(-(alpha*(t^beta)))^(beta^(-1))))`);

-t*GAMMA(1/beta, -t^beta*alpha)/(beta*(-t^beta*alpha)^(1/beta))

#this is the final solution
sol:=subs(Int(exp(t^beta*alpha), t)=inside_integral,sol)

Q(t) = (a*p^(-b)*t*GAMMA(1/beta, -t^beta*alpha)/(beta*(-t^beta*alpha)^(1/beta))+_C1)*exp(-t^beta*alpha)

odetest(sol,ode)

0

 


 

Download dsolve_9_5_2020.mw

 

 

subexp := sin(omega*t + alpha)*sin(omega*t + phi);
subexp2:= M__a*I__a*trigsubs(subexp)[1];

The ode is seprable. i.e. it has the form y'(t)=f(t)*f(y)

So this is just an integration problem actually.  it becomes    int(1/f(y),y) = int(f(t),t)+C in your case f(y)=y^3+1 and f(t)=-(4/3)*(a/eta) which is just a constant. Inegrating the left side gives 

int(1/(y^3+1),y)

And the right side gives -(4/3)*(a/eta)*t+C. Since you asked for explicit solution, Maple has to solve this now for y

eq:=ln(y + 1)/3 - ln(y^2 - y + 1)/6 + sqrt(3)*arctan(((2*y - 1)*sqrt(3))/3)/3=-(4/3)*(a/eta)*t+_C1;
solve(eq,y) 

This has no explicit solution in y, so it used RootOf.  Mathematica can't solve this transcendental equation for y either. 

 

You can't solve the above since there is no equation. An equation must have a `=` in it and your's do not. May be this is why it did not work when you tried it?

If you can post an actuall differential equation, then I am sure Maple will be able to solve it, even if the diff was in the denominator.

For example

restart;
dsolve(y(t)/diff(y(t),t)=1)

gives

                        y(t) = _C1*exp(t)

 in the example I would expect it to return exp(x).

Did you try to enter it in Maple?

sum(x^n/n!,n=0..infinity)

And Maple returns exp(x)

 

 

 

You can either use convert, or make an alias.

 

restart;

alias(Degree=Pi/180):
sin(90*Degree);

sin(convert(90*degrees,radians))

It is better to be explicit. Otherwise, if someone looks at your code and see  sin(1). How would they know if this is in degrees or radians?   trig functions are defiined to take in radians. 

This is also how Mathematica does it:

Where Degree is build in symbol just for this purpose.

 

why can't you just write

a:=3;
plot(x, x = 0 .. a)

but if you do not want, you can try

f:=a->plot(x, x = 0 .. a);
f(3)

But if you do not want, you can try

restart;
eval('plot(x, x = 0 .. a)',a=3)

But if you do not want, you can try

restart;
simplify('plot(x, x = 0 .. a)',{a=3})

OP said

I found another solution I like:

use a=3 in plot(x, x=0..a) end use;

If you want to do the above, then you could also do

..... 

proc() 
   local a=3; 
   plot(x,x=0..a); 
end proc 
    ()
.....

The above introduces local block inside you other functions and inside is only local to that block. Same as with use but I think is better.

I learned the above from Carl answer here https://www.mapleprimes.com/questions/201123-Can-One-Declare-Local-Variables-With 

 

yht:=1; Tw:=2; t0:=0;y0:=0;
p1:=plot(DynamicSystems:-Sinc(yht,Tw,t0,y0),t=-10..10,color=red):
T:=[seq(t,t=-10..10,0.5)]:
A:=[seq(`if`(t=0,yht,y0 + yht*sin(Pi*(t - t0)/Tw)*Tw/(Pi*(t - t0))),t=-10..10,0.5)]:
p2:=DynamicSystems:-DiscretePlot(T,A,style=stem,color=blue):
plots:-display([p1,p2])

Or

restart;
yht:=1: Tw:=2: t0:=0: y0:=0:
sinc:=(yht,Tw,t0,y0,t)->`if`(t=0,yht,y0 + yht*sin(Pi*(t - t0)/Tw)*Tw/(Pi*(t - t0))):
p1:=plot(sinc(yht,Tw,t0,y0,t),t=-10..10,color=red):
T:=[seq(t,t=-10..10,0.5)]:
A:=[seq(sinc(yht,Tw,t0,y0,t),t=-10..10,0.5)]:
p2:=DynamicSystems:-DiscretePlot(T,A,style=stem):
plots:-display([p1,p2])

 They both give

 

there is none. Even this, without the sqrt, has no anti-derivative

restart;
p :=1/(ln(t)^2 + t);
int(p,t)

 

restart;
f := Statistics:-RandomVariable(Normal(1,1/2)):
plot(Statistics:-PDF(f,t),t=-3..3);

ode:=m*diff(x(t),t$2)+c*diff(x(t),t)+k*x(t)=F(t);
ic:=x(0)=1,D(x)(0)=0;
m:=1;c:=1/100;k:=10;
F:=t->Statistics:-PDF(f,t);
sol:=dsolve([ode,ic],x(t));

plot(rhs(sol),t=0..20)