Items tagged with dsolve dsolve Tagged Items Feed

I'm calculating the geodesics to a parametrized system in R3. When trying to solve the geodesic equations for a surface of revolution, I'm getting a strange error. The goal is to write the code for any parametrized surface, not just revolution (hence I didn't use the short cut for surfaces of revolution).

For the code, I find the first fundamental for, then the geodesics, then turn the christoffel symbols into a time-variant array. (Gamma for the position of (u,v) in the uv-plane, and C as the array so I can take derivatives with respect to time.)

The code for creating the Christoffel Symbols and the parametrization of the paraboloid:

restart; with(LinearAlgebra):
V := (u, v) -> <v*cos(u), v*sin(u), v^2+1>;

Christoff := proc (X)
local x1, x2, M, N, i, j, k, s, E, F, G, g, Q, Delta, Prelim, cyclicPrelim;
global Gamma, C; #GAMMA
x1 := (u, v) -> <diff(X[1], u), diff(X[2], u), diff(X[3], u)>;
x2 := (u, v)-> <(diff(X[1], v), diff(X[2], v), diff(X[3], v))>;
E :=  (u, v) -> DotProduct(x1(u, v), x1(u, v), conjugate = false);
F := (u, v) -> DotProduct(x1(u, v), x2(u, v), conjugate = false);
G := (u, v) -> DotProduct(x2(u, v), x2(u, v), conjugate = false);
simplify([E(u, v), F(u, v), G(u, v)]);
M := (u, v) -> <E(u, v), F(u, v); F(u, v), G(u, v)>;
simplify(M(u,v));
printlevel := 3;
Delta := simplify(Determinant(M(u, v)));
N := (1/Delta)*<G(u, v), -F(u, v); -F(u, v), E(u, v)>;
Q[1] := simplify(map(diff, M(u, v), u));
Q[2] := simplify(map(diff, M(u, v), v));
for i to 2 do for j to 2 do for k to 2 do
Prelim[i, j, k] := Q[k][i, j];
simplify(Prelim[i, j, k] ); end do end do end do;
#(OPTIONAL PRINTOUT) print(Prelim);
for i to 2 do for j to 2 do for k to 2 do
cyclicPrelim[i, j, k] := Prelim[i, j, k]+Prelim[j, k, i]-Prelim[k, i, j] ;
end do end do end do;
#(OPTIONAL PRINTOUT)  print(cyclicPrelim);
for i to 2 do for j to 2 do for k to 2 do
Gamma[i, j, k] := simplify((1/2)*add(N[i, s]*cyclicPrelim[j, s, k], s = 1 .. 2));
end do end do end do;
# for k from 1 to 2 do
#print(`GAMMA[i,j,k] =` Matrix([[ `%a` , `%a` ],[ `%a` , `%a` ]])` \n`, Gamma[1,1,k], [Gamma[1,2,k], Gamma[2,1,k], Gamma[2,2,k]);
# end do;
#printf('GAMMA[%a,%a,%a] = %a \n', i,j,k, Gamma[i,j,k]);

print([Gamma[1,1,1], Gamma[1,2,1], Gamma[2,1,1], Gamma[2,2,1], Gamma[1,1,2], Gamma[1,2,2], Gamma[2,1,2], Gamma[2,2,2]]);

for i from 1 to 2 do
for j from 1 to 2 do
for k from 1 to 2 do
C[i,j,k]:= apply(Gamma[i,j,k],t);
end do end do end do;
C:=Array(1..2,1..2,1..2,[ [ [ apply(Gamma[1,1,1],t), apply(Gamma[1,2,1],t) ], [ apply(Gamma[1,1,2],t), apply(Gamma[1,2,2],t) ] ], [ [ apply(Gamma[2,1,1],t), apply(Gamma[2,2,1],t) ],  [ apply(Gamma[2,1,2],t), apply(Gamma[2,2,2],t) ] ] ]);
print(C);

end proc;

 

The differential equation solver:

inits:=[u(0)=1, D(u(t))(0)=1,v(0) = 1, D(v(t))(0)=1];

sys1:= [D[1$2](u(t))+C[1,1,1]*(D(u(t)))^(2)+2*C[1,1,2]*(D(u(t)))*(D(v(t)))+C[1,2,2]*(D(v(t)))^2=0, D[1$2](v(t))+C[2,1,1]*(D(u(t)))^(2)+2*C[2,1,2]*(D(u(t))*D(v(t)))^(2)+C[2,2,2]*(D(v(t)))^2=0];

L:=dsolve({sys1} union {inits});

 

The error message that comes up is:

"Error, (in unknown) invalid input: op expects 1 or 2 arguments, but received 0"

 

 

Any help would be greatly appreciated.

restart:assume(M>0);

Eq1 := diff(psi(y), y, y, y, y)-M*(diff(psi(y), y, y))-Gr*b*y = 0;

bcs1:=psi(0)=0,(D@@2)(psi)(0)=0,psi(h)=-F/2,D(psi)(h)=A;

res1:=(dsolve(Eq1));

res2:=(dsolve({Eq1,bcs1},psi(y)));

match(rhs(res2)=rhs(res1),y,s);

s:

C3:=eval(_C3, s);

I am unable to find the constants. Anyway around this?

Hi,

What is the reason/Why: 

 

Error, (in dsolve/numeric/bvp) unable to achieve requested accuracy of 0.1e-5 with maximum 128 point mesh (was able to get 0.66e-1), consider increasing `maxmesh` or using larger `abserr`

Thanks for the help :)

