MaplePrimes Questions

Dear sir

 

In my ode problem i do not know that how to set range (eta) from -2 to 2 please can  you help me.

Consider the following expression obtained from the solve command: Note that this uses the two variable arctan function.

p:=arctan((-cos(theta)^3-(1/2)*cos(theta)^2-(1/2)*cos(theta)*((2*cos(theta)+1)*(2*cos(theta)-3)*(cos(theta)+1)^2)^(1/2)+2*cos(theta)-(1/2)*((2*cos(theta)+1)*(2*cos(theta)-3)*(cos(theta)+1)^2)^(1/2)+3/2)^(1/2), -(1/2)*cos(theta)-1/2-(1/2)*((2*cos(theta)+1)*(2*cos(theta)-3)*(cos(theta)+1)^2)^(1/2)):

#ploting the expression shows a non-zero value at theta = Pi,  however if I convert p to a function using


f:=unapply(p,theta):


# then f(Pi);  gives a value of 0

#On the other hand maximize(p,theta=3*Pi/4..5*Pi/4,location); shows a non-zero value of 4*Pi/5 at theta = Pi,  which agrees with the plot of p, namely, it returns:

-arctan((10-2*5^(1/2))^(1/2)/(5^(1/2)+1))+Pi,

{[{theta = Pi}, -arctan((10-2*5^(1/2))^(1/2)/(5^(1/2)+1))+Pi]}

Is this a bug? Or what?

Thanks, 

Edwin

Hello

I wonder whether someone out there would give some ideas on how to implement a problem involving monomials (or polynomials if you wish).

dx/dt=f(x,y,z), dy/dt=g(x,y,z) and dz/dt=h(x,y,z) where f, g and h are polynomial functions of x,y,z.   

For instance, I need a test that returns false in:

a) dx/dt=f(x,z), dydt=anything, dz/dt=h(x,z) or 

b) dx/dt=f(x,y), dydt=g(x,y), dz/dt=anything.

c) dx/dt=anything, dy/dt=g(y,z), dz/dt=h(y,z)

that is, if two derivatives are related only between themselves, a false should be returned.  An example where a false should be returned is

[x*y*theta[5]+x*theta[2], x*y*theta[15], x*theta[22]+y*theta[23]+z*theta[24]] = [f(x,y),g(x,y),h(x,y,z)] where theta[5] .. theta[24]  are the coefficients.  

Many thanks.

Ed

PS. I am trying to avoid "for" in the solution in case I need to add another derivative but could not come up with a solution. In that case I need to test 3 variables instead of 2 and then 2 variables (as in the examples).

For my fdiff graph, it seems that the cirtical points appear to be jaggered or not smooth. Anyone nows what seem to be the problem? i tried increasing the numpoints but it did not work:( I am open to all opinions. Thanks:)

 

fyp2.mw

Hi, 

 I use Maple/MapleSim 2016. I have a question about how to save compiled modules as an one set. (Picture below describes my question.)

I use the Maple command "GetCompiledProc" to obtain the compiled module of MapleSim Model. And then, in some cases, I need to make a lot of compiled modules by using one MapleSim model.

(Usually, I make different compiled modules which contain different parameters to others)

For the convenience of using different compiled modules, I want to make these contained in one set whose name is "ModelSet". ("Case1 -> Case2" in the picture)

I tried this, but it did not work. Please see the attached (simple) model and the Maple worksheet in that model.

[TS]CompiledMoule_Practice.msim

For example, I want to use Model1(Compiled module 1) by loading that module from the ModelSet[1]. (Similarly, Model2 by loading ModelSet[2].)

However, when I load one of them, it is not the compiled module, but just a "symbol". It does not work as a compiled module any more.

Is there any way to make the "ModelSet" as I want? In fact, I tried to make the type of ModelSet as vector, list, and set, but all of them did not work. 

I appreciate any idea you may have.

> restart;
> with(plots);
> n := [0, .5, 1, 5]; pr := .71; p := 0; l := [1, 2, 3]; b := 0; s := 0; L := [green, blue, black, gold];
                         [green, blue, black, gold]
> R1 := 2*n/(n+1);
                              2 [0, 0.5, 1, 5]
                             ------------------
                             [0, 0.5, 1, 5] + 1
