MaplePrimes Questions

Hey. I can't seem to implement the following recursive (piecewise) function:

f:=n->piecewise(n=0,1,n>=1,sum(f(k),k=0..n-1))

This doesn't work..How do I make it work? :( 

Spawned from here.

1. series() shows some strange dependence on the session history, the first call breaking subsequent computations. Also, for F(x, y), the zeroth term is RootOf(F(0, _Z)), even though 1 is the only solution, but for G(x, y), RootOf(G(0, _Z)) is evaluated to 1, even though 1 is not the only solution:

F := (x, y) -> ln((1+x)*y)+exp(x^2*y^2)-x-cos(x):
G := (x, y) -> ln((1+x)*y)+exp(x^2+y-1)-x-cos(x):

series(RootOf(G(x, y), y), x = 0, 5);
                 1-(1/2)*x^2-(1/6)*x^3+(7/48)*x^4+O(x^5)

series(RootOf(G(x, y), y), x = 0, 6);
Error, (in series/RootOf) unable to compute series

forget(series);
series(RootOf(G(x, y), y), x = 0, 6);
           1-(1/2)*x^2-(1/6)*x^3+(7/48)*x^4-(1/60)*x^5+O(x^6)

series(RootOf(F(x, y), y), x = 0, 1);
                         RootOf(ln(_Z)) + O(x)

2. For some reason solve hangs the first time, then returns a result quickly, and apparently doesn't go along well with simplify, because the last output contains an escaped local variable ans. Besides, I'm not sure why solve generates a huge answer. Is it expanding something to a high order? I was expecting just RootOf(_Z+tan(_Z))+O(x).

ser := series(y+tan(y)+x, x = 0, 1);

iser := timelimit(30, solve(ser, y)): # appears to run indefinitely without timelimit
Error, (in ArrayTools:-NumElems) time expired

iser := solve(ser, y): # returns immediately

evalf(iser); # OK
                                             O(x)

evalf(simplify(iser)); # less OK
       .1250000000*(eval(RootOf(_Z+tan(_Z)), [RootOf = ans, tan(_Z) = sin(_Z)/cos(_Z)]))+O(x)

This is in Maple 2017.3.

Hi,

What is the procedure to follow for importing a maple file into Mobius?

Thanks

a := powseries:-powsolve(diff(f(z), z)-f(z)/z = 0);

seq(a(i), i = 0 .. 5);
                        0, 0, 0, 0, 0, 0