restart:

ODE:=diff((-diff(u(y),y))^n,y)=A;

bcs:=D(u)(0)=0,u(h)=0;

dsolve({ODE,bcs});

             u(y) = 0

 

AOA... I want to solve the following system in maple pl help

 

sys_ode := diff(y(eta), eta, eta, eta)+3*y(eta)*(diff(y(eta), eta, eta))-2*(diff(y(eta), eta))^2+x(eta) = 0, diff(x(eta), eta, eta)+3*Pr*y(eta)*(diff(x(eta), eta)) = 0

ics := y(0) = 0, (D(y))(0) = 0, (D(y))(infinity) = 0, x(0) = 1, x(infinity) = 0

Help.mw

maple satellite motion...

March 21 2014 isozv 5

Hi

I use Maple perhaps only one time per year and thus i'm a beginner with the product (even if i use it since 1996). I'm trying to make the following script work in Maple 17:

http://www.maplesoft.com/applications/view.aspx?SID=4268&ref=Feed&L=F

but i fail.... Some help will be appreciate

restart:

Eq1:=1/r*diff(r*diff(w(r),r),r)-(cos(z1))^2*(w(r)+1)-DP;

dsolve({Eq1});

bcs:=D(w)(0)=0,w(r2)=A1;

dsolve({Eq1,bcs},w(r)):

where z1, Dp, r2, A1 are constants.

 

 

Hi.

Please help to use dsolve.

Suppose I have a Matrix A of size two. Y=[u,v].

Y'(t)=A*y(t).

How can use dsolve this problem.

Thanks

 

 

 

 

b := 1;

h := 1;

A := b*h;

E := 210*10^9;

qr := 100;

Dp := (1/12)*E*b*h^3;

R := 20;

teta := 3;

sys1 := {(E.A+Dp/R^2)*(diff(u(t), `$`(t, 2))) = -E*A*(diff(w(t), t))/R+Dp*(diff(w(t), `$`(t, 3)))/R, -Dp*(diff(w(t), `$`(t, 4))) = E*A*(diff(u(t), t))/R-Dp*(diff(u(t), `$`(t, 3)))/R+E*A/R-100};

dsolve(sys1);

#THİS GAVE ME THE RESULTS LİKE THAT:

{u(t) = (1/4801)*_C3*(-1+sqrt(4801))^(3/2)*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801)*_C4*(-1+sqrt(4801))^(3/2)*exp((1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801*I)*_C5*(1+sqrt(4801))^(3/2)*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)-(1/4801)*_C6*(-1+sqrt(4801))^(3/2)*exp((1/20)*sqrt(-1+sqrt(4801))*t)+(1/4801)*_C3*sqrt(-1+sqrt(4801))*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801)*_C4*sqrt(-1+sqrt(4801))*exp((1/20)*sqrt(-1+sqrt(4801))*t)+(1/4801*I)*_C5*sqrt(1+sqrt(4801))*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)-(1/4801)*_C6*sqrt(-1+sqrt(4801))*exp((1/20)*sqrt(-1+sqrt(4801))*t)-(104999999/105000000)*t+_C1, w(t) = _C2+_C3*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)+_C4*exp((1/20)*sqrt(-1+sqrt(4801))*t)+_C5*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)+_C6*exp((1/20)*sqrt(-1+sqrt(4801))*t)}

