nm

3646 Reputation

17 Badges

7 years, 362 days

MaplePrimes Activity


These are answers submitted by nm

if I understand you right, one way could be to convert it to list, then use plot


A:= seq(f(i), i = 0 .. 1, 0.1);
A:=convert~([A],list);

  #A := [[0, 1], [0.1, 1.1], [0.2, 1.2], [0.3, 1.3], [0.4, 1.4], [0.5, 1.5], [0.6, 1.6], [0.7, 1.7], [0.8, 1.8], [0.9, 1.9], [1.0, 2.0]]

plot(A[1..nops(A),1],A[1..nops(A),2], style=point)

You can't plot an expression which contains unknowns in it, other than the plot variable. In your case it is L and g.

In addition, the EllipticF gives complex values for the plot range you have. So once you set a numerical value for L and g, you could then plot either the real or the complex part of the expression. Something like

L:=1; g:=9.81;
plot(4*sqrt(L/g)*Re(EllipticF(Pi/2, sin(theta0/2))), theta0 = 1 .. 20)

or

L:=1; g:=9.81;
plot(4*sqrt(L/g)*Im(EllipticF(Pi/2, sin(theta0/2))), theta0 = 1 .. 20)

or may be you want to pot the norm instead.

btw, make sure the angle range you have is meant to be radians and not degrees as sin() takes arguments in radians and not degrees. 

 

one way

restart;
A:=Matrix([[1,2,3],[4,5,6],[7,8,9]]):
add((x->x^2)~(ArrayTools:-Diagonal(A)))

 

    107

 

CAS gives generic solution for the Euler ODE. Same solution is given by Mathematica.

To get specific solutions use assumptions

restart;
ode:=x^2*diff(y(x), x, x) + 3*x*diff(y(x), x) + lambda*y(x) = 0:
dsolve(ode) assuming lambda>1;
dsolve(subs(lambda=1,ode));
dsolve(ode) assuming lambda<1;

 

Noticed that assuming lambda=1 does not work.

 

I also tried and Maple could not do it. May be there is a way. I am surprised solve could not even solve 1/x^3-sin(12*x)=0  which is the equation one gets by solving for y first from first equation. 

restart;
eq1:=x^3*y=1;
eq2:=y-sin(12*x)=0;
sol:=solve([eq1,eq2],[x,y],allsolutions=true, tryhard=true,explicit=true ,useassumptions=true) assuming x::real,12/10<x,x<2;

                           sol := []

sol:=solve(1/x^3-sin(12*x)=0,x,useassumptions=true) assuming 12/10<x,x<2;

                sol := NULL

But using fsolve does better

fsolve({eq1,eq2},{x=1.2..2,y=0..1})

            {x = 1.818677859, y = 0.1662389017}

May be using rootfinding package will help here. I have not used that before myself.

But there are other solutions: here are the solutions from Mathematica

ClearAll[x, y];
Solve[{x^3*y == 1, y - Sin[12 x] == 0, 12/10 < x, x < 2}, {x, y}] // N

{{x -> 1.2660583429042076, y -> 0.4927638522060099}, 
{x -> 1.5916799967666035, y -> 0.2479891756147953}, 
{x -> 1.8186778594104485, y -> 0.16623890165015234}}

 

another option 

 

restart;
r:=theta->cos(2*theta); 
plots:-animate(plots:-polarplot, [r(theta) , theta=0..max_angle], max_angle=0..2*Pi,frames=100)

 

it is type=numeric  and not type=numerical 

