dharr

Dr. David Harrington

8672 Reputation

22 Badges

21 years, 75 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

You can use display to get all the plots statically displayed together. Animate (or display with insequence=true) can display them sequentially in an animation. For your case with static display use something like this
restart;with(plots):
Zin:=(a,b,c,d,e,f,omega)->a*sin(omega*b)+c+d+e+f;
display([seq(plot(Zin(1+0.2*i,1,0,0,0,0,omega),
        omega=0..2*Pi),i=0..3)]);
you can define operators with various properties (linearity, etc) and they can be non-commutative. Perhaps this is what you mean; see help for "define". But I don't think there would be much of the knowledge of matrices and vectors that you could build in (e.g. singular matrix times non-singular = singular).
Maple doesn't have abstract matrices in the sense that you want; you have to work with matrices and vectors with symbolic entries.
In the help page for plot,device, it says gif takes height and width parameters for number of pixels. So something like this works plotsetup(gif,plotoutput="C:/plot.gif", plotoptions="height=500,width=500"); (This can also be done via the interface command.)
You can also add rows by premultiplying by a row vector with all its entries 1
Without looking too much at the details of your example, if you have an equation for voltage as a function of current density, j, such as V:=2.5-5*j; then it is plotted as plot(V,j=0..0.5); If you really want discrete points, then there are a lot of ways to do it; one would be (intervals of dt) dt:=0.1; plot([seq([i*dt,eval(V,j=i*dt)],i=0..5)],style=point);
I think that you can't expect much better efficiency for a symbolic solution. It raises the issue of what would be the use of a 40 variable symbolic system over a numerical solution. Typically you want a symbolic solution to see some pattern or test some conjecture; if you can't see the pattern with a smaller system then you probably need to refine what exactly you need. Are all variables required or just one? Does the matrix have some special structure that could make it easier (symmetric or sparse or a tree graph, perhaps)? Do you want to see how the solution varies with some parameter? Depending on the answer, you can seek more specific algorithms.
The maximum number of digits for an integer is system dependent; on my Windows system running Maple 10 it is: kernelopts(maxdigits); 268435448 But to do your combination example I'd take logs: If C=m!/((m-n)!n!), then lnC = ln m! - ln(m-n)! -ln(n!) and using Stirlings approximation ln n! = n*ln(n)-n means we can calculate it in Maple like: S:=x->x*ln(x)-x: lnC:=S(5e10)-S(5e10-1e4)-S(1e4); #may be some loss of significanve in the second term lnC := 163896.5963 So log to base 10 is log10C:=lnC/ln(10.); log10C := 71179.38738 So the answer is 10 to this power: 10^log10C; 0.2439944793e71180 (You could work Stirling to find the largest integer that you can find the factorial of, given the maximum number of digits for an integer.)
There is a "stop_cond=" option that does what you want. See the help page ?dsolve,Stop_Conditions
restart: z:=1; type(z,Range(1,10)); is(z,RealRange(1,10)); returns false true
pointplot will plot points: with(plots): pointplot([[1,1],[2,2],[3,5],[4,4],[5,3]]); If you have lists you need to manipulate into this form, you can use zip: ycoord:=[1,2,5,4,3]:xcoord:=[1,2,3,4,5]: zip((x,y)->[x,y],xcoord,ycoord);
A lot depends on how you are generating your lists of numbers. If I understand correctly, you want something like this: f:=proc(C,D,E,F,G,H,K,L,M,N,O,P) local A,B,II,J; A:=3;B:=5;II:=5;J:=6; ((A/B)^(3/2)*(C*D*E/F*G*H)/(II/J)^(3/2)* (K*L*M/N*O*P)) end proc: Define a sequence or list of numbers seq1:=1,2,3,4,5,2,3,4,5,3,3,1; list1:=[1,2,3,4,5,2,3,4,5,3,3,1]; then the following are equivalent: f(seq1); f(op(list1)); f(list1[]); And pass the 11 lists to the procedure in a loop. You could also pass the list rather than its contents to the procedure and have the procedure get the numbers out of the list with op(list) But perhaps you want the 11 lists related in some way; I'm not sure I understand since there are more than 11 values which are not constant.
Since you want a numerical answer, just give values of mu or T. Success may depend on the values (x>mu or not, perhaps), but this works for at least one set of values. f:=sqrt(x)/(exp((x-mu)/T)+1); eval(f,{mu=-10,T=300}); evalf(Int(%,x=0..infinity));
I'd leave out the integral in dsolve, get the answer with an unknown constant, and then use the equation with the integral to find the unknown constant: sol2:=rhs(dsolve({diff(c(x),x,x)=c(x) , c(0)=5},c(x))); sol2 := (5 - _C2) exp(x) + _C2 exp(-x) > eq:=int(sol2,x=0..1)=3; eq := -5 + 2 _C2 + 5 exp(1) - _C2 exp(1) - exp(-1) _C2 = 3 > solve(eq,_C2); > eval(sol2,_C2=%);
The following works, but I'll let someone else explain why your code doesn't. TestProc:= proc (s) subsop(3=5,s) end proc;
First 78 79 80 81 82 83 84 Page 80 of 84