Kitonum

21475 Reputation

26 Badges

17 years, 48 days

MaplePrimes Activity


These are answers submitted by Kitonum

If I understand the problem correctly, then we must sum those terms of the geometric series  seq((1-p)^(n-1)*p, n=1..infinity)  for which  sin(n)<=1/2  is true. It is unlikely that this can be done symbolically (exactly). Here numerical calculation with high accuracy:

 S:=0: p:=1/3: q:=1-p:
for n from 1 to 100 do
if evalf(sin(n))<=1/2 then S:=S+q^(n-1)*p fi;
od:
evalf(S); 
# Result
evalf(2839595/4782969);
evalf(1/3*(2/3)^100/(1-2/3)); 
# Error estimation

                                                  0.3925416398
                                                  0.5936887736                     
                                             2.459654427*10^(-18)   

You have a rather complex non-linear system with 5 parameters. Maple simply does not know how to solve such systems. If we specify the values of the parameters, then  fsolve  command easily finds a solution:

eq1 := 2*(r/a)^beta*V[0]*r^(4+Omega)-2*alpha*Omega-alpha^2+alpha*beta+2*alpha: 
eq2 := Omega*alpha+Omega*beta-k^2+Omega: 
eq3 := -2*(r/a)^beta*V[0]*r^(4+Omega)+2*Omega^2+alpha*Omega-Omega*beta-2*Omega+Y[0]*(r/a)^(beta-3*Omega)*m^2: 
eq4 := 2*(r/a)^beta*V[0]*r^(4+Omega)*Omega+4*(r/a)^beta*V[0]*r^(4+Omega)+2*k^2*Omega+k^2*alpha-k^2*beta-2*k^2+4*Y[0]*(r/a)^(beta-3*Omega)*m^2: 
Sys := {eq1, eq2, eq3, eq4}; 
Parameters := indets(Sys, name) minus {Omega, alpha, beta, k};
 
fsolve(eval({eq1, eq2, eq3, eq4}, Parameters=~{1, 2, 3, 4, 5}), {Omega, alpha, beta, k});

 

   

 Explore command allows you to explore how the roots change when individual parameters change:

Explore(fsolve({eq1, eq2, eq3, eq4}, {Omega, alpha, beta, k}), parameters=[a=0.1..3.,m=0...5., r=0...5.,V[0]=0...5.,Y[0]=0...5.] );


Edit.
 

As an alternative, here is another way to solve the problem. In addition to the spiral of triangles, PadovanSpiral  procedure also returns a spiral from segments (a fat red polyline), and the lengths of these segments are consecutive terms of Padovan series.

restart;
Pad:=rsolve({P(1)=1,P(2)=1,P(3)=1, P(k)=P(k-2)+P(k-3)}, P, 'makeproc'):
seq(Pad(i), i=1..30);   
# Example of use   

PadovanSpiral:=proc(n::posint)
local S, T, R, L, M, M1, i, P;
uses plots, plottools;
M:=<cos(2*Pi/3),-sin(2*Pi/3); sin(2*Pi/3),cos(2*Pi/3)>;
M1:=<cos(-Pi/3),-sin(-Pi/3); sin(-Pi/3),cos(-Pi/3)>;
R[1]:=[[0,0],[1/2,-sqrt(3)/2]];
for i from 1 to n do
R[i+1]:=[R[i][2],convert(Pad(i+1)/Pad(i)*(M.convert(R[i][1]-R[i][2],Vector))+convert(R[i][2],Vector),list)];
T[i]:=[R[i][],convert(M1.convert(R[i][2]-R[i][1],Vector)+convert(R[i][1],Vector),list)];
L[i]:=line(R[i][], color=red, thickness=6);
P[i]:=textplot([(`+`(T[i][])/3)[], Pad(i)], font=[times,`if`(i<=3,12,14)]);
od;
display(seq(L[i], i=1..n), seq(polygon(T[i], color=`if`(i::odd,"LightYellow", "LightBlue")), i=1..n), seq(P[i], i=1..n), scaling=constrained, axes=none, size=[800,600]);
end proc:


Example of use:

PadovanSpiral(13);  # The first two turns of Padovan spiral

           
 

Padovan.mw

Edit.

It's easy:

int((2*x+1)/(x+1), x=2..6);
subs([8=m, ln(3)=n*ln(3), -ln(7)=k*ln(7)], %);


Addition. After I sent the answer, I noticed the attached file and looked it up. The difference between your two cases is random. For example, for the case  d=0 (your second case), Maple can return a result with one logarithm, and maybe even with three logarithms (see the file below). However, under the conditions  b*d-a*c<>0, b>0, a>=0, c>=0, d>=0 , the result can always be expressed unambiguously through one logarithm:

 int((a*x+d)/(b*x+c), x=2..6) =4*a/b + ((b*d-a*c)/b^2)*ln((c+6*b)/(c+2*b))
 

Download Integral.mw

Edit.

See the corrected file Code1_new1.mws

