mapleus

25 Reputation

4 Badges

10 years, 227 days

MaplePrimes Activity


These are questions asked by mapleus

Hello, dear experts.
I have a question...
solve the system of differential equations,where one of the initial conditions need to be chosen so thatcondition is metat the end of integration.
The task is not difficult, but I'm having trouble with the syntax.

1.I can't "pull"the desired function from the solution and find its value at a certain point.
I try to do so:
r_ravn:=s->subs(F,r(s));
evalf(r_ravn(s_end));
evalf(r_ravn(0));
but there is no result

2.In this case,instead of"for"it is better to use a while loop, but again the problem arises 1.
Tell me, please,how to implemen my program.

 

restart:
R:=0.3:
theta_min:=Pi/6:
theta_max:=Pi/2:
betta_max:=evalf(Pi/180*80);
p:=2*10^5:

theta0:=s->Pi/3/s_end*s+Pi/6:
r0:=s->R*sin(theta0(s)):
s_end:=evalf(R*(theta_max-theta_min)):

sol1:=solve({sin(betta_max)=c/r0(0)},{c});
const1:=0.1477211630;

betta0:=s->arcsin(const1/r0(s)):
betta:=s->arcsin(r(s)/r0(s)*sin(betta0(s))):
A:=s->cos(betta(s))/cos(betta0(s)):
T1:=s->rT1(s)/r(s):
T2:=s->T1(s)*tan(betta(s))^2:

step:=0.001:
delta:=0.001:
for i from 1 to 3000 do
r_min:=0.3-step:
rT1_n:=p*Pi*r_min^2/2/Pi/sin(theta_min):

sys := diff(rT1(s), s)-A(s)*T2(s)*cos(theta(s)),diff(theta(s), s)-A(s)/T1(s)*(p-T2(s)*sin(theta(s)/r(s))),diff(r(s),s)-A(s)*cos(theta(s)),diff(z(s),s)-A(s)*sin(theta(s));
fcns := {rT1(s),theta(s),r(s), z(s)};
F := dsolve({sys,rT1(0)=rT1_n, theta(0)=theta_min,r(0) = r_min, z(0) = 0}, fcns, numeric,output=listprocedure):
r_ravn:=s->subs(F,r(s)):
if abs(evalf(r_ravn(s_end))-R)=delta then break:
print(r_min):
end if:
end do:

r_ravn:=s->subs(F,r(s));
evalf(r_ravn(s_end));
evalf(r_ravn(0));
plot([r_ravn(s),r(s)],s=0..s_end);

Hi all
how can I solve an equation? Pleas, help!

I have a differential equation with one unknown.
I first solve the differential equation, and then use the boundary condition to find his unknown, however, get the error:
Error, (in sol_2) parameter 'X' must be assigned a numeric value before obtaining a solution.

How can I find X?

 F:=1:
 l:=1:
 a:=0.1:
 n:=4.5:

 B:=1.47*10^(-11):
 J_nc:=evalf(2*a*int(y^(1/n+1),y=0..a/2)):
 M_f:=z->piecewise(`and`(z>=0,z<=l),F*l,`and`(z>l,z<=2*l),F*l-F*(z-l),`and`(z>2*l,z<=3*l),F*l-F*(z-l)+F*(z-2*l));
 M_ed:=z->z-3*l:
 M_x:=z->M_f(z)+X*M_ed(z);
 eq := diff(V(z), `$`(z, 2)) = B*(abs(M_x(z))/J_nc)^n*signum:cond := V(0) = 0, (D(V))(0) = 0;
 sol_2 := dsolve({cond, eq}, numeric);
 sol_3:=solve({sol_2(3*l)=0},{X});



 

Hello!
Please help solve this equation!

restart;

Dd:=4.9*10^(-10):
n:=4.5:
m:=3.5:
ny:=20:
B:=1.47*10^(-11):
H1:=70:
H2:=20:
H:=100:
b1:=40:
b2:=80:
delt_y:=H/ny:
A_max:=b1*H1+b2*H2+10*b1:
M:=1000:




b:=y->piecewise(`and`(y>=0,y<=H1),b1,`and`(y>H1,y<H1+H2),b2,`and`(y>=H1+H2,y<=H),b1):
y:=0: eq:=0:

