MaplePrimes Questions

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

I am trying to expand the ridgid beam model to flexible beam model to 1.) use fixed walled end to calulate cantilever deflection from a constant load, and visualize deflection; and then 2.) incorporate a compliant walled joint (rotary joint) with stiff rotational spring. To get angles of rotation; and finally simulate a periodic force and calc/plot all reactions/theta(t).

 

There is a video on line of a round beam with fixed-fixed ends and a translating weight with deflection visulized, but only a you tube vid can be found of this set-up.   It is close to what I need.

 

Lastly, if anyone knows how to send the diagram to maple as in A:=MapleSim:-___()

This method to transfer from Sim to maple with diagram and current session(#?) was done in a tutorial vid from MapleSim session. I am using Maple/MapleSim 2017 which is difficult to follow changes in workspace and commands from vids/tutorials.

PS. I have connected through opening a new worksheet and explicitly opening by filename. 

ENTIRE_FUNCTION_CHECK_GOOD_COPY.mwSorry for the silly question, but i have actually tried to find it in the help pages i swear.

 

how do i change the font size of the output?

 

I am making some educational worksheets and the problem ive faced is that all of people i know
 


 

 

online are mathematica users or others, so i am designing the worksheets in such a way that it requires 0 understanding of maple for the student, but can  be readily used as an educational tool. 

 

They are all going to be aimed  for undergraduate level, and designed to investigate questions that are not answered by plugging the function into wolfram alpha. 

A draft of one attached, any general advice for this project appreciated.

 


I am trying to find for the equilibrium but why my solutions lost?

restart

interface(imaginaryunit = j);

I

(1)

unprotect(Pi)

lambda := k*tau*(C*Upsilon+I)/N;

k*tau*(C*Upsilon+I)/N

(2)

eqn1 := (1-p)*Pi+phi*V+delta*R-(mu+lambda+vartheta)*S;

(1-p)*Pi+phi*V+delta*R-(mu+k*tau*(C*Upsilon+I)/N+vartheta)*S

(3)

eqn2 := p*Pi+vartheta*S-(epsilon*lambda+mu+phi)*V;

p*Pi+vartheta*S-(epsilon*k*tau*(C*Upsilon+I)/N+mu+phi)*V

(4)

eqn3 := rho*lambda*S+rho*epsilon*lambda*V+(1-q)*eta*I-(mu+beta+chi)*C;

rho*k*tau*(C*Upsilon+I)*S/N+rho*epsilon*k*tau*(C*Upsilon+I)*V/N+(1-q)*eta*I-(mu+beta+chi)*C

(5)

eqn4 := (1-rho)*lambda*S+(1-rho)*epsilon*lambda*V+chi*C-(mu+alpha+eta)*I;

(1-rho)*k*tau*(C*Upsilon+I)*S/N+(1-rho)*epsilon*k*tau*(C*Upsilon+I)*V/N+chi*C-(mu+alpha+eta)*I

(6)

eqn5 := beta*C+q*eta*I-(mu+delta)*R;

beta*C+q*eta*I-(mu+delta)*R

(7)

mu := 0.1e-1;

0.1e-1

 

116.1

 

0.8e-2

 

0.25e-2

 

0.2e-2

 

0.5e-1

 

0.115e-1

 

0.598e-2

 

.5

 

.2

 

.1

 

0.57e-2

 

.2

 

11610

(8)

Equilibria := solve({eqn1 = 0, eqn2 = 0, eqn3 = 0, eqn4 = 0, eqn5 = 0}, {C, I, R, S, V});

Warning, solutions may have been lost

 

{C = 0., I = 0., R = 0., S = 5946.585366, V = 5663.414634}

(9)

``


 

Download Equilibria.mw
 

restart

interface(imaginaryunit = j);

I

(1)

unprotect(Pi)

lambda := k*tau*(C*Upsilon+I)/N;

k*tau*(C*Upsilon+I)/N

(2)

eqn1 := (1-p)*Pi+phi*V+delta*R-(mu+lambda+vartheta)*S;

(1-p)*Pi+phi*V+delta*R-(mu+k*tau*(C*Upsilon+I)/N+vartheta)*S

(3)

eqn2 := p*Pi+vartheta*S-(epsilon*lambda+mu+phi)*V;

p*Pi+vartheta*S-(epsilon*k*tau*(C*Upsilon+I)/N+mu+phi)*V

(4)

eqn3 := rho*lambda*S+rho*epsilon*lambda*V+(1-q)*eta*I-(mu+beta+chi)*C;

rho*k*tau*(C*Upsilon+I)*S/N+rho*epsilon*k*tau*(C*Upsilon+I)*V/N+(1-q)*eta*I-(mu+beta+chi)*C

(5)

eqn4 := (1-rho)*lambda*S+(1-rho)*epsilon*lambda*V+chi*C-(mu+alpha+eta)*I;

(1-rho)*k*tau*(C*Upsilon+I)*S/N+(1-rho)*epsilon*k*tau*(C*Upsilon+I)*V/N+chi*C-(mu+alpha+eta)*I

(6)

eqn5 := beta*C+q*eta*I-(mu+delta)*R;

beta*C+q*eta*I-(mu+delta)*R

(7)

mu := 0.1e-1;

0.1e-1

 

116.1

 

0.8e-2

 

0.25e-2

 

0.2e-2

 

0.5e-1

 

0.115e-1

 

0.598e-2

 

.5

 

.2

 

.1

 

0.57e-2

 

.2

 

11610

(8)

Equilibria := solve({eqn1 = 0, eqn2 = 0, eqn3 = 0, eqn4 = 0, eqn5 = 0}, {C, I, R, S, V});

Warning, solutions may have been lost

 

{C = 0., I = 0., R = 0., S = 5946.585366, V = 5663.414634}

(9)

``


 

Download Equilibria.mw

 

It is a truth universally acknowledged, that a single man in possession of an algorithm for calculating a Groebner basis, must be in want of an algorthim for calculating a reduced Groebner basis.

It seems odd that i can't find something in the Groebner package - if there isn't something there, I assume that there is a well known piece of code for doing this!

I want to determine components of a vector in explicit form.  Let I have vector nn[mu] with components (1,0,0,0). Is it possible to explain to Maple it?

I tried to do the next:

with(Physics);
Setup(dimension = 4);
Setup(metric = {(1, 1) = -1, (2, 2) = -1, (3, 3) = -1, (4, 4) = 1});
Setup(mathematicalnotation = true);
Coordinates(X);
Setup(tensors = {nn[mu](X)});
nn[mu] = Matrix(1, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 1});
nn[mu]*k[mu];
SumOverRepeatedIndices(%)

 

The answer that maple gives is:

nn[1]*k[`~1`]+nn[2]*k[`~2`]+nn[3]*k[`~3`]+nn[4]*k[`~4`]

 

So, doesn't Maple understand that nn[1]=nn[2]=nn[3]=0?

First 832 833 834 835 836 837 838 Last Page 834 of 2375