Kitonum

21550 Reputation

26 Badges

17 years, 124 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

"restart;  iter:=5;  f[1](x,y):=3 x^(2)-y^(2);  f[2](x,y):=3 x^()*y^(2)-x^(3)-1;"

5

 

proc (x, y) options operator, arrow; 3*x^2-y^2 end proc

 

proc (x, y) options operator, arrow; 3*x*y^2-x^3-1 end proc

(1)

var := x, y

x, y

(2)

pointt := [x[n], y[n]]

[x[n], y[n]]

(3)

NULL

NULL

``

x[0] := 1; y[0] := 1

1

 

1

(4)

for n from 0 to iter do J[n] := Student[MultivariateCalculus][Jacobian]([f[1](x, y), f[2](x, y)], [var] = pointt, output = matrix); sol[n] := eval((Vector(2, {(1) = x[n], (2) = y[n]}))-1/J[n].(Vector(2, {(1) = f[1](x[n], y[n]), (2) = f[2](x[n], y[n])}))); A[n] := [n, x[n], y[n], f[1](x[n], y[n]), f[2](x[n], y[n]), J[n]]; x[n+1] := evalf[8](sol[n][1]); y[n+1] := evalf[8](sol[n][2]) end do

n := 'n'; f := 'f'; A[-1] := [n, x[n], y[n], f[1](x[n], y[n]), f[2](x[n], y[n]), J[n]]; convert(Array(-1 .. 5, 1 .. 6, proc (i, j) options operator, arrow; A[i][j] end proc), Matrix)

Matrix(%id = 4466988674)

(5)

 


 

Download q1nwtnnonlinearsys_new.mw

Function  procedure solves the problem. Required parameters of the procedure: F is an expression of the variable  x  or a procedure, R is a list of the end points of a segment (the domain of the function), N is the number of points (the ends of the segment  R  are included in this number so  N>=2).  Optional parameters: the equality  output=list  (by default) or   output=plot , Opts  is a list (additional options for plotting). 

Function:=proc(F::{algebraic,procedure}, R::list, N::posint, Eq::`=`:=(output=list), Opts::list:=[])
local f, a, b, h, L;
if F::algebraic then f:=x->F else f:=F fi;
a,b:=op(R); h:=(b-a)/(N-1);
L:=[seq(evalf[3]([a+i*h,eval(f(x),x=a+i*h)]), i=0..N-1)];
print(L);
if Eq=(output=plot) then 
plot([f(x), L], x=a..b, color=[red,blue], op(Opts)) fi;
end proc:

 

Example of use:

Function(x^2, [-2,2], 9, output=plot, [scaling=constrained, size=[500,500]]);

       

 

 

You can use  plots:-contourplot  command
See also this post  https://www.mapleprimes.com/posts/202222-Contour-Curves-With-Labels


Examples of use:

restart:
f(x,y):=exp(-(x^2+y^2)/3)*cos(2*x*y):
plots:-contourplot(f(x,y), x=-2.5..2.5, y=-2.5..2.5, contours=[seq(-0.4 .. 1, 0.1), 0.95] ,filledregions=true, coloring=["White","DarkViolet"], numpoints=50000); 

                              


ContoursWithLabels(f(x,y), -2.5 .. 2.5, -2.5 .. 2.5, {seq(-0.4 .. 1, 0.1), 0.95},Coloring = [colorstyle = HUE, colorscheme = ["White","DarkViolet"], style = surface]);

    

  Edit.      

I tried to open the attached file by selecting  Maple Input , but my computer freezes after that.
Try to restore your worksheet as follows:

Menu  File -> Recent Documents -> Restore Backup

plot([BesselJ(0,x), BesselJ(1,x)], x=0..10, color=[red,blue]);


See help on  ?Bessel
 

In order to insert a text into each frame for this animation method, we need to create a new sequence of frames using  plots:-display  command:

restart;
with(plots):
N := 92: 
A := [seq(plot([[.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [-.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N], [-sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N]], color = red, thickness = 5, view = [-2.3 .. 2.4, -1.4 .. 1]), i = 1 .. N)]:
 
A1:=[seq(display(textplot([[-1.9+(i-1)*1.2/N, 0,`Betty`],[1.9-(i-1)*1.2/N, 0,`Alf`]], font=[TIMES,16]), A[i]), i=1..N)]: 
 
display(A1, insequence = true, scaling = constrained, axes=none, title ="Alf & Betty", titlefont=[TIMES,18] );

                 

verify(2*log(x), log(x^2)) assuming x>0;                          
evalb(2*log(x) = log(x^2)) assuming x>0;

                                             true
                                             true

restart:
h1:=z->1-(delta2/2)*(1 + cos(2*(Pi/L1)*(z - d1 - L1))):
h2:=z->1-(delta2/2)*(1 + cos(2*(Pi/L2)*(z - d2 - L2))):
h3:=z->1+(delta2/2):
K1:=((4/h1(z)^4)-(sin(alpha)/F)-h1(z)^2+Nb*h1(z)^4):
K2:=((4/h2(z)^4)-(sin(alpha)/F)-h2(z)^2+Nb*h2(z)^4):
K3:=((4/h3(z)^4)+(cos(alpha)/F)+h3(z)^2+Nb*h3(z)^4):
lambda1:=Int(K1,z=0..0.2):
lambda2:=Int(K2,z=0.2..0.4):
lambda3:=Int(K3,z=0.4..0.6):
lambda:=lambda1+lambda2+lambda3:
 
F:=0.3:
L1:=0.2:
d1:=0.2:
d2:=0.2:
L2:=0.3:
alpha:=Pi/6:
plot( [seq(eval(lambda, Nb=j), j in [0.1,0.2,0.3])], delta2=0.02..0.1);

Try adding this condition before  od;
if  not type(prO[i], float) then break fi;

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}

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