#SO THERE ARE 6 UNKOWN(C1...C6) SO I NEED 6 CONDITION. MY BOUNDRY CONDITIONS:

bs := u(0) = 0, (D(u))(0) = 0, w(0) = 0, (D(w))(0) = 0, w(teta) = 0, (D(w))(teta) = 0;

> r := dsolve({bs, sys1});
%;
Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them, received: {{-17500000000*(diff(diff(diff(diff(w(t), t), t), t), t)) = 10500000000*(diff(u(t), t))-875000000*(diff(diff(diff(u(t), t), t), t))+10499999900, 210043750000*(diff(diff(u(t), t), t)) = -10500000000*(diff(w(t), t))+875000000*(diff(diff(diff(w(t), t), t), t))}}
>

I tried to change the equations row. But ı dont understand where something wrong.I tried so many times. May u please find where ıt is wrong? 

 

restart:

Eq1:=diff(psi(y),y$4)-diff(psi(y),y$2)=0;

dsolve({Eq1});

bcs:=psi(h1)=F,D(psi)(h1)=-1,psi(h2)=-F,D(psi)(h2)=-1;

dsolve({Eq1,bcs});

Error, (in dsolve) found differentiated functions with same name but depending on different arguments in the given DE system: [{psi(h1), psi(h2), psi(y)}, {psi(h2), psi(y)}]

Any suggestion?

Cheers!

 

Dear collegues

I wrote the following code

 


restart:
Digits := 15;
a[k]:=0;
b[k]:=7.47;
a[mu]:=39.11;
b[mu]:=533.9;
mu[bf]:=9.93/10000;
k[bf]:=0.597;
ro[p]:=3880 ;
ro[bf]:= 998.2;
c[p]:= 773;
c[bf]:= 4182;
#mu[bf]:=1;
Gr[phi]:=0; Gr[T]:=0;
#dp:=0.1;
Ree:=1;
Pr:=1;
Nbt:=cc*NBTT+(1-cc^2)*6;

#######################
slip:=0.1;         ####
NBTT:=2;           ####
lambda:=0.1;       ####
phi_avg:=0.02;    ####
#######################


eq1:=diff( (1+a[mu]*phi(eta)+b[mu]*phi(eta)^2)*diff(u(eta),eta),eta)+dp/mu[bf]+Gr[T]*T(eta)-Gr[phi]*phi(eta);
eq2:=diff((1+a[k]*phi(eta)+b[k]*phi(eta)^2)*diff(T(eta),eta),eta)+lambda*T(eta)/k[bf];
eq3:=diff(phi(eta),eta)+1/Nbt*diff(T(eta),eta);
Q:=proc(pp2,fi0) local res,F0,F1,F2,a,INT0,INT10;
global Q1,Q2;
print(pp2,fi0);
if not type([pp2,fi0],list(numeric)) then return 'procname(_passed)' end if:
res := dsolve({subs(dp=pp2,eq1)=0,eq2=0,eq3=0,u(0)=slip*D(u)(0),u(1)=-slip*D(u)(1),D(T)(0)=0,D(T)(1)=1,phi(0)=fi0}, numeric,output=listprocedure,continuation=cc);
F0,F1,F2:=op(subs(res,[u(eta),phi(eta),T(eta)])):
INT0:=evalf(Int(F0(eta),eta=0..1));
INT10:=evalf(Int(F0(eta)*F1(eta),eta=0..1));
a[1]:=evalf(Int(F0(eta),eta=0..1))-Ree*Pr;;
a[2]:=INT10/INT0-phi_avg;
Q1(_passed):=a[1];
Q2(_passed):=a[2];
if type(procname,indexed) then a[op(procname)] else a[1],a[2] end if
end proc;
Q1:=proc(pp2,fi0) Q[1](_passed) end proc;
Q2:=proc(pp2,fi0) Q[2](_passed) end proc;
Optimization:-LSSolve([Q1,Q2],initialpoint=[0.3,0.0007]);




