Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Below is the output from test relation that seems contradictory.  All I did was swap the order of operation from summing an integral to taking the integral of the sum.  The summation and integration variables are independent so I would think the statement for S4 would yield a TRUE result.  Also, I got a FALSE return on a well known trig identity.

Am I missing something subtle or even obvious?

equivalence_discrepancy.mw

How do I introduce the first derivative of M when i<> k and aij when i <> j and aii in Maple?

 

 

How can i plot various 3 multiple graphs using Maple to Compare ADM, EXACT SOLUTION AND RKF45 using the table below:

 Time  ADM Solution                                   RKF45 Numerical Solution        EXACT Solution

               ADM Solution                     RKF45 Numerical Solution                EXACT Solution

 t           s               i              r                 s            i                r             s               i                   r

0.1     0.0769540597    0.1477783335     0.1393069312      0.0763361154   0.1477867626   0.1393072151   0.0763361266    0.1477867830     0.1393071934 

0.3     0.1093424148    0.1120401102     0.1509302274      0.1072278404   0.1121142033   0.1509369166   0.1072278479    0.1121142168     0.1509369024 

0.5     0.1392030568    0.0853083077     0.1558066181      0.1353291378   0.0855066806   0.1558355785   0.1353291558    0.08550671332   0.1558355439

0.7     0.1662374563    0.0652194693     0.1562235596      0.1604342222   0.0655908735   0.1562974878   0.1604342352    0.06559089617   0.1562974637 

0.9     0.1903821623    0.0500537619     0.1537887672      0.1825594352   0.0506356391   0.1539346707   0.1825594528    0.05063567192   0.1539346352

1.1     0.2117168860    0.0385555127     0.1496220815      0.2018541863   0.0393727175   0.1498707561   0.2018542024    0.03937274753   0.1498707234 

1.3     0.2303874000    0.0298096396     0.1444864012      0.2185409755   0.0308687065   0.1448804021   0.2185409880    0.03086872986   0.1448803765 

1.5     0.2465077820    0.0231661161     0.1388614678      0.2328759081   0.0244336214   0.1394893808   0.2328759200    0.02443364533   0.1394893543

 

 

 

Hello everyone.and complements

Please I am trying to obtain series expansion of the expression below in u but encounter difficulties particularly when b=0. I am very optimistic that when b=0 there will be a result not division by 0. Can I get help on the code?

Thank you in anticipation of your quick and positive responses and suggestions

# for k=2 CHEBY HYBRID WITH mu=(1-(1/2)*sqrt(2)))) AND v=(1+(1/2)*sqrt(2))))
restart:
omega:=u/h:
t:=(sum(a[j]*x^j,j=0..3)+a[4]*sin(omega*x)+a[5]*cos(omega*x)):
F:=diff(t,x):
G:=diff(t,x,x):
p1:=simplify(eval(t,x=q))=y[n]:
p2:=simplify(eval(t,x=q+(1-(1/2)*sqrt(2))*h))=y[n+mu]:
p3:=simplify(eval(t,x=q+h))=y[n+1]:
p4:=simplify(eval(t,x=q+(1+(1/2)*sqrt(2))*h))=y[n+v]:
p5:=simplify(eval(F,x=q+2*h))=f[n+2]:
p6:=simplify(eval(G,x=q+2*h))=g[n+2]:

vars:= seq(a[i],i=0..5):
Cc:=eval(<vars>, solve({p||(1..6)}, {vars})):
for i from 1 to 6 do
	a[i-1]:=Cc[i]:
end do:
Cf:=t:

K:=collect(combine(simplify(eval(Cf,x=q+2*h),size),trig),{y[n],y[n+mu],y[n+1],y[n+v],f[n+2], g[n+2]},factor):


Num := numer(K):
Den := denom(K):

N := 20:   # order of expansion
Num_N :=(convert(series(Num, u, N),polynom)):
Den_N := (convert(series(Den, u, N),polynom)):
b:=y[n+2]=(convert(series(Num_N/Den_N, u, N),polynom)):

eval(b,u=0); 

 

We have three vectors: position, velocity and accelleration

Then we calculate three unit vector of osculating plane and the center of curvature . Can you help me in creating a smart plot to show the idea

Es_1_1_2.mw

Thank's a lot and Regards

 

I am studying the sum below and am trying to write a procedure with Maple which I can use to efficiently evaluate the sum for large values of n.

sum((1/k^0.1)*sin(1/k), k=1..n)

I have read the section on procedures in my textbook for Maple but it only has very simple examples with nothing relevant to this situation and I am struggling to apply it here: can anyone assist?

 Ordinary and Partial Differential Equations..

(Driven damped simple pendulum, a nonlinear differential equation) The equation of motion of the damped simple pendulum   

driven by a harmonic force is given by

By an appropriate choice of the coefficients m, l, g, A, ω and the initial conditions. Write a

