dharr

Dr. David Harrington

8330 Reputation

22 Badges

21 years, 3 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 replies submitted by dharr

@Carl Love As I recall, that was the standard for FORTRAN E format, and you needed a 1P modifier to get it the way it should be, i.e., as you stated.

The message is clear -- the presence of eta+S makes this a delay DE, and you have boundary conditions, e.g., theta(10)=0, and Maple can't solve such equations (except S=0).

@yasi 

Your figure had the z-axis going too high, so I solved that problem. Because you used "seq(0.312^i,i=1..4,1), which produces numbers equally spaced on a log axis, I pointed you in that direction. The tick labels in the list go at the numbers they represent. You want them "in the grid place". Surely you do not mean an equally spaced grid as now and the list of numbers in places that are not correct for numbers in the plot? I suspect that can be done, but I don't know how to do that. Perhaps you mean a non-evenly spaced grid? I'll let you figure out how to do that.

If by the z-axis shortened mean the whole figure scaled, see the size option.

Obviously, I'm not good at understanding you, so I'll let others respond from now on. 

@yasi The range plotted is determined by the view option, which is currently 3e-10..3e-7, so change to z_min..z_max or whatever you want. For the ticks, you can just put them in the list instead of generating them with seq: [1e-7,3e-8,5e-9,9e-10]

If you want a log scale, then you will have to specify that with the axis option, or take the log of the data, but then I'm not sure what you want with the grids.

yas.mw

@Deeshani I do not understand what you want to do in your overall question, but the piecewise plot can be simply plotted as on the attached. The ode solution was called "m", but you were plotting "sol".

plot.mw

@pointerbender I agree that probably the mean is just calculated from the sum. But leaving out u(0)=0 didn't help, which seemed to suggest it needed to look like a recursion, even if it wasn't. The help page perhaps implies that having the start at n=0 rather than n=1 is the way it works internally, which is why I went for that. But if it works for u(1)=x[1]. even better.

Perhaps if you upload a worksheet with the expression in to save someone typing it in you will get a response. Use the green up-arrow in the editor.

@ContrapuntoBrowniano Not clear if you want to use different arguments or the original parameters. Here are both ways.

restart

F := proc (x, y, z) options operator, arrow; (r[x]+r[y])*r[z] end proc;

proc (x, y, z) options operator, arrow; (r[x]+r[y])*r[z] end proc

If you want the answer to depend on the arguments, then they need to be provided. Type function is a name with some arguments, such as f(x)

G:=proc(f::uneval,n);
     if not type(f,function) then error "arguments need to be provided with %1",f end if;
     (add(op(f))+eval(f)/2)*n
   end proc:

G(F(a, b, c), 3)

3*a+3*b+3*c+(3/2)*(r[a]+r[b])*r[c]

G(F, 3)

Error, (in G) arguments need to be provided with F

If you want always to use the parameters that F was defined with

H:=proc(f::procedure,n) local params;
     params:=op(1,eval(f));
     (add(params)+f(params)/2)*n;
   end proc:

H(F, 3);

3*x+3*y+3*z+(3/2)*(r[x]+r[y])*r[z]

``

 

Download function.mw

Edit: For Maple 18 use add(i, i in op(f)) and add(i, i in params)

@yasi From your email: "How to show axis z representation as power numbers?(1.1E-7 to 1.1E-3) And the shape should be only lines and not colored". 

For the color, use color=white (and perhaps make the lines thicker with thickness=2). You need color to do hidden lines - if you use style=wireframe, all the lines show through. It looks a little glaring with color=white, perhaps because you chose lightmodel=none. You could perhaps change the lightmodel or choose an off-white color.

In my opinion, axes labels should never be written in this way, instead the plot should be scaled (as I explained earlier) so the numbers are human-friendly, say in the range 0..1, and the scaling should be explained in the axis label, e.g. 1000*error.

But you can individually choose a label for each tickmark, formatted with sprintf as requred, as shown here.

zticklabels := map(x->x = sprintf("%.0e", x), [seq(0.1e-3*i, i = 2 .. 10, 2)])

Default lightmodel.

(not all ticks rendered correctly here)

 

Or with lightmodel=none:

Yasi3.mw

 

@nm The y range is the default one, which is what DEFAULT means. If another range has been chosen, then it will be there. 

p := plot(sin(x), x = -1 .. 10):

v := op(select(type, p, specfunc(VIEW)));

VIEW(-1. .. 10., DEFAULT, _ATTRIBUTE("source" = "mathdefault"))

p := plot(sin(x), x = -1 .. 10, view = [-2 .. 9, DEFAULT]); -1; v := op(select(type, p, specfunc(VIEW)))

VIEW(-2 .. 9, DEFAULT)

p := plot(sin(x), x = -1 .. 10, view = [-2 .. 9, 0 .. 1]); -1; v := op(select(type, p, specfunc(VIEW)))

VIEW(-2 .. 9, 0 .. 1)

p := plot(sin(x), x = -1 .. 10, 0 .. 1); -1; v := op(select(type, p, specfunc(VIEW)))

VIEW(-1. .. 10., 0. .. 1.)

``

Download view.mw

@mehdi jafari Your revised PDE is much simpler to solve, but it still needs one more boundary/initial condition as @tomleslie pointed out. As he also pointed out, if an analytical solution could be found, it would have one arbitrary constant. That is the case here, where your solution still contains _C1.

@dharr So I added in the surfdata, which I think is what you want. I really don't understand why the bottom of the z range wouldn't be zero. The managing of the ticks and ranges could be improved, since some are done locally and some passed to the procedure. surfdata needs to know what range the data is over, which has to be 0.1..0.9, even if the plot goes from zero to 1. You could read the 0.1..0.9 in from the Excel file. Note the three plot ranges can be given in the view option.
 

NULL

restart

grids := proc (M, x_min, x_max, y_min, y_max) local z_min, z_max, plot_f, xz, yz, xy; z_min := 0.11e-6; z_max := 0.1e-2; plot_f := plots:-surfdata(M, .1 .. .9, .1 .. .9); xz := plot3d([x, y_min, z], x = x_min .. x_max, z = z_min .. z_max, style = line, color = blue, thickness = 0, grid = [6, 6]); yz := plot3d([x_min, y, z], y = y_min .. y_max, z = z_min .. z_max, style = line, color = blue, thickness = 0, grid = [6, 6]); xy := plot3d([x, y, z_min], x = x_min .. x_max, y = y_min .. y_max, style = line, color = blue, thickness = 0, grid = [6, 6]); plots:-display(plot_f, xz, yz, xy, lightmodel = none, tickmarks = [6, 6, 6], labels = [x, y, "Error"], labeldirections = [horizontal, horizontal, vertical], axes = frame, orientation = [45, 70, 0], view = [0 .. 1, 0 .. 1, 0.11e-6 .. 0.1e-2]) end proc:

dat := ExcelTools:-Import(cat(currentdir(), "/PlotTest.xlsx"), 1, "B2:J10"):

grids(dat, 0, 1, 0, 1);

NULL

NULL

 

Download Yasi2.mw

@yasi You can use display to combine the surfdata with your plot3d grids. If you want to scale the data by 1000, say, you can use 1e3*~dat.

If you aren't happy with any of the answers here, you need to explain exactly what you want - what is the image showing?

You should upload your worksheet using the green up-arrow in the editor.

First 56 57 58 59 60 61 62 Last Page 58 of 87