for j from 1 to nops(l) do; for j from 1 to nops(n) do        R1 := 2*n[j]/(1+n[j]);        R2 := 2*p/(1+n[j]); sol1 := dsolve([diff(diff(diff(f(eta),eta),eta),eta)+f(eta)*diff(diff(f(eta),eta),eta)+R1*(1-diff(f(eta),eta)^2) = 0, (1/pr)*diff(diff(theta(eta),eta),eta)+f(eta)*diff(theta(eta),eta)-R2*diff(f(eta),eta)*theta(eta) = 0, f(0) = 0, (D(f))(0) = l+b*((D@@2)(f))(0), (D(f))(-2) =1, theta(0) = 1+s*(D(theta))(0), theta(-2) = 0], numeric, method = bvp); fplt[j]:= plots[odeplot](sol1,[eta,diff(diff(f(eta),eta),eta)],color=["blue","black","orange"]);         tplt[j]:= plots[odeplot](sol1, [eta,theta(eta)],color=L[j]); fplt[j]:= plots[odeplot](sol1,[eta,diff(f(eta),eta)],color=L[j]);      od:od:

 


Error, (in dsolve/numeric/bvp) unable to store 'Limit([eta, 2*eta, 3*eta]+eta^2*[.250000000000000, .500000000000000, .750000000000000]-.250000000000000*eta^2, eta = -2., left)' when datatype=float[8]
> plots:-display([seq(fplt[j], j = 1 .. nops(n))], color = [green, red], [seq(fplt[j], j = 1 .. nops(l))]);

> sol1(0);

Dear sir

In the  above problem i tried to write a nested program but its not executing and showing the error as Error, (in dsolve/numeric/bvp) unable to store 'Limit([eta, 2*eta, 3*eta]+eta^2*, i want the plot range from -2 to 2 but taking only 0 to -2 ,and -2.5 to 3 but taking only 0 to 1

Hi,

I want to write my first module, and I failed!  I create an instance of the class (module?)

myList := TestModule(3);                    # works.

But I've no acess to the members, since I use export! What's wrong?

myList:-get_n;
myList:-set_n(20);
myList:-run();

Error, `myList` does not evaluate to a module
Error, `myList` does not evaluate to a module
Error, `myList` does not evaluate to a module


# *****************************************************************************

TestModule := module()
    export get_n, set_n, run;
    local  n, result, ModuleApply, profileRun;
    option package;
    description "A testmodule";

    # Constructor
    ModuleApply := proc(n)
        print("Calling of Module Apply...");
         thismodule:-n := n;
         result := [];
         profileRun();
         return result;
     end proc:


    # Implementation of member run
     run := proc()
         print("Calling of run...");
         dummy := [];
         for i from 1 to 20000 do
            dummy := [op(dummy), i]
         end do;
         result := TRUE;
    end proc;
    
    # Implementation of member runprofile;
     profileRun := proc()
          print("Call of profileRun...");
          CodeTools[Profiling]:-Profile(run);
           run();
           CodeTools[Profiling]:-PrintProfiles(run);
           CodeTools[Profiling]:-UnProfile(run);
     end proc;

     # getter
     get_n := proc()
         n;
     end proc;

     # setter
     set_n := proc(n)
         thismodule:-n := n;
     end proc;
     
end module;

 

Dear all!

Hope everything going fine with you. I am facing problem to integrate the attached file in this file we need the result of z[1] and others like y[1]. I am waiting your quick answer.

Help.mw

With my best regards and sincerely.

Muhammad Usman

School of Mathematical Sciences 
Peking University, Beijing, China

Email: muhammadusman@pku.edu.cn

Mob #: 0086-13001903838

 

Dear All

I am stucked at converting an differential expression in Jet notations. Maple is giving error as  expression contains composite derivatives. Please see attached file.


 

with(PDEtools, D_Dx, declare, ToJet, FromJet):

DepVars := [alpha(x, y, t), beta(x, y, t), xi(x, y, t), tau(x, y, t), eta(x, y, t), U(xi(x, y, t), tau(x, y, t), eta(x, y, t))]

[alpha(x, y, t), beta(x, y, t), xi(x, y, t), tau(x, y, t), eta(x, y, t), U(xi(x, y, t), tau(x, y, t), eta(x, y, t))]

(1)

alias(alpha = alpha(x, y, t), beta = beta(x, y, t), xi = xi(x, y, t), tau = tau(x, y, t), eta = eta(x, y, t), U = U(xi(x, y, t), tau(x, y, t), eta(x, y, t)))

alpha, beta, xi, tau, eta, U

(2)

declare(alpha, beta, xi, tau, eta, U)

alpha(x, y, t)*`will now be displayed as`*alpha

 

beta(x, y, t)*`will now be displayed as`*beta

 

xi(x, y, t)*`will now be displayed as`*xi

 

tau(x, y, t)*`will now be displayed as`*tau

 

eta(x, y, t)*`will now be displayed as`*eta

 

U(xi(x, y, t), tau(x, y, t), eta(x, y, t))*`will now be displayed as`*U

(3)

u := U*beta+alpha

beta*U+alpha

(4)

diff(u, x)