maple code to solve this equation using fourth-order Runge-Kutta method. Comment your

.results

I am considering a function y(x) which is defined implicitly such that:

y(x):= x-> ln((1+x)*y) + exp(x^(2)*y^(2))

I am attempting to show that the Taylor series about x = 0 is:

y(x) = 1 - x^2 - (1/3)x^3 + (55/24)x^4 + (4/5)x^5 - (439/80)x^6 + O(x^7)

This could be done by using Maple to take derivatives up to sixth order and then substituting into the formula for the Taylor series.  My initial idea for the Taylor series was to use the identity 

ln((1+x)*y) + exp(x^(2)*y^(2)) = x + cos(x)

but obviously the RHS does not give the required form for the Taylor series about x = 0 (although I can use it to show that y(0) = 1).  Would it be possible to use Maple to take six derivatives of the left-hand side instead and then use that to create the Taylor series as far as sixth order?

Hello

In my annuity recursion formula I have a payment at the beginning of the month.

How can I change the formula to reflect an addition made on a different day of the month?

This could be done in Excel of course, but I am looking for a single formula which rsolve supplies.

I had no joy with Finance:-growingannuity

Recurring_pmts.mw

 

I am trying to use Maple to compute the numerical solution to the Newton/Einstein orbital equations and then to plot r(phi) against phi in polar coordinates (obviously without the relativistic correction this should be a flawless ellipse).

I have seen that problems trying to solve ODEs/PDEs are fairly common with people who are new to Maple.  The problem I have is that when I define the ODE with the second derivative, it evaluates the derivative so when I try to use dsolve I get the error message that it was 'expecting' ode to be a differential equation.

ode := diff(1/r(phi), [phi$2]) + 1/r(phi)=GM/h^2;     [(where constants are defined such that GM/h^2 = 1)]
dr :=diff(r(phi),phi);

ics := r(0)=2/3, dr(0)=0;

dsolve([sys,ics]);

Also, I am not sure how to define one of the conditions when it is a derivative such that it can be included with sys, although I hade made an attempt.  The other examples I have seen just have functions defined at a particular value, rather than a derivative of the function.  When I try to use dsolve (regardless of the other problem), I get the message 'Error, (in dsolve) not a system with respect to the unknowns {r(0), (diff(r(phi), phi))(0)}'.  Once I have the solution I would like to plot r(phi) against phi for 0 < phi < 2pi to observe the full orbit and then do the same for 0 < phi < 10pi once I have repeated the numerical solution for the orbital equation with relativistic correction so that I can observe that the precession of the perihelion between each revolution is approximately constant. 

I am also not sure how to find the angular positions of the four perihelia after the first revolution, is there a command that will enable me to determine the distance from the origin of the orbit to the closest point on the orbital path for all of the revolutions over the range 0 < phi < 10pi, as I will then be able to make a comparison with each one to check that the precession is approximately constant.

First, is patmatch command is the main Maple command for doing pattern matching on expressions?  

I trying to understand how it works, but failing on the most basic expressions. 2 basic questions

1)patmatch( x^n/y^n,  x∷symbol^n::symbol /  y::symbol^n::symbol);
                               false

It did not like that I told it x::symbol in the above. Why? But when I remove ::symbol it works

patmatch(x^n/y^n,x^n::symbol/y^n::symbol);
                   true

But when I do "whattype(x);" Maple replies saying it is "symbol"

2)Trying to match x^2/y^2, not having any luck
patmatch(x^2/y^2,x^n::nonunit(integer)/y^n::nonunit(integer));
                        false

patmatch(x^2/y^2,x^n::integer/y^n::integer);
                         false

How to match x^2/y^2? Why the above fail? 

I learn better by examples. Is there a place where one can look at many examples using patmatch? 

The help page have only few examples, and the link to the page called "examples,patmatch" does not help either with few examples and many are the same as the other page.  I tried to run it using 

infolevel[all]:=5:
printlevel:=10:

To see if I can figure what is wrong, but did not understand any of the code printed.

Compare this to Mathematica, where pattern matching there has hundreds of examples and detailed tutorials just on this one subject.

 



   


 

I have a function of the form:

