## dharr

Dr. David Harrington

## 4439 Reputation

18 years, 277 days
University of Victoria
Professor or university staff

## Social Networks and Content at Maplesoft.com

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.

## plot...

@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

## nice...

@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.

## inputs and outputs...

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

 >
 >

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:
 >

 >

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:
 >

 >

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

## tickmark labels...

@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

## y range is DEFAULT...

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

 >
 >

 >

 >

 >

 >

## still need another condition...

@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.

## update...

@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.

 >
 >
 >
 >

 >
 >

## display...

@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.

## another duplicate deleted...

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.

## interesting...

@Rouben Rostamian  I missed your comment as I was writing my method. Perhaps my answer then is GIGO. It would be nice to have an analytical solution. I think in general an incompatiblilty in the initial condition can just indicate a step change (intended) in conditions at t=0, such as putting a uniform temperature object in contact with a freezer at t=0, forcing the boundary temperature immediately to a lower value. But I didn't think about the lack of a t derivative in this context.

## IC...

@ijuptilk The theta(z,0) = thetab*sin(pi/2)*z IC is not compatible with the theta(d,t)=0 BC. Is this intended? And sin(pi/2)=1 so is this right?

## crossing/non-crossing...

@C_R Don't know much about Maplesim, but for electronics schematics (circuit diagrams), they moved away from arcs for non-crossing. They then went to a dot on the intersection if there was a connection, but the newer way is that connections are always at a T.

## coupled...

@nm Since v and theta are coupled, the time dependence of theta induces a time dependence of v. pdsolve (without any boundary/initial conditions) gives a general analytical solution where both theta and v are functions of z and t. Whether or not this solution can be made to fit the ic/bcs is not clear to me.

 First 11 12 13 14 15 16 17 Last Page 13 of 42
﻿