se:=%[2];
res2 := dsolve({subs(dp=se[1],eq1)=0,eq2=0,eq3=0,u(0)=slip*D(u)(0),u(1)=-slip*D(u)(1),D(T)(0)=0,D(T)(1)=1,phi(0)=se[2]}, numeric,output=listprocedure,continuation=cc);
G0,G1,G2:=op(subs(res2,[u(eta),phi(eta),T(eta)])):
TTb:=evalf(Int(G0(eta)*G2(eta)*(G1(eta)*ro[p]*c[p]+(1-G1(eta))*ro[bf]*c[bf] ),eta=0..1))/evalf(Int(G0(eta)*(G1(eta)*ro[p]*c[p]+(1-G1(eta))*ro[bf]*c[bf] ),eta=0..1));
with(plots):
odeplot(res2,[[eta,phi(eta)/phi_avg]],0..1);
odeplot(res2,[[eta,T(eta)/TTb]],0..1);
odeplot(res2,[[eta,u(eta)/(Ree*Pr)]],0..1);

res2(1);
Nuu:=(1/TTb);
1/((1+a[k]*G1(1)+b[k]*G1(1)^2)/(1+a[k]*phi_avg+b[k]*phi_avg^2));
(1/TTb)*(((1+a[k]*G1(1)+b[k]*G1(1)^2)/(1+a[k]*phi_avg+b[k]*phi_avg^2)));
>

I want to run the code for the value of NBTT in the range of 0.2 to 10. this code gave the results in the range of 4-10 easily. So, I used the continuation which improve the range of the results between 2-10. However, I coudnt gave the results when 0.2<NBTT<2. Would you please help me in this situation.

Also, It is to be said that the values of phi should be positive. in some ranges, I can see that phi(1) is negative. Can I place a condition in which the values phi restricted to be positive.

Thanks for your attentions in advance

Amir

Hi,

I wrote the following code which is properly run

 


restart:

# parametrs

MUR:=(1-phi)^2.5:
RhoUR:=(1-phi+phi*rho[p]/rho[f]):
RhoCPR:=(1-phi+phi*rhocp[p]/rhocp[f]):
BetaUR:=(phi*rho[p]*beta[p]+(1-phi)*rho[f]*beta[f])/(RhoUR*rho[f])/beta[f]:

dqu3:=diff(h(x),x$1)-RhoUR*BetaUR*T(x);
dqu2:=5*diff(T(x),x$2)+k[f]/k[nf]*Pr*RhoCPR*f(x)*diff(T(x),x$1);
dqu1:=5/(MUR)*diff(f(x),x$3)
+ 2*(diff(h(x),x$1)*x-h(x))
+RhoUR*(3*f(x)*diff(f(x),x$2)-diff(f(x),x$1)^2);
rho[f]:=998.2: cp[f]:=4182: k[f]:=0.597:   beta[f]:= 2.066/10000:
rho[p]:=3380: cp[p]:=773: k[p]:=36:   beta[p]:= 8.4/1000000:

k[nf]:=((k[p]+2*k[f])-2*phi*(k[f]-k[p]))/((k[p]+2*k[f])+phi*(k[f]-k[p])):
rhocp[nf]:=rho[p]*cp[p]*phi+rho[f]*cp[f]*(1-phi):
rhocp[p]:=rho[p]*cp[p]:
rhocp[f]:=rho[f]*cp[f]:

phi:=0.00:
binfinitive:=6: Pr:=7: lambda:=0:


with(plots):
pppe:=dsolve( {dqu1=0,dqu2=0,dqu3=0,T(0)=1,T(binfinitive)=0,f(0)=0,D(f)(0)=lambda,D(f)(binfinitive)=0,h(binfinitive)=0}, numeric );
-pppe(0);
print(odeplot(pppe,[x,diff(f(x),x)],0..binfinitive,color=black,numpoints=400));
print(odeplot(pppe,[[x,diff(f(x),x)]],0..binfinitive,color=black,numpoints=400));
print(odeplot(pppe,[[x,T(x)]],0..binfinitive,color=black,numpoints=400));


However, in some range of parameters, I must increase the value of binfinitive (for example binfinitive=50). however, my code is doesnt converge for higher values of 10 (at most). Can anyone change this algorithm in a way that it insensitive to the value of binfinitive?