y:= x-> ((1 + ax + bx^2)/(1 + cx + dx^2))*(ln(sinh(x)^2 + cosh(x)^2)

I would like to know how I could use Maple to calculate the values that the constants a,b,c and d should take such that the expansion of the above function does not include powers of the order x^3, x^4, x^5 or x^6 ie. such that the powers are quadratic at most.

The trigonometric terms just to clarify are the square terms ie. sinh(x) * sinh(x), but that is how I have written them before with Maple.  Not sure if I have written it out correctly, but it is a fraction with the constants multiplying the natural log function whose argument is the sum of the squares of the hyperbolic trigonometric functions.

How do I access and plot the values from indexed tables QQ vs  PP? 
 


 

``

with(LinearAlgebra)

``

Xd := 1.6Xq := 1.55; Xpd := .32; Xe := .4; re := 0; Xe := .4; et := 1.0

M := 3; Tdo := 6.0; Ke := 5; Te := 0.5e-1

Q := -2.7; k := 0.2e-1; m := 1; FORW := 1; P := k

``

``

while `or`(P < 1.0 and FORW = 1, `and`(k > 0.1e-1, FORW = 0)) do PP[m] := k; P := PP[m]; if FORW = 1 then Q := -2.7 else Q := 3 end if; Test := 0; while `or`(Test = 0 and Q < 3 and FORW = 1, `and`(`and`(Test = 0, k > 0.1e-1), FORW = 0)) do if FORW = 1 then Q := Q+0.1e-1 else Q := Q-0.1e-1 end if; eto := abs(et); Ipo := P/eto; Iqo := Q/eto; Eqo := sqrt((Iqo*Xq+eto)^2+(Ipo*Xq)^2); Eo := sqrt((-Ipo*re-Iqo*Xe+eto)^2+(Ipo*Xe-Iqo*re)^2); `sin&delta;o` := (eto*Ipo*(Xq+Xe)-re*Xq*(Ipo^2+Iqo^2)-eto*Iqo*re)/(Eqo*Eo); `cos&delta;o` := (eto*(eto+Iqo*(Xq+Xe)-Ipo*re)-Xe*Xq*(Ipo^2+Iqo^2))/(Eqo*Eo); iqo := (Ipo*(Iqo*Xq+eto)-Iqo*Ipo*Xq)/Eqo; ido := (Ipo^2*Xq+Iqo*(Iqo*Xq+eto))/Eqo; eqo := eto*(Iqo*Xq+eto)/Eqo; edo := iqo*Xq; A := re^2+(Xe+Xpd)*(Xq+Xe); K1 := Eqo*Eo*(re*`sin&delta;o`+(Xe+Xpd)*`cos&delta;o`)/A+iqo*Eo*((Xq+Xpd)*(Xq+Xe)*`sin&delta;o`-re*(Xq-Xpd)*`cos&delta;o`)/A; K2 := re*Eqo/A+iqo*(1+(Xq+Xe)*(Xq-Xpd)/A); K3 := 1/(1+(Xq+Xe)*(Xd-Xpd)/A); K4 := Eo*(Xd-Xpd)*(Xq+Xe)*`sin&delta;o`/A-re*`cos&delta;o`; K5 := edo*Xq*(re*Eo*`sin&delta;o`+(Xe+Xpd)*Eo*`cos&delta;o`)/(eto*A)+eqo*Xpd*(re*Eo*`cos&delta;o`-(Xq+Xe)*Eo*`sin&delta;o`)/(eto*A); K6 := eqo*(1-Xpd*(Xq+Xe)/A)/eto+edo*Xq*re/(eto*A); A3 := Matrix(4, 4, {(1, 1) = 0, (1, 2) = 377, (1, 3) = 0, (1, 4) = 0, (2, 1) = -K1/M, (2, 2) = 0, (2, 3) = -K2/M, (2, 4) = 0, (3, 1) = -K4/Tdo, (3, 2) = 0, (3, 3) = -1/(K3*Tdo), (3, 4) = 1/Tdo, (4, 1) = -Ke*K5/Te, (4, 2) = 0, (4, 3) = -Ke*K6/Te, (4, 4) = -1/Te}); Eig := Eigenvalues(A3); if `and`(`and`(`and`(Re(Eig[1]) < 0, Re(Eig[2]) < 0), Re(Eig[3]) < 0), Re(Eig[4]) < 0) then Test := 1 else Test := 0 end if end do; if `and`(FORW = 1, Q > 2.8) then m := m-2; k := k-0.2e-1 else QQ[m] := Q end if; m := m+1; if FORW = 1 then k := k+.1 else k := k-.1 end if end do
``

`` 

PP[]; QQ[]; PP[() .. ()]

PP[() .. ()]

(1)

PP[9]; QQ[9]

-.70

(2)

PP()

(table( [( 1 ) = 0.2e-1, ( 2 ) = .12, ( 3 ) = .22, ( 4 ) = .32, ( 5 ) = .42, ( 6 ) = .52, ( 7 ) = .62, ( 9 ) = .82, ( 8 ) = .72, ( 11 ) = 1.02, ( 10 ) = .92 ] ))()

(3)

``

QQ()

(table( [( 1 ) = -.42, ( 2 ) = -.45, ( 3 ) = -.49, ( 4 ) = -.55, ( 5 ) = -.60, ( 6 ) = -.64, ( 7 ) = -.67, ( 9 ) = -.70, ( 8 ) = -.69, ( 11 ) = -.69, ( 10 ) = -.70 ] ))()

(4)

 

 

 

NULL

NULL


 

Download SS_Stability(Ks)_3.mw

First 866 867 868 869 870 871 872 Last Page 868 of 2215