MaplePrimes Questions

Hello, 

How can I solve this equation in Maple?

Please help me?

 

Dear all,

I have 3 ODE's that I solved with the use of a for loop that cycles through different IC's. The purpose of this is so that I can compare the solutions with different IC's. I have three dependent variables (h1(z), h2(z), h3(z)), and one independent variable (z). The loop that I created looks like this:

_Omega_r := 10^(-5);
n := 10;
for i from 0 to n do:
    h10[i] := 1-0.16666667e-1*i;
    h20[i] := 1-(.7*0.16666667e-1)*i;
    h30[i]:= 3-h10[i]-h20[i];
    ans := dsolve([eq2, eq3, eq4, h1(0) = h10[i], h2(0) = h20[i], h3(0) = h30[i]], {h1(z), h2(z), h3(z)}, numeric, output = listprocedure);
    h1_sol[i] := rhs(ans[2]);
    h2_sol[i] := rhs(ans[3]);
    h3_sol[i] := rhs(ans[4]);
    print(i);
end do

Here, h10[i], h20[i] and h30[i] are my initial conditions. I use h1_sol[i], h2_sol[i] and h3_sol[i] to make plots of the solutions:

I make two different types of plots - one type has only the different solutions for h1(z) with all initial conditions:

h1plot := plot([seq(h1_sol[i](z), i = 0 .. 10)], legend = [h1(0) = h10[0], h1(0) = h10[1], h1(0) = h10[2], h1(0) = h10[3], h1(0) = h10[4], h1(0) = h10[5], h1(0) = h10[6], h1(0) = h10[7], h1(0) = h10[8], h1(0) = h10[9], h1(0) = h10[10]], title = "z versus h1(z) for different initial conditions", labels = ["z", "h1(z)"]);

And the other uses one set of initial conditions, but all three h1(z), h2(z), h3(z):

allplot1 := plot([seq(h1_sol[i](z), i = 2), seq(h2_sol[i](z), i = 2), seq(h3_sol[i](z), i = 2)], title = [typeset(h(z), " versus ", z, " (case 2)")], labels = [z, h(z)], legend = [typeset(h[1](z), " with ", h1__0 = h10[2]), typeset(h[2](z), " with ", h2__0 = h20[2]), typeset(h[3](z), " with ", h3__0 = h30[2])]);

Now, all of this works wonderfully. I managed to do everything I wanted. Except that I have been struggling figuring out how to extract the data from the plots into a .dat file into different columns. With the code that I did write, if I use it on the first plot, I end up getting 2 columns, one for z and one for h1(z) (for example), but there should be 11 columns (one for z and 10 for h1(z) with different initial conditions). How would I go about to extract the data of multiple plots into one .dat (or .xls, or .csv or whatever) file? What I did:

write := proc (plotname, filename)
    local fd; fd := fopen(filename, WRITE, TEXT);
    writedata(fd, convert(op([1, 1], plotname), matrix));
    fclose(fd);
end;

write(h1plot, `zvsh1GR.dat`)

Alternatively, if there is a way to use the solution in Maple directly without extracting first (I need to use the solutions for h1(z), h2(z), h3(z) to plot different equations that are dependent on these variables), that would be great. For example, I would like to use these three variables in an equation that uses both the derivatives of all three the variables and the variables themselves as is. For example:

q (z)= (diff(h1(z),z)+diff(h2(z),z)+diff(h3(z),z))/(h1(z)+h2(z)+h3(z))

And then I want to plot q(z) vs z.

I'm sorry if this is a lengthy question (or one with a simple solution) - I am still learning Maple.

My Maple file:
Solving_GR_f(R)_ne_2.maple

Maple worksheet: Solving_GR_f(R)_ne_2.mw

Hi, does anyone help me to solve some matrix question in maple. pls have look on my worksheet

 

Help_Matrix.mw

How to do multivariate polynomial regression using Maple?

Kind help with the needful

Any sample code with 4 independent vatiables and one dependent variable with less data may be useful.

Kind help. 

For the following equation, 

eqn:=1.35150599852371*10^10 = 2.45634141630387*10^7*x + 50.7216626470812*x^4 + 6.20132964743411*10^7*x^2 + 1.26328819483651*10^10 + 112528.172146835*x^3

using solve gives 4 real solutions

3.56789020177967, -3.99013603029896, -1017.86074450970, -1200.25966528805

Using RealDomain[solve] gives an error:

RealDomain[solve](eqn,x,allsolutions=true);
Error, (in assuming) when calling 'RootOf'. Received: 'the input range -1200.259665 .. -1200.259665 is invalid'

This is partly a bug alert, but any insight would be appreciated.



 