Many thanks for your attention in advance

 

Amir

restart:

Eq1:=diff(f(x),x$4)+(f(x)*diff(f(x),x$3)-diff(f(x),x$1)*diff(f(x),x$2))=0;

Eq2:=diff(f2(x),x$2)+f(x)*diff(f2(x),x$1)=0;

bcs:=f(0)=0,(D@@2)(f)(0)=0,f(1)=0,D(f)(1)=1,f2(-1)=0.5,f2(1)=1;

dsolve({Eq1,Eq2,bcs},numeric,output = listprocedure);

Error, (in dsolve/numeric/process_input) boundary conditions specified at too many points: {-1, 0, 1},

can only solve two-point boundary value problems

How to handle such problem using dsolve?

Cheers!

 

 

Hi,

I have a problem with dsolve in the following code

restart;
>
n:=20;
m:=1;
cc:=-200;
zzeta:=0.1;
sefr1:=0.3;
sefr:=0.2;
MM:=0;
lambda:=0.1;
Br:=1;
nn:=3;
>
>
#u(tau):=tau;
u(tau):=421.7129935*tau-2217.587728*tau^2+8897.376593*tau^3-27612.59182*tau^4+64248.00336*tau^5-1.083977605*10^5*tau^6-10.57029600-1.080951714*10^6*tau^13+7.999517316*10^5*tau^14-4.788741005*10^5*tau^15+2.309563748*10^5*tau^16+26511.11102*tau^18-5959.001794*tau^19+1.148523882*10^5*tau^7-95.23809524*tau^21+4.545454545*tau^22-9435.563781*tau^8-2.587683745*10^5*tau^9+6.473880128*10^5*tau^10+948.0272727*tau^20-88660.41892*tau^17-1.008692404*10^6*tau^11+1.175504242*10^6*tau^12;
>
>
B := 1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2*(1-zzeta)));
eq4 := 4*B*u(tau)-(1+zzeta)*(diff(tau*(diff(theta(tau), tau)), tau))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2;


theta(tau):=sum(p^ii*theta[ii](tau),ii=0..nn);
HH:= p*((4*(1+(2*(1-zzeta))*Br*(int(tau*(diff(u(tau), tau))^2, tau = (1/2)*zzeta*(1-zzeta) .. 1/2-(1/2)*zzeta))))*u(tau)-(1+zzeta)*(diff(theta(tau), tau)+tau*(diff(theta(tau), tau, tau)))/tau-(1+zzeta)*Br*(diff(u(tau), tau))^2)+(1-p)*(diff(theta(tau),tau$2)):
eq5:=simplify(HH):
eq6:=collect(expand(eq5),p);

eq7:=
convert(series(collect(expand(eq5), p), p, nn+1), 'polynom');


for ii to nn do
ss[ii] := (coeff(eq7, p^ii)) ;
print (ii);
end do;

ss[0]:=diff(theta[0](tau), tau, tau);

icss[0]:=theta[0](zzeta/(2*(1-zzeta)))=0, D(theta[0])(1/(2*(1-zzeta)))=1;

dsolve({ss[0], icss[0]});
theta[0](tau):= rhs(%);


for ii to nn do
ss[ii]:=evalf[5](ss[ii]);
icss[ii]:=theta[ii](zzeta/(2*(1-zzeta)))=0, D(theta[ii])(1/(2*(1-zzeta)))=0;
dsolve({ss[ii], icss[ii]});
theta[ii](tau):=rhs(%);
end do;

I would be most grateful if you help me to find this problem.

Thanks for your attention in advance

 

Say we solve numerically and ODE using Maple. Say ode1:= { diff(Q(x),x)= Q(x)/3x , Q(1)=1 }

The solution is a procedure so now suppose we have another ODE where the solution appears.Say  ode2:= { diff(f(x),x)= Q(x)*x , f(1)=4}.

To extract the solution of the first ODE I set sol1:=dsolve(ode1,numeric) and Q:=proc(x) local s: return rhs(sol(x)[2]): end proc:

But now I got an error message when I trying sol2:=dsolve(ode2,numeric).

Is it possible to use a procedure in the definition of the ODE one wants to solve?

 

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