Items tagged with solve solve Tagged Items Feed

There is million items in list, 

what is the difference between seq and for loop ?

is seq faster than for loop?

it is very slow when running code below, how to speed up this part of code?

 

https://gist.github.com/LovelyYanki/c0b61fbb9d5954b34e03#file-gistfile1-txt

HSKeyIn := Table();
for ij from 1 to 1685159 do
s := solve([mm[ij][1,1]=1,mm[ij][1,2]=1,mm[ij][1,3]=1],[a,b,c]):
if nops(s) > 0 then
if (rhs(s[1][1]) = 1 or rhs(s[1][1]) = 0) and (rhs(s[1][2]) = 1 or rhs(s[1][2]) = 0) and (rhs(s[1][3]) = 1 or rhs(s[1][3]) = 0) then
#print(lhs(indices(T3, pairs)[ij])):
#print("***"):
h := HilbertSeries([mm[ij][1,1],mm[ij][1,2],mm[ij][1,3]], {a,b,c}, z):
#print(h):
if not assigned(HSkeyIn[h]) then
if mod(ij, 100) = 0 then
print(ij):
end if:
HSkeyIn[h] := [[mm[ij][1,1],mm[ij][1,2],mm[ij][1,3]]]:
else
if mod(ij, 100) = 0 then
print(ij):
end if:
HSkeyIn[h] := [op(HSkeyIn[h]), [mm[ij][1,1],mm[ij][1,2],mm[ij][1,3]]]:
end if:

end if:
end if:
od:

why the the software can't solve the integral like ∫xdlnx?

Thanks in advance for your help.

Hello, 

      I am a student doing some self study over the summer trying to work through some of the John Taylor computer problems from his classcial mechanics book. Currently I hit a snag that most likely comes from the fact I am not well acquinted with Maple for solving IVP and DE's (we used Matlab in my DE class). I just need to know how I remove the following error:

Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

Here is a copy of my code:

R := 5;
5
g := 9.8;
9.8
deq1 := {diff(x(t), [`$`(t, 2)]) = -g*sin(x(t))/R, x(0) = 20};
/ d / d \ \
{ --- |--- x(t)| = -1.960000000 sin(x(t)), x(0) = 20 }
\ dt \ dt / /
dsol1 := dsolve(deq1, numeric);
Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

My hunch is that I need to set x'(0)=0 or something like I do not have enough intial values to solve the problem, but I could be wrong. Anyway anyone who can point out my mistake feel free to do so! Thank you!

hi.please help me for solve this integral

thanks aloterror.mw

(Phi)(x,theta,z,t):=-Phi[0].sin((m*Pi*(x-x[0]))/(L)).cos(n*theta)*cos((Pi.z)/(h)).sin(omega*t):n:=1:L:=2:m:=3:x[0]:=6:h:=1/(2);
print(`output redirected...`); # input placeholder
1
-
2
evalf(Int(diff(Phi(x, theta, z, t), theta, theta), z = -(1/2)*h .. (1/2)*h));
print(`output redirected...`); # input placeholder
/0.2500000000
| / / /3 \\
| |(Phi[0]) . |sin|- Pi (x - 6)|| . (cos(theta))
| \ \ \2 //
/-0.2500000000

\
cos(2 Pi z)| . (sin(omega t)) dz
/

 

I have the following integral equation to solve numerically:

 

v(x,t)=1 - h*\int_0^t JacobiTheta0(1/2x , \pi i s) v^4(1,t-s)ds

where h is a numerical parameter, and v(1,t) = 1-h*\int_0^t \theta_3(r)v^4(1,t-r)dr (theta3 is Jacobi theta3 function).

 

So I want to use an iteration method that will converge numerically to the solution, where v(1,0)=1.

How to use maple for this?

I want also to find the rate of convergence to the numerical solution.

 edit: I should note that v(x,0)=1, even though it's implied from v(x,t) above.

 

If there is  an equation or are several equations, I need to obtain all the roots, how can I do???

 

fsolve ? rootfindings? or what?

 

If an examples of actual is given,  That will be perfect  !!!

 

Thanks 

Hi, I have 10 equation system and 10 unknown variables. I however, want to reduce the equations to 2 with two unknowns. I'm wondering how this could be done in maple. The variables are Y, q, yd, y*, yx, H,  pd, w, P and Pv. I intend to solve the equations for Y and w. 

Thanks in advance for your help. The maple file has also been attached.

 

Regards

Small_Open_Economy.mw

 

hello everyone. I have an undergradute project i'm currently working on and I'm stuck where I have to use the Differential Transforms Method to solve a problem with boundary conditions at infinity


restart;

Digits := 5;