Hello, 

1) Is it possible to transform a lib package into a mla package ?

2) I add the file here :

 maple.zip

May you manage to make the transformation and give me an access to the code inside ?

Thank you for your help

 I am new to Maple.  I will appreciate any assistance with a Maple iterative procedure to find the value of s at a given temperature for F(x,r,s, T) = 0 with all other variables fixed.  F is a complicated function.  

 

Is possible to operate Grid Computing Toolbox together with Maple on one local multicore machine?

If yes, what is the proper instalation/configuration procedure on Windows or Linux?

Hi,

As the title says, I was trying to load a library that is stored in .lib file to use in a maple cloud application. Locally, I think i can get it to work, but I don't know how to use this external file on the cloud itself.

Does anyone know if this is possible?

Thanks!

Is it possible to draw objects in Maple graphically, that are defined by parameters?

Like rectangles with width and height, circles with a radius, triangles, etc.

I want to get data from 2D plots and 3Dplots and want to export to Excel or Matlab.

 

For  2D plots, the following code works. The data can be exported to Excel. No problem.

restart: 

P1:=plot(sin(x));
data1:=op([1,1],P1); 

ExcelTools:-Export(data1, "C:/Users/student/Desktop/XLdat.csv", "Sheet1", "A1");
ExportMatrix("C:/Users/student/Desktop/XLdat.csv", data1); 

 

1. But the following code doesn' t work for exporting the data to Matlab. Why?

restart: P1:=plot(sin(x));
dataMat:=plottools:-getdata(P1);
dataMat2:=convert(dataMat,Matrix):
ExportMatrix( "test.mat",dataMat2, target=Matlab);

 

 

 2. How to write a code in order to get data from the 3D plot and to export to Excel or Matlab?

For example;

restart:
z=sin(x)*cos(y);
P2:=plot3d(z);

 

 

Maple 2020.2

In Maple, series(f(x), x=x0, order) will produce an expansion where the number of terms is specified by "order". But is it possible to specify the maximum power of (x-x0) that is needed, regardless of the starting order? This is especially a problem if the starting order is negative. To make it worse, in practice the number of terms produced by Maple may not be equal to "order", when nontrivial algebraic cancellations change the exact starting order. Experimenting with different choices of "order" case by case is not practical, when automation is needed for many runs involving different functions. MultiSeries:-series doesn't solve my problem, either.

P.S. MultiSeries:-series is more reliable than series in giving the number of terms specified by the user, but it still breaks down sometimes for complicated problems, for example producing much fewer terms than specified. My main concern, i.e. being able to specifiy an absolute maximium power, is also not addressed by switching from series to MultiSeries:-series.

Hello

I am trying to use Grid:-Seq to speed up some calculations.  To this end, I wrote the following procedure:

fun:=proc(model1::list,model2::list,vars::list,conds::set,tlim::numeric)
description "This function returns models with matching structures":
local ans1,ans2,res:=NULL:
if evalb(expand(model1)<>expand(model2)) then
     (ans1,ans2):=UtilsIORelation:-findMatchingStructures(subs(conds,model1),subs(conds,model2),vars,tlim):
     if nops(ans1) > 1 then
        res:=model1:
     end if:
end if:
return(res):
end proc:

I checked if the procedure works by issuing the following command

 

aux:=[seq](fun(modelX[i],model,vars,conds,2),i=1..nops(modelX)):

and it did work. The result is what I needed. 

But when I try it using Grid:-Seq instead of seq, I got the following error message:

infolevel[Grid:-Seq]:=3:
Grid:-Set(fun,findMatchingStructures,'model','vars','conds');
aux:=[Grid:-Seq](fun(modelX[i],model,vars,conds,2),i=1..nops(modelX)):

 

Error, (in fun) findMatchingStructures is not a command in the UtilsIORelation package.

 

What am I missing?   

Many thanks

 

 

 

@acer 

Acer, sometime ago I believe you used a program called DeleteBadCharacters in repairing a Maple file.
Can you tell me how to use that prgram? How do I call the procedure?
I try CeleteBadCharacters(atha.mw), where atha.mw is name of a file, and it doesn't work.
I would appreciate your help.

Thank you!

mapleatha


Requesting a code to compute for n>=1 the number of distinct proper divisors of n which properly divide a proper divisor of n.

0,0,0,1,0,1,0,2,1,1,0,3,0,1,1,3,0,2,0,3,1,1,0,5...

example: n=24= 2^3*3

There are 5 proper divisors of 24 having the above property: 1,2,3,4,6, so a(24)=5.

1 2 3 4 5 6 7 Last Page 3 of 1998