Kitonum

21440 Reputation

26 Badges

17 years, 37 days

MaplePrimes Activity


These are answers submitted by Kitonum

Instead of  test relation  command from the pop-up window, use  is  command. It makes easy to add other commands or assuming option:

R := sin(Pi*x/T)*cos(Pi*x/T) = 1/2*(sin(Pi*x/T+Pi*x/T)+sin(Pi*x/T-Pi*x/T)):
is(combine(R));
                                         
  true


Another example:

      

 

Addition. Now as for your first example. Maple is more suitable for calculations, and not for the proof of various symbolic identities. In your example, m is an arbitrary positive integer. If you specify its value, then there are no problems:

restart;
P := a[0]+Sum((2*(1-(-1)^k))/T*(Int(cos(2*Pi*k*x/T), x = 0 .. t)), k = 1 .. m);
Q := a[0]+Int(Sum(2*(1-(-1)^k)/T*cos(2*Pi*k*x/T), k=1..m), x=0..t);
is(value(eval(P=Q, m=10)));

                 

 

1. Unfortunately in your code, the equations of the trajectory of motion as a function of time are not indicated. Then you could write a much more compact code that calculates the coordinates of the vectors you are interested in for any  t .

2. To plot vectors (arrows) in space, you can use  plots:-arrow  command.

See corrected code

Simplification1.mw

 

Edit.

We do not need ourselves to write the code for the solution by Runge-Kutta method. As it is written in the help by default  dsolve command with  numeric  option finds the numerical solution using a Fehlberg fourth-fifth order Runge-Kutta method (rkf45  method). Here is the solution of your problem with specific values of the parameters and the plot of this solution:

restart;
Sol:=dsolve({m*l*diff(theta(t),t,t)+b*diff(theta(t),t)+m*g*sin(theta(t))=A*cos(omega*t), theta(0)=1, D(theta)(0)=0}, theta(t), numeric, parameters=[m,l,g,b,A,omega]);
Sol(parameters=[1,2,9.8,1,4,0.3]):
plots:-odeplot(Sol, [t,theta(t)], t=0..40, size=[900,300]);

               

 

 

In Maple 2017.3 :

Eq:=diff(u(x,y),x,x)+diff(u(x,y),y,y)=0;
bc:=u(x,0)=0, u(x,a)=0, u(0,y)=sin(y), u(infinity,y)=0;
pdsolve({Eq, bc}, u(x,y)) assuming a>0; 
# The symbolic result
F:=eval(rhs(%), [a=5, infinity=50]);  # An approximate result for plotting
plot3d(F, x=0..5, y=0..Pi);  # Visualization

          

                   

             

I assumed that interest is charged at the beginning of each month, as well as at the moment (n-th day of the month) when an additional payment  R  is made. If  n = 1 , then we get the initial result.

 
 

restart;
param:=[P=10000, R=100, i=0.025/12, n=20]:

rsolve({f(t) =( f(t-1)*(1+(n-1)*i/30) + R)*(1+(30-(n-1))/30*i), f(0)=P}, {f});

{f(t) = P*(1+i-(1/900)*i^2*n^2+(8/225)*i^2*n-(31/900)*i^2)^t+30*R*(i*n-31*i-30)*(1+i-(1/900)*i^2*n^2+(8/225)*i^2*n-(31/900)*i^2)^t/(i*(i*n^2-32*i*n+31*i-900))-30*R*(i*n-31*i-30)/(i*(i*n^2-32*i*n+31*i-900))}

(1)

eval(rhs(%[1]),param);

58013.43793*1.002084341^t-48013.43793

(2)

P:=unapply(%,t);

proc (t) options operator, arrow; 58013.43793*1.002084341^t-48013.43793 end proc

(3)

check

seq(P(i),i=0.. 2);

10000.00000, 10120.91979, 10242.09158

(4)

 


 

Download Recurring_new.mw

 

