dharr

Dr. David Harrington

8270 Reputation

22 Badges

20 years, 360 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

This must be a bug, since replacing color with fillcolor in your first example works. So M needn't have string entries. Can't think of a simple workaround any better than the one you have.

There is a student version of Maple, which is reasonably priced and has nearly every part of Maple that you likely need - see

https://www.maplesoft.com/products/maple/students/

But I don't think there is a free trial version. Check your institution doesn't have some sort of access to Maple for you.

You say you want database connectivity, but non-SQL, so I suppose you saw the Database package, which would let you interact with JDBC connected databases with SQLlite. Usually there is a client-server model with a database, and the server does the search through the database. If you don't want that, then you will need to read all the "database" data in to search it. Since you say it is too memory intensive to read it all in at once, then I think you are OK with reading it in record by record - that may be slow. You say you looked at fopen so are probably OK with that.

The description of your application suggests you only want to read from the database, not write to it. So if you want to stick with Excel, you will have to use the ExcelTools:-Import to import a range that is a row.  Or you could export your databaase to .csv, and then use fopen and readline or fscanf to read records. Maple has a Record data structure that allows naming fields and may be helpful if your data is structured.

If (in Maple 2017), I open the help page as a worksheet, all the examples run without error. The help page says "types of seasonal influence allowed (name, string, or set of these)", so you can use either A (a name) or "A" (a string). I don't know much about this package but it's often better to use a string since then you don't get into conflicts with variable names that you might have elsewhere in your Maple program.

If you just want to do it for export purposes, you can right-click and change style from polygon with outline to polygon. If you want to do it programmatically, you can add the option stylesheet=[vertexborder=false] to DrawGraph

or just use

b:=a^~2;

(edit: note a and b are really lists, not Vectors)

odeplot can plot many things, see the help page. In your case, you want:

plots[odeplot](sol, [x(t),y(t)],0 .. 10);

If I start from Eq. 12,  and pdsolve in a loop, then it is fairly easy to reproduce this result (pdsolving the whole system didn't seem to work).


 

restart;

eq[0]:=diff(V[0](x,t),t)=0;
ic[0]:=V[0](x,0)=1+cosh(2*x);
ans[0]:=pdsolve({eq[0],ic[0]},V[0](x,t));

diff(V[0](x, t), t) = 0

V[0](x, 0) = 1+cosh(2*x)

V[0](x, t) = 1+cosh(2*x)

n:=5;

5

for i to n do
  eq[i]:=diff(V[i](x,t),t)+I*diff(V[i-1](x,t),x,x)=0;
  ic[i]:=V[i](x,0)=0;
  ans[i]:=pdsolve(eval({eq[i],ic[i]},ans[i-1]),V[i](x,t));
end do:

uu:=collect(add(rhs(ans[i]),i=0..n),t);

1+cosh(2*x)-(4*I)*cosh(2*x)*t-8*cosh(2*x)*t^2+((32/3)*I)*cosh(2*x)*t^3+(32/3)*cosh(2*x)*t^4-((128/15)*I)*cosh(2*x)*t^5

[seq(coeff(uu,t,i),i=0..degree(uu,t))];
gfun:-guessgf(%,t)[1];

[1+cosh(2*x), -(4*I)*cosh(2*x), -8*cosh(2*x), ((32/3)*I)*cosh(2*x), (32/3)*cosh(2*x), -((128/15)*I)*cosh(2*x)]

1+exp(-(4*I)*t)*cosh(2*x)

 


 

Download HPM.mw

assign(solution) will do it.

use the option explicit=true after the set of variables.


 

plot(cos(q),q=0..4*Pi,labels=["",""],axis[1]=[tickmarks=[2*Pi=2*Pi/omega,4*Pi=4*Pi/omega]],axis[2]=[tickmarks=[-1=-R,1=R]]);

 


(No, really, it looks right in the worksheet.)

Download costicks.mw

Plotting to look is always a first step.
 

restart;

eq:=(-69/50)*sin((32/25)*x)=(4/5)*exp((-23/50)*x);

-(69/50)*sin((32/25)*x) = (4/5)*exp(-(23/50)*x)

plot([lhs(eq),rhs(eq)],x=0..10);

 

Looks to be between 2 and 4.

Download hint.mw

fsolve is a numerical solver and Digits controls accuracy... Good luck.

You need the two equations in a set (or list), you had a Y instead of y, and the derivatives as entered weren't right, as can be seen by converting to 1-D input. Here is the worksheet with the right syntax (please check). dsolve ran for about 3 ks in Maple 2017 before I gave up, so in your later version you may (eventually) get a solution.

Ric_Eqns.mw

 

I added some explicit multiplications, so hope that gives what is intended.

Gc := (s^2*t^2+2*s*t*x+1)*(-b*s+1)/(k*(-b*s+1)*s*(t*c+b));

(s^2*t^2+2*s*t*x+1)/(k*s*(c*t+b))

expand(convert(Gc,parfrac,s));

t^2*s/(k*(c*t+b))+2*t*x/(k*(c*t+b))+1/(k*s*(c*t+b))

 

 


 

Download parfrac.mw

To change the default behaviour, set:

_EnvUseHeavisideAsUnitStep := true;

(see the help page for Heaviside)

Or just make a piecewise function

MyStep:=x->piecewise(x<0,0,0<=x,1);

First 64 65 66 67 68 69 70 Last Page 66 of 82