dharr

Dr. David Harrington

2403 Reputation

15 Badges

17 years, 146 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 professor of chemistry at the University of Victoria, BC, Canada, where my research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@robertocooper The initial or boundary conditions are determined by the physical problem, and the solution depends on them, so you need to know them for your case. Here I plot for U(0)=0, D(U)(0)=1.

PDE2.mw

 

@robertocooper The solution still has two unknown constants _C1 and _C2, whose values can only be found if you specify two boundary/initial conditons, e.g. U(0)=0, D(U)(0)=1. Then plots can be made, but since the PDE solution is complex what exactly do you want to plot?

This is hard to diagnose unless you upload a .mw file that illustrates the two results. Use the fat green up-arrow, choose the file and upload with "insert link".

@jat741 unapply turns a result you already have into a function, which you can then use for plots etc. In general you should not cut and paste from output to input or retype results.

PDEPlot.mw

@robertocooper I missed the point that the eqn for v was to be derived from the imaginary part, and have added an edited version transform4.mw to my answer above. In your second example, you divided by exp(I*mu), but that left you with a mix of old and new variables. I tidied it up a bit. (I usually leave off the =0 in eqns since dsolve, solve etc understand this as default, and then I do not have to worry whether various simplifications apply automatically to both sides of an eqn or not.)

For the subs, I'm not sure if you are asking a mathematical or Maple question. For the mathematical question, abs(z) is the magnitude of the complex quantity z=r*exp(I*theta), i.e., abs(z)=r. From the Maple point of view, using subs does a substitution without doing any simplification, i.e.,  just syntactic substitution. I didn't want any attempt to try to apply diff to abs. More usually I would used eval(expr,a=b) rather than subs(a=b,expr) since it is smarter about math things. But here eval messed with the PDE too much. 

newcode2.mw

Use I for sqrt(-1) in Maple (or use interface(imaginaryunit=i) to change the default). To force evaluation to real and imaginary parts use evalc. I assumed everything was positive, but you can use some other assumptions if that is not right, You can get simpler forms using simplify, but the abs() is problematic here, 

transform.mw

Providing an approximate solution with the approxsoln option often works here - it can be anything with approximately the right shape, but you have to know something about what you expect.

@dharr I realised that the Q value is intended to select the right phase; the Maple help and coolprop website are not very clear on this.

So this is a better way to do this (worksheets not displaying these days):

Thermo.mw
 

 

@Ronan I edited my original answer with an improved code. Your code agreed with the Matrix. This may be useful in my work, so thanks for introducing me to the Boole-Mobius transform.

@Carl Love  To get the same output as Ronan I needed to switch jm and h in the updates line to become:

(im, istep, h, jm):= Scale2~([im, istep, h, jm], [-1$3, 1])[]

Not sure if this affects speed because I know modular was updated after the version I have (2017)
 

@Ronan I usually use Compiler:-Compile when I'm debugging, since there are many limitations about what Maple code can be compiled, but once I know it does compile then you can just add option autocompile after the proc() and the compiling will be automatic on first execution (and so the procedure can be used in a module or package, and the dll will be generated automatically). 

@student_1 Yes, fracdiff(v(t), t,0) gives t but fracdiff(v(t), t,0.) gives 0. The solution is to use seq(fracdiff(v(t), t,alpha/2),alpha=-2..3)

@MajorMax So this is just the plot command

plot((1+ln(x))/x,x=-5..5,view=[-5..5,-5..5]);

 

@nm There are many Computer Modern fonts on my system (I use Scientific Workplace) and I don't know which are which - I just chose cmr12 and cmr16 at random, but cmbxti10 looks more like what you want. The above x may just be the standard one. 

P1 := plot(x^2):
P2 := plot(x^2,labels=["x","y"],axesfont=[cmr12,roman,16],
           labelfont=[cmbxti10,roman,24]):
plots:-display(Array([ P1, P2 ]));

gives (snapshot from export to .pdf

Latexfonts.mw

@Earl  You/re welcome. As you probably realize, if the control point just goes  x[1] = pts[2][1]..pts[1][1] you will just get the centre part with ellipses in the quadrilateral, which you asked about in a separate question..

3 4 5 6 7 8 9 Last Page 5 of 25