The last line of code does not plot anything, because  g1(t)  is not defined.


Edit - the file was replaced.

In fact, your system is very simple: one equation is linear, and the second is quadratic with respect to the indicated unknowns. Therefore, all solutions are easily found by  solve  command (I took the same parameter values that in acer's solution):

restart;
local gamma:
eq1 := gamma=xx*sinh(xx)+xi*psi*cosh(xx):
eq2 := psi=-gamma^2+beta+sqrt(xx/w)*coth(sqrt(xx/w))-xx:
params:=[beta=1.0,w=2.0,xi=3.0,xx=3.0]:
solve(eval([eq1,eq2],params),{gamma,psi});

  {gamma = 0.6554134802, psi = -0.9733544660}, {gamma = -0.6885227893, psi = -1.017851267}

T:=table([(25, 1) = -39, (16, 151) = 32, (33, 1) = -54, (1, 1) = 29, (13, 1) = 32, (31, 101) = -7, (6, 51) = -10, (11, 101) = -1, (28, 151) = -39, (18, 51) = -65, (4, 151) = 29, (8, 151) = -10, (23, 101) = 23, (34, 51) = -54, (40, 151) = 87, (36, 151) = -54, (9, 1) = -1, (37, 1) = 87, (21, 1) = 23, (14, 51) = 32, (22, 51) = 23, (20, 151) = -65, (27, 101) = -39, (3, 101) = 29, (19, 101) = -65, (24, 151) = 23, (32, 151) = -7, (30, 51) = -7, (38, 51) = 87, (7, 101) = -10, (10, 51) = -1, (29, 1) = -7, (35, 101) = -54, (17, 1) = -65, (26, 51) = -39, (15, 101) = 32, (12, 151) = -1, (39, 101) = 87, (5, 1) = -10, (2, 51) = 29]);
convert(op(op(T)), set);
Matrix(40,151, %); 

 

One can prove that the first two equations for any nonnegative  u=z^(2^2011)   have the unique solution  x=y=u  (due to homogeneity, it is enough to check for  u=1) , which is clearly seen in the animation:

with(plots):
animate(implicitplot,[[x+y+x*y=u^2+2*u, x^4+y^4=2*u^4], x=-5..5,y=-5..5, color=[red,blue], axes=normal, gridrefine=5], u=0..3, frames=60, scaling=constrained);

                             


Hence it is already easy to obtain the final solution   x=1, y=1, z=1

z1:=a+I*b: z2:=c+I*d:
evalc(z1*conjugate(z2)+conjugate(z1)*z2);
evalc(2*Re(z1*conjugate(z2)));

                                                       2*a*c+2*b*d
                                                       2*a*c+2*b*d

Two variants of the plotting: in a for loop for separate plots and all together on one plot:

for i from 30 by -5 to -30 do
plot([X(alpha1,i*Pi/180), Y(alpha1,i*Pi/180), alpha1=-30*Pi/180..30*Pi/180], view=[-1..1,-1..1]);
end do; 
  # The first option

plot([seq([X(alpha1,i*Pi/180), Y(alpha1,i*Pi/180), alpha1=-30*Pi/180..30*Pi/180], i=30..-30, -5)], view=[-1..1,-1..1]);   # The second option

You must save your document and then leave a link here using the bold green arrow in editor. Henceforth, do so as not to create unnecessary problems for those who respond to you.

I managed to recover your document using OCR system. The initial non-zero approximation was found in DirectSearch package, and then  fsolve  command was used to obtain the solution with high accuracy.

interface(rtablesize=infinity):
DirectSearch:-SolveEquations([E1,E2,E3], [a1=-5..5,a2=-5..5,a3=-5..5], AllSolutions); 
# The best non-zero solution by DirectSearch

        


Digits:=20:
S1:=fsolve({E1,E2,E3}, {a1=3.53,a2=0.0075,a3=-1.312}); 
# The final result
eval([E1,E2,E3], S1);   # Check

    


For fsolve, I changed the sign of the initial  a1  and  a2, because the equations do not change when the signs change at  a1  and  a2

System_solution.mw

  

 
 

    
 



 

First, each element of  S  should be converted to a list:

Matrix(convert~(S, list));

1. Two options:

f:=proc(x) if x<=1 then 1 else 2 fi;
end proc:

add(f(i), i=1..10);  # Or
sum('f'(i), i=1..10);


2. I did not understand at all what you are trying to do in the second example. For example, what does vars mean?

Or

Re(expr) assuming real;

Since your function at different intervals is given by different formulas, then to specify such a function, use  piecewise  command. See help on this command.


Addition - the simple example:

y[0]:=x^2;
y[1]:=1;
y[2]:=3-x;
y:=piecewise(x>=0 and x<1,y[0], x>=1 and x<2,y[1], x>=2 and x<=3,y[2]);
plot(y, x=0..3, scaling=constrained); 

First 131 132 133 134 135 136 137 Last Page 133 of 290