restart;
F(x,y):=ln((1+x)*y) + exp(x^(2)*y^(2)) = x + cos(x):
L:=[1, seq(eval(implicitdiff(F(x,y), y, x$n), [x=0,y=1]), n=1..6)];
add(L[i]/(i-1)!*x^(i-1), i=1..7);

                 

 

 

y:= x-> ((1 + a*x + b*x^2)/(1 + c*x + d*x^2))*(ln(sinh(x)^2 + cosh(x)^2));
Sys:={seq(coeff(series(y(x), x=0, 7), x^n)=0, n=3..6)};
solve(Sys);

                         {a = 0, b = 16/15, c = 0, d = 2/5}

plot([seq([PP[n], QQ[n]], n = 1 .. numelems(PP))], style = pointline, labels = ["PP", "QQ"]);

                   

 

 
Edit.               

In addition to the unknown variables  {C, I, R, S, V} , your nonlinear system contains three more parameters (k , tau, Upsilon). If you want to get all the solutions expressed through these parameters, then use the options parametric=full  and  allsolutions. If you specify the values of these parameters, you can easily get all the solutions:

Sys := {eqn1 = 0, eqn2 = 0, eqn3 = 0, eqn4 = 0, eqn5 = 0};
Equilibria1 := solve(Sys, {C, I, R, S, V}, parametric=full, allsolutions);  # 
All the solutions expressed through 3 parameters
Equilibria2 := solve(eval(Sys, [k = 1, tau = 2, Upsilon = 3]), {C, I, R, S, V});  # All the solutions for specific parameters

If I correctly understood the problem, then the following code solves it. You can yourself specify the number of steps and the reduction factor of the height at each step (parameters  N  and  k):

restart;
L1:=s->[[0,0],[5,0],[2.5,s],[0,0]]:
L2:=s->[[2,0],[7,0],[4.5,s],[2,0]]:
L3:=s->[[4,0],[9,0],[6.5,s],[4,0]]:
A:=s->plot([L1(s),L2(s),L3(s)], color=red, scaling=constrained):
N:=15:  k:=0.8:
for n from 0 to N do
S[n]:=plots:-display([A(4), A(4*k^n)]):
od:
plots:-display(seq(S[n]$5, n=0..N), insequence);

               


 

Did you mean this formula  V=int(S(x), x=a..b) ?  If so, then look at this popular article and my example in Maple below applying this formula.


The problem: find the volume of the body bounded downwards by the plane  z=0 , on the sides by the cylinder  x^2+y^2=R^2 , and the top plane  z=-tan(alpha)*y .


Visualization and calculation (for plotting I took  R=1  and  alpha=Pi/4 ):

A:=plot3d(-y, x=-sqrt(1-y^2)..sqrt(1-y^2), y=-1..0,style=surface, color="LightBlue",  scaling=constrained, axes=normal, filled, transparency=0.3, tickmarks=[[-1=-R,0=0,0.45=x,1=R], 0, 0], axesfont=[times,18]):
B:=plottools:-polygon([[0.45,0,0],[0.45,-sqrt(1-0.45^2),0],[0.45,-sqrt(1-0.45^2),sqrt(1-0.45^2)]], color=blue):
plots:-display(A,B); 
# Visualization

S(x):=1/2*sqrt(R^2-x^2)*sqrt(R^2-x^2)*tan(alpha):
V=int(S(x), x=-R..R); 
# Calculation

                    

 

 

 


 

It often happens that a symbolic result is not expressed in terms of real radicals (for example, the irreducible case when solving a cubic equation, when all the roots of the equation are actually real). An example below with the specified parameters  under of numerical calculation shows that the result is actually real:

fs := (1-1/sqrt((Uo+U*sin(x))^2+a^2))*(Uo+U*sin(x)): 
fss := `assuming`([2*(int(fs*sin(x), x = 0 .. Pi))/Pi], [U::positive, a::positive, Uo::positive]):
evalf[50](eval(fss, [Uo=1, U=2, a=3]));

                2.4545008734200178385686140997145766421739797191553-                    5.5000000000000000000000000000000000000000000000000*10^(-50)*I