You also have singularity. (btw, strange name you picked for your dependent variable function, n? Also need to use midpoint method for the BVP

restart;

A1 := 8*Pi^3*R^2*n(x)^4*m+(2*Pi*sin((1/2)*x)*m*omega0*p+Pi*sin((1/2)*x)*m*omega0+3*Pi^2*(diff(n(x), x, x)))*n(x)^3+(-2*sin((1/2)*x)^2*m^2*omega0^2*p^2+2*cos((1/2)*x)^2*m^2*omega0^2*p^2-2*sin((1/2)*x)^2*m^2*omega0^2*p+2*cos((1/2)*x)^2*m^2*omega0^2*p)*n(x)^2+(-4*(diff(n(x), x$2))*sin((1/2)*x)^2*m^2*omega0^2*p^2-8*sin((1/2)*x)*(diff(n(x), x))*cos((1/2)*x)*m^2*omega0^2*p^2-4*(diff(n(x), x$2))*sin((1/2)*x)^2*m^2*omega0^2*p-8*sin((1/2)*x)*(diff(n(x), x))*cos((1/2)*x)*m^2*omega0^2*p)*n(x)+8*sin((1/2)*x)^2*(diff(n(x), x))^2*m^2*omega0^2*p^2+8*sin((1/2)*x)^2*(diff(n(x), x))^2*m^2*omega0^2*p;

R := 1; m := 1; p := 10; omega0 := 1000;

bc:=n(0) = n(4*Pi), (D(n))(0) = (D(n))(4*Pi);
sol:=dsolve([A1,bc], type = numeric, range = 0 .. 4*Pi,method=bvp[middefer]):

 

Error, (in dsolve/numeric/bvp) singularity encountered

Maple does not seem to like your BC. Something to look into.
 

 

 

There is something very confusing here. You say "need to find involved integration constant i.e c1 to c4. "  But you are providing boundary condition? There will not be any constants of integration in the solution., 

Also, why do you call "c1" a constant of integration, when it is part of the ODE itself? You wrote 

ode1:=diff(q(y), y$2) - A*q(y) = B*(P*y + c1);

And then you called c1 constant of integration?

In addition, your ODE's are not coupled. The first ODE can be solved on its own, and the solution plugged into the second ODE to solve that on its own. Coupled ODE's is when both dependent variable appear in both ODE's.

But you can still solve these ODE together, it does not matter to Maple

restart;
ode1:=diff(q(y), y$2) - A*q(y) = B*(P*y + c1);
bc1 := q(-sigma) = 0, q(sigma) = 0;
ode2:=(1 + N)*diff(u(y), y$2) + N*diff(q(y), y) = P;
bc2 := u(-sigma) = 1, u(sigma) = -k;
dsolve([ode1,ode2,bc1,bc2])

And since the ODE's are not coupled they can be solved one at a time:


restart
ode1:=diff(q(y), y$2) - A*q(y) = B*(P*y + c1);
bc1 := q(-sigma) = 0, q(sigma) = 0;
ode2:=(1 + N)*diff(u(y), y$2) + N*diff(q(y), y) = P;
bc2 := u(-sigma) = 1, u(sigma) = -k;
solq:=dsolve([ode1,bc1]);

ode2:=subs(solq,ode2);
solu:=dsolve([ode2,bc2])

Which gives same solutions are above

 

a:=[1,3,4,5,3,4,9,4,5,3,9,2,3,4,2,5,21,32,22,12,15,3,2,5,4];
f:=x->`if`(x="5",nprintf("#mo(%a,mathcolor=\"%A\")", x, red),nprintf("#mo(%a,mathcolor=\"%A\")", x, black));
f~(convert~(a,string))

 

I normally use subs and algsubs.

subs seems to have worked here

subs(5435 + 3*sqrt(515793)=t,s1)

and simplify on the above gives

You really should get into the habit of using symbols, then replace these with numbers at the end. If you do that, it will easier to see why it can't give explicit solution.  In addition, your code will be easier to modify and maintain.

Your ODE is linear first oder. But the integrating factor produces integral which Maple can't integrate.

restart;
ode1:=-diff(q(t), t) - A*q(t)*(B - C*(d*cos(f*t) + e*sin(f*t))^2) +h=0;
dsolve(ode1);

The integral of exp(.....) above is the problem. Try numerical dsolve instead.

To get to the essense of it, keep throwing away uneeded things, and you'll get to something that looks like 

int(exp((t -cos(t)- sin(t)+ sin(t) + t)), t)

which has no closed form solution. It is the integral of things like exp(cos(t)) which makes Maple produces the result it did, with `Int` in it, as there is no antiderivative for these. 

 

sys_ode := diff(F0(zeta), zeta, zeta)-b^2*F0(zeta)+G0(zeta)^2 = 0, diff(G0(zeta), zeta, zeta)-b^2*G0(zeta) = 0, 2*F0(zeta)+diff(H0(zeta), zeta) = 0;

ics := F0(0) = 0, G0(0) = 1, H0(0) = 0, F0(infinity) = 0, G0(infinity) = 0;

sol:= dsolve([sys_ode,ics])

 

simplify(sol) assuming positive

you can eliminate  the remove has calls by doing

map(x->ListTools:-SearchAll(x,L1),L2)

do not know if this will speed it up much or not.

Another apprach to the fine answers given already is to use: (can't write Latex in the form, so I put screen shot)

Using Maple

g:=x->cos(x);
limit(1/abs(g(x)),x=0)+limit(1/abs(g(x)),x=-Pi)+limit(1/abs(g(x)),x=Pi)

    3

 

convert~(A,string)

1 2 3 4 5 6 7 Last Page 1 of 9