(diff(beta, x))*U+beta*((D[1](U))(xi, tau, eta)*(diff(xi, x))+(D[2](U))(xi, tau, eta)*(diff(tau, x))+(D[3](U))(xi, tau, eta)*(diff(eta, x)))+diff(alpha, x)

(5)

ToJet((diff(beta, x))*U+beta*((D[1](U))(xi, tau, eta)*(diff(xi, x))+(D[2](U))(xi, tau, eta)*(diff(tau, x))+(D[3](U))(xi, tau, eta)*(diff(eta, x)))+diff(alpha, x), DepVars)

Error, invalid input: PDEtools:-ToJet expects its 2nd argument, DepVars, to be of type Or(`PDEtools/F(...)`, name, And(Or(list({name, `PDEtools/F(...)`}), set({name, `PDEtools/F(...)`})), satisfies(proc (SL) options operator, arrow; evalb(0 < nops(SL)) end proc))), but received [alpha(x, y, t), beta(x, y, t), xi(x, y, t), tau(x, y, t), eta(x, y, t), U(xi(x, y, t), tau(x, y, t), eta(x, y, t))]

 

I guess ToJet is not working in case of composite function.

But how I can  display derivatived (D[1](U))(xi, tau, eta)as U[xi]


 

Download Composite_Derivative.mw

I have written a C++ program which I feed in an input from Maple which has been converted using the CodeGeneration package in Maple and stored in a text file. For it to be processed in C++ I need to remove the cg = at the start of the Maple output expression. An example of this is as follows:

C(x^2+y^2+z^2);

cg = x * x + y * y + z * z

C++ cannot process the cg= at the start of the string and so I have found ways around it by using Bash or C++ itself to remove or ignore the cg = but I was wondering if it was possible to just not have Maple print it to begin with?

- Yeti

I have looked everywhere for help on how to format decimals to indicate they are recurring; or there is a set of numbers that is recurring. Normal notation would show a point above the the appropriate digits that follow the decimal point to indicate recurrence.

I'm sure it is simple to do but I cannot find the help that I need from the Maple help.

Regards, DLW

I am trying to achieve an intuitive (non-mathematical) understanding of parallel transport on the unit sphere.
A vector parallel transported along a unit sphere's geodesic clearly maintains as constant its initial orientation vis-a-vis the geodesic i.e. with regard to its moving bases vectors.

Dr. Lopez's application "Visualizing a Parallel Field in a Curved Manifold" displays animation of the parallel transport of a vector along a latitude, which is not a geodesic. As seen by an observer moving with it, the vector rotates clockwise with regard to its moving bases vectors. The rate of rotation increases with higher latitudes.

Then to what is the transported vector maintaining parallelism?

I have uploaded a Maple 2016 worksheet Parallel_transport_on_the_unit_sphere.mw which mostly copies Dr. Lopez's application and, for additional clarity, adds the unit sphere, the moving bases vectors and the moving tangent plane to his display.

> restart;
> with(plots);
> pr := .72; p := 0; n := [2, 3, 4, 5]; s := 1; a := .2; b := 1;
> R1 := 2*n/(n+1);
                               2 [2, 3, 4, 5]
                              ----------------
                              [2, 3, 4, 5] + 1
> R2 := 2*p/(n+1);
                                      0
>
>
> for j to nops(n) do R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n[j]); sol1 := dsolve([diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))+R1*(1-(diff(f(eta), eta))^2) = 0, diff(diff(theta(eta), eta), eta)+pr*s^f(eta)*(diff(theta(eta), eta))+R2*pr*s*(diff(f(eta), eta))*theta(eta)+2*(a*(diff(f(eta), eta))+b*theta(eta))/(n[j]-1) = 0, f(0) = 0, (D(f))(0) = 1+b*((D@@2)(f))(0), (D(f))(5) = 0, theta(0) = 1+s*(D(theta))(0), theta(5) = 0], numeric, method = bvp); fplt[j] := plots[odeplot](sol1, [eta, diff(diff(f(eta), eta), eta)], axes = boxed); tplt[j] := plots[odeplot](sol1, [[eta, theta(eta)]], axes = boxed) end do;
>
> plots:-display([seq(fplt[j], j = 1 .. nops(n))]);

 

> plots:-display([seq(tplt[j], j = 1 .. nops(n))]);

 

 

Dear sir

In the above problem graph, i am getting all the lines are in same color then how to identify the lines of different values like n=2,3,4,5,6(or can we set different color for different values of n for each line)

For the ODE system with boundary conditions, I was able to obtain solutions for n=0, but not for n>0. I obtained the error, Initial newton iteration is not converging. Anyone knows the solution for this? I am open to all suggestions and any help would be greatly appreciated:)

 

ODE_solution.mw

First 1059 1060 1061 1062 1063 1064 1065 Last Page 1061 of 2428