The symbolic result:

with(geometry):
eq := evalf[20](expand(subs([x, y] =~ convert(Student:-LinearAlgebra:-RotationMatrix(Pi/3).<x, y>, list), 2*(x-1)^2+sqrt(2)*y^2-1))):
conic(c, eq, [x, y]):
coordinates(center(c));
identify(evalf[15](%));

                                              [1/2, -1/2*3^(1/2)]

You forgot to put commas between individual equations in your system. I fixed it. It turned out that the system is inconsistent, because  solve  command returns  NULL . The determinant of the system is 0.

Sys := {-6.7642088272251297212*d[1, 1]-.23520507704562101132*d[1, 2]-5.8233885190426456759*d[1, 3]+34.632657184619275137*d[1, 4]+1.8308401918550417305*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.5761922829080091932*d[2, 3]-9.373876878125528749*d[2, 4]-14.087569594645296643*d[3, 1]-.48985298599265354856*d[3, 2]-12.128157650674682449*d[3, 3]+72.128164697121390121*d[3, 4]+77.022155175221117487*d[4, 1]-17.156128463674125233*d[4, 2]+145.64666902991761843*d[4, 3]-601.11088029977885095*d[4, 4] = 0, -6.3505370802317673052*d[1, 1]-.23520507704562101132*d[1, 2]-5.4097167720492832599*d[1, 3]+54.802782951629695640*d[1, 4]+1.7188733853924696263*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.4642254764454370890*d[2, 3]-14.833240696164645293*d[2, 4]-13.226030621801645811*d[3, 1]-.48985298599265354856*d[3, 2]-11.266618677831031617*d[3, 3]+114.13574573628827681*d[3, 4]+107.19584752215150208*d[4, 1]-17.156128463674125233*d[4, 2]+175.82036137684800302*d[4, 3]-1136.3239123361047712*d[4, 4] = 0, -5.7167551941125971285*d[1, 1]-.23520507704562101132*d[1, 2]-4.7759348859301130832*d[1, 3]+82.882747548740738074*d[1, 4]+1.5473302855836067493*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.2926823766365742120*d[2, 3]-22.433527600870893213*d[2, 4]-11.906076336447024126*d[3, 1]-.48985298599265354856*d[3, 2]-9.9466643924764099316*d[3, 3]+172.61685795222431091*d[3, 4]+153.42462622364681378*d[4, 1]-17.156128463674125233*d[4, 2]+222.04914007834331471*d[4, 3]-2162.1913920527683546*d[4, 4] = 0, -2.3520507704562101132*d[1, 1]+.6366197723675813431*d[1, 2]-4.898529859926535486*d[1, 3]+32.157042520884777450*d[1, 4]-2.3520507704562101132*d[2, 1]+.63661977236758134308*d[2, 2]-4.8985298599265354856*d[2, 3]+32.157042520884777447*d[2, 4]+7.0561523113686303394*d[3, 1]-1.9098593171027440293*d[3, 2]+14.695589579779606457*d[3, 3]-96.47112756265433234*d[3, 4]-11.760253852281050559*d[4, 1]+3.183098861837906715*d[4, 2]-24.49264929963267742*d[4, 3]+160.7852126044238874*d[4, 4] = 1, -1.8308401918550417299*d[1, 1]-0.6366197723675813430e-1*d[1, 2]-1.5761922829080091926*d[1, 3]+9.373876878125528754*d[1, 4]+1.8308401918550417305*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.5761922829080091932*d[2, 3]-9.373876878125528749*d[2, 4]-9.1542009592752086523*d[3, 1]-.31830988618379067154*d[3, 2]-7.8809614145400459657*d[3, 3]+46.869384390627643742*d[3, 4]+19.328418292985322519*d[4, 1]-19.162255148264198426*d[4, 2]+95.977438886042116228*d[4, 3]-305.71973224709969080*d[4, 4] = 0, -1.7188733853924696257*d[1, 1]-0.6366197723675813430e-1*d[1, 2]-1.4642254764454370885*d[1, 3]+14.833240696164645297*d[1, 4]+1.7188733853924696263*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.4642254764454370890*d[2, 3]-14.833240696164645293*d[2, 4]-8.5943669269623481316*d[3, 1]-.31830988618379067154*d[3, 2]-7.3211273822271854450*d[3, 3]+74.166203480823226458*d[3, 4]+53.030427038219525869*d[4, 1]-19.162255148264198426*d[4, 2]+129.67944763127631958*d[4, 3]-668.89639482661771723*d[4, 4] = 0, -1.5473302855836067487*d[1, 1]-0.6366197723675813430e-1*d[1, 2]-1.2926823766365742115*d[1, 3]+22.433527600870893218*d[1, 4]+1.5473302855836067493*d[2, 1]+0.63661977236758134308e-1*d[2, 2]+1.2926823766365742120*d[2, 3]-22.433527600870893213*d[2, 4]-7.7366514279180337465*d[3, 1]-.31830988618379067154*d[3, 2]-6.4634118831828710599*d[3, 3]+112.16763800435446606*d[3, 4]+104.66490008068725185*d[4, 1]-19.162255148264198426*d[4, 2]+181.31392067374404557*d[4, 3]-1455.2623850848598494*d[4, 4] = 0, -1.4491448767744190950*d[1, 1]-1.9098593171027440292*d[1, 2]+6.1902923916365570215*d[1, 3]-11.964006709004497915*d[1, 4]+.4830482922581396984*d[2, 1]+.63661977236758134308*d[2, 2]-2.0634307972121856740*d[2, 3]+3.988002236334832639*d[2, 4]-3.381338045806977889*d[3, 1]-4.4563384065730694016*d[3, 2]+14.444015580485299718*d[3, 3]-27.91601565434382847*d[3, 4]+19.804979982583727629*d[4, 1]+26.101410667070835066*d[4, 2]-84.600662685699612634*d[4, 3]+163.5080916897281382*d[4, 4] = 0, -1.4491448767744190950*d[1, 1]+.4830482922581396984*d[1, 2]-3.381338045806977889*d[1, 3]+19.804979982583727629*d[1, 4]-1.9098593171027440292*d[2, 1]+.63661977236758134308*d[2, 2]-4.4563384065730694016*d[2, 3]+26.101410667070835066*d[2, 4]+6.1902923916365570215*d[3, 1]-2.0634307972121856740*d[3, 2]+14.444015580485299718*d[3, 3]-84.600662685699612634*d[3, 4]-11.964006709004497917*d[4, 1]+3.988002236334832638*d[4, 2]-27.91601565434382847*d[4, 3]+163.50809168972813819*d[4, 4] = 0, -.6366197723675813431*d[1, 1]+.6366197723675813431*d[1, 2]-3.1830988618379067164*d[1, 3]+12.095775674984045516*d[1, 4]-.6366197723675813430*d[2, 1]+.63661977236758134308*d[2, 2]-3.1830988618379067154*d[2, 3]+12.095775674984045518*d[2, 4]+1.9098593171027440288*d[3, 1]-1.9098593171027440293*d[3, 2]+9.549296585513720146*d[3, 3]-36.287327024952136560*d[3, 4]-3.183098861837906717*d[4, 1]+3.183098861837906715*d[4, 2]-15.91549430918953358*d[4, 3]+60.47887837492022764*d[4, 4] = 1, .4830482922581396984*d[1, 1]+.6366197723675813431*d[1, 2]-2.0634307972121856744*d[1, 3]+3.988002236334832645*d[1, 4]+.4830482922581396984*d[2, 1]+.63661977236758134308*d[2, 2]-2.0634307972121856740*d[2, 3]+3.988002236334832639*d[2, 4]-1.4491448767744190956*d[3, 1]-1.9098593171027440293*d[3, 2]+6.1902923916365570221*d[3, 3]-11.96400670900449791*d[3, 4]+2.415241461290698491*d[4, 1]+3.183098861837906715*d[4, 2]-10.317153986060928369*d[4, 3]+19.94001118167416332*d[4, 4] = 1, 1.9098593171027440291*d[1, 1]-1.9098593171027440292*d[1, 2]+9.5492965855137201456*d[1, 3]-36.287327024952136554*d[1, 4]-.6366197723675813430*d[2, 1]+.63661977236758134308*d[2, 2]-3.1830988618379067154*d[2, 3]+12.095775674984045518*d[2, 4]+4.4563384065730694010*d[3, 1]-4.4563384065730694016*d[3, 2]+22.281692032865347008*d[3, 3]-84.67042972488831863*d[3, 4]-26.101410667070835067*d[4, 1]+26.101410667070835066*d[4, 2]-130.50705333535417533*d[4, 3]+495.92680267434586630*d[4, 4] = 0, 1.9098593171027440291*d[1, 1]-.6366197723675813430*d[1, 2]+4.4563384065730694010*d[1, 3]-26.101410667070835067*d[1, 4]-1.9098593171027440292*d[2, 1]+.63661977236758134308*d[2, 2]-4.4563384065730694016*d[2, 3]+26.101410667070835066*d[2, 4]+9.5492965855137201456*d[3, 1]-3.1830988618379067154*d[3, 2]+22.281692032865347008*d[3, 3]-130.50705333535417533*d[3, 4]-36.287327024952136554*d[4, 1]+12.095775674984045518*d[4, 2]-84.670429724888318626*d[4, 3]+495.92680267434586626*d[4, 4] = 0, 7.0561523113686303394*d[1, 1]-2.3520507704562101132*d[1, 2]+16.464355393193470792*d[1, 3]-96.434081588704614639*d[1, 4]-1.9098593171027440292*d[2, 1]+.63661977236758134308*d[2, 2]-4.4563384065730694016*d[2, 3]+26.101410667070835066*d[2, 4]+14.695589579779606456*d[3, 1]-4.8985298599265354856*d[3, 2]+34.289709019485748399*d[3, 3]-200.83972425698795490*d[3, 4]-96.471127562654332340*d[4, 1]+32.157042520884777447*d[4, 2]-225.09929764619344213*d[4, 3]+1318.4387433562758753*d[4, 4] = 0, 7.0561523113686303394*d[1, 1]-1.9098593171027440292*d[1, 2]+14.695589579779606456*d[1, 3]-96.471127562654332340*d[1, 4]-2.3520507704562101132*d[2, 1]+.63661977236758134308*d[2, 2]-4.8985298599265354856*d[2, 3]+32.157042520884777447*d[2, 4]+16.464355393193470792*d[3, 1]-4.4563384065730694016*d[3, 2]+34.289709019485748399*d[3, 3]-225.09929764619344213*d[3, 4]-96.434081588704614639*d[4, 1]+26.101410667070835066*d[4, 2]-200.83972425698795490*d[4, 3]+1318.4387433562758754*d[4, 4] = 0, 11.581726419330485018*d[1, 1]-3.8605754731101616728*d[1, 2]+27.024028311771131709*d[1, 3]-158.28359439751662858*d[1, 4]-1.9098593171027440292*d[2, 1]+.63661977236758134308*d[2, 2]-4.4563384065730694016*d[2, 3]+26.101410667070835066*d[2, 4]+19.221163687741461135*d[3, 1]-6.4070545625804870452*d[3, 2]+44.849381938063409316*d[3, 3]-262.68923706579996884*d[3, 4]-172.31418534244454203*d[4, 1]+57.438061780814847345*d[4, 2]-402.06643246570393142*d[4, 3]+2354.9605330134087411*d[4, 4] = 0}:
Digits:=50:
solve(convert(Sys, fraction)); 
# Returns NULL
with(LinearAlgebra):
var:=convert(indets(Sys), list):
A, b:=GenerateMatrix(Sys, var):
Determinant(convert(A, fraction));
                                                                 
 0
 

First 135 136 137 138 139 140 141 Last Page 137 of 289