F[0] := 0; F[1] := 0; F[2] := (1/2)*A; T[0] := 1; T[1] := B; M := 2; S := 1;

for k from 0 to 10 do F[k+3] := (2*(sum((r+1)*F[r+1]*(k+1-r)*F[k+1-r], r = 0 .. k))-T[k]-3*(sum((k+1-r)*(k+2-r)*F[r]*F[k+2-r], r = 0 .. k))-M*(k+1)*F[k+1])*factorial(k)/factorial(k+3);

T[k+2] := (-3*(sum((k+1-r)*F[r]*T[k+1-r], r = 0 .. k))-S*T[k])*factorial(k)/factorial(k+2)

end do; f := 0; t := 0;

for k from 0 to 10 do

f := f+F[k]*x^k;

t := t+T[k]*x^k end do;

print(f);
print(t);

but the problem is that i cant seem to evaluate

or higer diagonal pade-approximant. any help will be greatly appreciated. thank you.

How can I solve this equation 18 *9^(x^2 + 2* x) + 768* 4^((x + 3)* (x - 1)) - 5 *6 ^((x + 1)^2)?

I tried

restart:

A:=18 *9^(x^2 + 2* x) + 768* 4^((x + 3)* (x - 1)) - 5 *6 ^((x + 1)^2);
solve(A=0);

I see that, the equation has three solutions: x = -2, x = -1 and x = 0. I check

f:=x->18 *9^(x^2 + 2* x) + 768* 4^((x + 3)* (x - 1)) - 5 *6 ^((x + 1)^2);

f(-2);

f(-1);

f(0);

Another question, Maple can not solve inequality 

18 *9^(x^2 + 2* x) + 768* 4^((x + 3)* (x - 1)) - 5 *6 ^((x + 1)^2) > = 0.

PS. We can easy to solve the above inequality with Mathematica

Reduce[18 9^(x^2 + 2 x ) + 768 4^((x + 3) (x - 1)) - 5 6 ^((x + 1)^2) >= 0 , x, Reals]

I got x <= -2 || x == -1 || x >= 0

 

 

hi guys ,

 

i have two set equations and i want to solve them. eq.mw

 

 

thanks guys

hi everyone,
I wanna to solve this equation using maple 12 but I receive this warning message

cos(x)*cosh(x)=1

cos(x)*cosh(x)=-1

tan(x)=tanh(x)

thanks in advance

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 .please help me for solve this nonlinear equations , that attch below

thanks a lots.....

 

 

dsys3 := {8*(diff(f2(x), x, x, x, x))+9*(diff(f2(x), x, x))+10*f2(x)+11*(diff(f1(x), x, x, x))+12*(diff(f1(x), x))+13*(diff(f3(x), x, x))+14*f3(x)+f3(x)*f3(x)+(diff(f3(x), x))*(diff(f3(x), x))+(diff(f3(x), x, x))*f3(x) = 0, 16*(diff(f3(x), x, x, x, x))+18*(diff(f3(x), x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+23*(diff(f1(x), x))+24*(diff(f2(x), x, x))+25*f2(x)+26*f2(x)+27*f3(x)+29*f3(x) = 0, 2*(diff(f1(x), x, x))+3*(diff(f2(x), x, x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x))+7*f1(x)+(diff(f3(x), x, x))*(diff(f3(x), x))+(diff(f3(x), x))*f3(x)+(diff(f3(x), x))*f3(x) = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, abserr = .1, numeric, range = 0 .. 1, output = listprocedure)12.mw

I have a set of equations icsi and a set of variables v. How do i assign each solution to the variable before solving the next equation?

I tried- for i from 1 to 3 do solvedi := solve(icsi, vi);assign(solvedi); end. This didn't work for me.

I can't solve this problem, can someone explain me whats worng and how to fix it, here is what i've done:

with(plots);
with(DEtools);
sist := diff(x1(t), t) = -4*x1(t)+x2(t), diff(x2(t), t) = -x1(t)+7*x2(t);
    d                             d                          
   --- x1(t) = -4 x1(t) + x2(t), --- x2(t) = -x1(t) + 7 x2(t)
    dt                            dt                         


condi := [x1(0) = 0, x2(0) = 3], [x1(0) = 2, x2(0) = 1], [x1(0) = 7, x2(0) = 9];
        [x1(0) = 0, x2(0) = 3], [x1(0) = 2, x2(0) = 1],

          [x1(0) = 7, x2(0) = 9]
for i to 3 do sol[i] := dsolve({sist, condi[i]}, {x1(t), x2(t)}, numeric); gra := odeplot(sol[i], [x1(t), t], t = -1 .. 1); display(gra) end do;

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