for j from 1 to ny do
y:=(j-1)*delt_y+delt_y/2;

eq:=evalf(eq+b(y)*sign(y-y0)*abs((y-y0))^(1/n)*delt_y);
end do;


#eq=0, y0-?
sol1:=fsolve({eq=0},{y0});

Hi all!

 

I do a small calculation and get a system of 6
nonlinear equations.
And "n" is the degree of the equation is float.

Here are the calculations that lead to the system.

 

restart;
 with(DirectSearch):
 B:=1: 
 q:=1: 
 l:=1: 
 n:=4.7:
 V:=0.05:
 N:=1200:
 
 
 kappa:=Vector(N+1,[]):
 theta:=Vector(N+1,[]):
 u:=Vector(N,[]):
 M:=Vector(N,[]):
 Z:=Vector(N,[]):
 
 M_F:=q*(6*l*(z-l)-z^2/2):
 M_1:=piecewise((z<l), l-z, 0):
 M_2:=piecewise((z<2*l), 2*l-z, 0):
 M_3:=piecewise((z<3*l), 3*l-z, 0):
 M_4:=piecewise((z<4*l), 4*l-z, 0):
 M_5:=piecewise((z<5*l), 5*l-z, 0):
 M_6:=6*l-z:
 M_finish:=(X_1,X_2,X_3,X_4,X_5,X_6,z)->M_1*X_1+M_2*X_2+M_3*X_3+M_4*X_4+M_5*X_5+M_6*X_6+M_F:
 
 
 kappa_old:=0:
 theta_old:=0:
 u_old:=0:
 M_old:=0:
 
 
 step:=6*l/N:
 u[1]:=0:
 kappa[1]:=0:
 theta[1]:=0:
 
 
 
 
 for i from 2 to N do
 
 z:=i*step:
 kappa_new:=kappa_old+B/V*(M_finish(X_1,X_2,X_3,X_4,X_5,X_6,z))^n*step:
 
 theta_new:=theta_old+1/2*(kappa_old+kappa_new)*step:
 
 u_new:=u_old+1/2*(theta_old+theta_new)*step:
 
 Z[i]:=z:
 kappa[i]:=kappa_new:
 theta[i]:=theta_new:
 u[i]:=u_new:
 kappa_old:=kappa_new:
 theta_old:=theta_new:
 u_old:=u_new:
 
 end do:
 
 So,my system:


 u[N/6]=0;
 u[N/3]=0;
 u[N/2]=0;
 u[2*N/3]=0;
 u[5*N/6]=0;
 u[N]=0;

 

I want to ask advice on how to solve the system.
I wanted to use Newton's method, but I don't know the initial values X_1..X_6.

Tried to set the values X_1..X_6 and to minimize the functional
Fl:=(X_1,X_2,X_3,X_4,X_5,X_6)->(u[N/6])^2+(u[N/3])^2+(u[N/2])^2+(u[2*N/3])^2+(u[5*N/6])^2+(u[N])^2:

with the help with(DirectSearch):
GlobalOptima(Fl);
But I don't know what to do next

Please, advise me how to solve the system! I would be grateful for examples!

 

 
Hello
Please help solve this system

restart; 
B:=1: 
q:=1*10^3: 
l:=1: 
n:=4.7: 
M_F:=z->2*q*l*(z-l)-q*z^2/2: 
M_1:=z->piecewise((z<l), 2*q*l*(z-l)+l-z-q*z^2/2, (z>l), 2*q*l*(z-l)+l-q*z^2/2-l): 
M_2:=z->2*q*l*(z-l)+2*l-z-q*z^2/2: 
one_int:=z->int(B*(M_F(z)+X_1*M_1(z)+X_2*M_2(z))^n*M_1(z),z=0..2*l); 
two_int:=z->int(B*(M_F(z)+X_1*M_1(z)+X_2*M_2(z))^n*M_2(z),z=0..2*l);
value(one_int(z)); 
value(two_int(z)); 
eqs1:={value(one_int(z))=0,value(two_int(z))=0}; 
fsolve(eqs1);

 

Page 1 of 1