Seems that powsolve is constructing the relation k*a(k)-a(k) = 0 and solving it as a(k)=0. I think powsolve should detect such cases (regardless of whether or not they're supported).

Hi

II ve managed to build an expression with one variable 
I me trying to plot this expression on a defined range but maple doesn t not let me.

How do I manage to plot this expression ?

If you have any advise on how to improve my code I m open to comments 

 

Thanks a lot in advance
 

restart


#data

`ϵc1` := 2.1*10^(-3);

0.2100000000e-2

(1)

`ϵcu1` := 3.5*10^(-3):

Ecm := 31000:

fcm := 25:

Fy := 500:

Es := 200000:

#geometry

As := 1885:

b := 250:

d := 450:


#coefficients

eta := epsilon/`ϵc1`:

k := 1.05*Ecm*`ϵc1`/fcm:

NULL


#formula

 

NULL

`σc` := proc (epsilon) options operator, arrow; fcm*(k*epsilon/`ϵc1`-epsilon^2/`ϵc1`^2)/(1+(k-2)*epsilon/`ϵc1`) end proc;

proc (epsilon) options operator, arrow; fcm*(k*epsilon/`ϵc1`-epsilon^2/`ϵc1`^2)/(1+(k-2)*epsilon/`ϵc1`) end proc

(2)

plot(`σc`, 0 .. `ϵcu1`);

 

NULL

#Pressure as a function of y (y=`ϵc`*y/x) :

`σc` := proc (y) options operator, arrow; fcm*(k*`ϵc`*y/(x*`ϵc1`)-`ϵc`^2*y^2/(x^2*`ϵc1`^2))/(1+(k-2)*`ϵc`*y/(x*`ϵc1`)) end proc;

proc (y) options operator, arrow; fcm*(k*`ϵc`*y/(x*`ϵc1`)-`ϵc`^2*y^2/(x^2*`ϵc1`^2))/(1+(k-2)*`ϵc`*y/(x*`ϵc1`)) end proc

(3)

`assuming`([int(`&sigma;c`, 0 .. x)], [0 <= x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

int(25*(1302.000000*`&varepsilon;c`*x/x-226757.3696*`&varepsilon;c`^2*x^2/x^2)/(1+349.6190476*`&varepsilon;c`*x/x), x = 0 .. x)

(4)

C := `assuming`([int(fcm*(k*`&varepsilon;c`*s/(x*`&varepsilon;c1`)-(`&varepsilon;c`*s/(x*`&varepsilon;c1`))^2)*b/(1+(k-2)*`&varepsilon;c`*s/(x*`&varepsilon;c1`)), s = 0 .. x)], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

-0.7487980799e-19*x*(0.2706771684e26*`&varepsilon;c`^2+0.1331955800e22*ln(874047619.*`&varepsilon;c`+2500000.)-0.1962210817e23-0.4656771182e24*`&varepsilon;c`)/`&varepsilon;c`

(5)

T := `assuming`([(d-x)*`&varepsilon;c`*Es*As/x], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

377000000*(450-x)*`&varepsilon;c`/x

(6)

``

x := `assuming`([solve(C = T, x)], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

868.0577815*(0.2900000000e12*`&varepsilon;c`+(-0.7297483689e24*`&varepsilon;c`^2+0.1400157114e23*`&varepsilon;c`-0.4004807874e20*ln(874047619.*`&varepsilon;c`+2500000.)+0.5899803379e21)^(1/2))*`&varepsilon;c`/(0.2706771684e13*`&varepsilon;c`^2+133195580.*ln(874047619.*`&varepsilon;c`+2500000.)-0.4656771182e11*`&varepsilon;c`-1962210817.), -868.0577815*(-0.2900000000e12*`&varepsilon;c`+(-0.7297483689e24*`&varepsilon;c`^2+0.1400157114e23*`&varepsilon;c`-0.4004807874e20*ln(874047619.*`&varepsilon;c`+2500000.)+0.5899803379e21)^(1/2))*`&varepsilon;c`/(0.2706771684e13*`&varepsilon;c`^2+133195580.*ln(874047619.*`&varepsilon;c`+2500000.)-0.4656771182e11*`&varepsilon;c`-1962210817.)

(7)

``

``

``

l

(8)

plot(l, `&varepsilon;c` = 0 .. 0.34e-2)

Error, (in plot) expected a range but received `&varepsilon;c` = 0 .. 0.34e-2

 

``

NULL


 

Download HW1_-_EC2_strain-pressure_graph.mw
 

restart


#data

`&varepsilon;c1` := 2.1*10^(-3);

0.2100000000e-2

(1)

`&varepsilon;cu1` := 3.5*10^(-3):

Ecm := 31000:

fcm := 25:

Fy := 500:

Es := 200000:

#geometry

As := 1885:

b := 250:

d := 450:


#coefficients

eta := epsilon/`&varepsilon;c1`:

k := 1.05*Ecm*`&varepsilon;c1`/fcm:

NULL


#formula

 

NULL

`&sigma;c` := proc (epsilon) options operator, arrow; fcm*(k*epsilon/`&varepsilon;c1`-epsilon^2/`&varepsilon;c1`^2)/(1+(k-2)*epsilon/`&varepsilon;c1`) end proc;

proc (epsilon) options operator, arrow; fcm*(k*epsilon/`&varepsilon;c1`-epsilon^2/`&varepsilon;c1`^2)/(1+(k-2)*epsilon/`&varepsilon;c1`) end proc

(2)

plot(`&sigma;c`, 0 .. `&varepsilon;cu1`);

 

NULL

#Pressure as a function of y (y=`&varepsilon;c`*y/x) :

`&sigma;c` := proc (y) options operator, arrow; fcm*(k*`&varepsilon;c`*y/(x*`&varepsilon;c1`)-`&varepsilon;c`^2*y^2/(x^2*`&varepsilon;c1`^2))/(1+(k-2)*`&varepsilon;c`*y/(x*`&varepsilon;c1`)) end proc;

proc (y) options operator, arrow; fcm*(k*`&varepsilon;c`*y/(x*`&varepsilon;c1`)-`&varepsilon;c`^2*y^2/(x^2*`&varepsilon;c1`^2))/(1+(k-2)*`&varepsilon;c`*y/(x*`&varepsilon;c1`)) end proc

(3)

`assuming`([int(`&sigma;c`, 0 .. x)], [0 <= x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

int(25*(1302.000000*`&varepsilon;c`*x/x-226757.3696*`&varepsilon;c`^2*x^2/x^2)/(1+349.6190476*`&varepsilon;c`*x/x), x = 0 .. x)

(4)

C := `assuming`([int(fcm*(k*`&varepsilon;c`*s/(x*`&varepsilon;c1`)-(`&varepsilon;c`*s/(x*`&varepsilon;c1`))^2)*b/(1+(k-2)*`&varepsilon;c`*s/(x*`&varepsilon;c1`)), s = 0 .. x)], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

-0.7487980799e-19*x*(0.2706771684e26*`&varepsilon;c`^2+0.1331955800e22*ln(874047619.*`&varepsilon;c`+2500000.)-0.1962210817e23-0.4656771182e24*`&varepsilon;c`)/`&varepsilon;c`

(5)

T := `assuming`([(d-x)*`&varepsilon;c`*Es*As/x], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

377000000*(450-x)*`&varepsilon;c`/x

(6)

``

x := `assuming`([solve(C = T, x)], [0 < x and x <= (1/2)*d, 0 <= `&varepsilon;c` and `&varepsilon;c` <= 0.35e-2]);

868.0577815*(0.2900000000e12*`&varepsilon;c`+(-0.7297483689e24*`&varepsilon;c`^2+0.1400157114e23*`&varepsilon;c`-0.4004807874e20*ln(874047619.*`&varepsilon;c`+2500000.)+0.5899803379e21)^(1/2))*`&varepsilon;c`/(0.2706771684e13*`&varepsilon;c`^2+133195580.*ln(874047619.*`&varepsilon;c`+2500000.)-0.4656771182e11*`&varepsilon;c`-1962210817.), -868.0577815*(-0.2900000000e12*`&varepsilon;c`+(-0.7297483689e24*`&varepsilon;c`^2+0.1400157114e23*`&varepsilon;c`-0.4004807874e20*ln(874047619.*`&varepsilon;c`+2500000.)+0.5899803379e21)^(1/2))*`&varepsilon;c`/(0.2706771684e13*`&varepsilon;c`^2+133195580.*ln(874047619.*`&varepsilon;c`+2500000.)-0.4656771182e11*`&varepsilon;c`-1962210817.)

(7)

``

``

``

l

(8)

plot(l, `&varepsilon;c` = 0 .. 0.34e-2)

Error, (in plot) expected a range but received `&varepsilon;c` = 0 .. 0.34e-2

 

``

NULL


 

Download HW1_-_EC2_strain-pressure_graph.mw

 

 

This is my first time in this forum, so I hope I use the correct conventions. If not please notice me. 

  1. When a light body orbits a heavy body under the influence of gravity (e.g. a planet around the Sun), Newton’s laws show that the orbit is restricted to a two-dimensional plane and is given by the differential equation

    d2/d(φ)2(1/r(φ)) + 1/r(φ) = GM/h2

    Here, (r, φ) is the path of the light body in polar coordinates, M is the mass of the heavy body, G is the gravitational constant, and h is a constant related to the angular velocity of the light body (h = r2φ ̇). The heavy body can be considered to be approximately stationary and located at the origin.

    Use Maple to solve this differential equation numerically, taking M = 1, G = 1, h = 1 with initial conditions

    r(0)=2/3, r′(0)=dr/dφ (0) = 0

    Using polar coordinates, create a plot of the orbit (r(φ), φ) for
    0 ≤ φ < 2π. You should observe a perfect ellipse.

  2. Since I am not a frequent maple user, I hope somebody can help me here

0=(1−p)π+φV+δR−(μ+λ+ϑ)S

0=pπ+ϑS−(μ+ϵλ+φ)V

0=ρλS+ρϵλV+(1−q)ηI−(μ+β+χ)C

0=(1−ρ)λS+(1−ρ)ϵλV+χC−(μ+α+η)I

0=βC+qηI−(μ+δ)R

Anybody know how to solve using coding for all the variable S,V,C,I,R

 I am trying to solve 2 equations in maple:

 1/  solve({1<x or x<3 or x>5});

 {x=x}    solution is correct

 2/  solve({1<x or x<3 or x<5});

 {x<5}    solution is wrong

 How do I have solution correct is {x=x} in Maple?

 Please teach me about this.

 Thank you very much!

Hi there,

Relatively new to maple (and programming all together). I am looking to try and make an if statement that performs several checks but I do not know which order to put them in.

 

Essentially I am trying to start out with i=1, max(Q)>0 and then perform a function, then add 1 to i and run it back through the test again. When my function changes from max(Q)>0 to max(Q)<=0 then I will have found a solution but only if i<330.

I am also unsure if I should put the test for i>330 before or after max(Q) test.


Thank you for any help

 

 

I think that I am probably making this more complicated than it needs to be, but I'm fairly certain that the way that I am doing this is possible within Maple. 

 

Currently I have this line of code

>implicitplot3d({2*sqrt(2)*x-2*z+sqrt(2) = 0, 2*sqrt(2)*x+2*z-sqrt(2) = 0, 2*sqrt(2)*y-2*z-sqrt(2) = 0, 2*sqrt(2)*y+2*z+sqrt(2) = 0}, x = -2 .. 2, y = -2 .. 2, z = -2 .. 2)

 

So these equations create planes that intersect creating a tetrahedron. The problem I'm running into is that I need to "trim" the extra bits of the planes outside of the tetrahedron. The idea I have right now is constraining each plane by 3 equations which would turn the planes into triangles. I think this will work but I'm not sure how to constrain each individual plane with different equations AND plot them on the same graph. Any direction here would be greatly appreciated. I would prefer to stick with using implicitplot3d and avoid any special plotting tools. 

 

Thanks for any help!

The real function y(x) is defined implicitly by the equation:

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

How can I find y(0) = 1 and the values of the first six derivatives y(k)(0), k=1, 2,..6 at x=0 to show the Taylorseries about x=0?

(I started by defining p:= ln(1+x)*y) + e^((x^2)*(y^2)) - x - cos(x), but that went wrong. 

 I want to solve PDE by method of lines , i get system of ODEs , I want  to solve this system by rk4 in package can someone help me please 

MOL.mw

I have experimental data that in some respect can be modelled by an asymmetric triangle function.  In the link below is my worsheet examining the effect of making the asymmetric triangle symmetric.  The frequency content, 2*pi*k/T, for both triangles is still the same.  Of course the Fourier coefficients will be different, but it appears the convergence is superior for the symmetric triangle.

I could do this with my experimental data by mirroring it about t=0.  Is this a mistake?  If I can do the symmetric case I think I can fit the data with much fewer terms.  If anyone has experience on these matters I would appreciated your comments.

discontinuty_Fourier_representation.mw

Hi.... I'd want to numerically solve a system of  n  polynomial equations of degree 2 with respect to n unknowns. It seems to me that there is a software in Maple (which deals only with the equations of degree 2) that solves this problem. I cannot find it anymore. Do you know it ? Thanks in advance.

Below is my attempt to evaluate an integral using the substition x=t/T.  MAPLE seems to be upset with my integration limits.  I do not know what I am doing wrong.

(int((1+t/T)*exp(-I*(2*Pi*n*t/T)), t = -T .. 0)+int((1-t/T)*exp(-I*(2*Pi*n*t/T)), t = 0 .. T))/T"(=)"-(1/2)*(cos(2*Pi*n)-1)/(n^2*Pi^2)

x := t/Tau;

1/Tau

(1)

1/2*(int((1+x)*exp(-(I*2)*Pi*n*x), x = -1 .. 0)+int((1-x)*exp(-(I*2)*Pi*n*x), x = 0 .. 1))

Error, (in int) integration range or variable must be specified in the second argument, got t/Tau = -1 .. 0

 

``


 

Download integration_error.mw

First 896 897 898 899 900 901 902 Last Page 898 of 2428