dharr

Dr. David Harrington

8482 Reputation

22 Badges

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

seq(fracdiff(v(t), t,alpha),alpha=-1..1.5,0.5);

gives (1/2)*t^2, .7522527780*t^(3/2), 0., 1.128379167*t^(1/2), 0., 0.

So the ones that are zero are just running along the x-axis and are hard to see.

Click on the plot, and then there will be some controls for the animaton - such as PLAY, Single/continuous cycle etc

Nice worksheet. Some initial thoughts. I guess that a tangent plane can be defined for a point on a surface, and the normal from a pedal point to that plane is well-defined, so the set of all such points where the normal meets the tangent plane can be a pedal surface. The sphere for a point at the centre would be the same sphere, and I think that for any solid of revolution, the pedal surface would be the solid of revolution generated by rotating the pedal curve.

If it is mainly for display then

lprint('fadc_vmon(vmon)'=fadc_vmon(vmon));

gives

fadc_vmon(vmon) = 1638.400000*vmon+200.

For digits to display see the tools -> options -> precision menu.

Note also Maple can convert to various computer languages - see the CodeGeneration package.

Like this? (Not sure what DeltaW is) [Edit: work calculated at end]
 

restart;

with(ThermophysicalData):with(CoolProp):

P__atm:=101325;

101325

T__boil:=Property(temperature, water, pressure = P__atm, Q = 0);
T__gas:=T__boil+0.0001;
T__liq:=T__boil-0.0001;

373.124295847687904

373.1243958

373.1241958

Property(PhaseString, water, pressure = P__atm, temperature = T__liq);
Property(PhaseString, water, pressure = P__atm, temperature = T__gas);

"liquid"

"gas"

Hgas:=Property(Hmolar, water, pressure = P__atm, temperature = T__gas);
Hliq:=Property(Hmolar, water, pressure = P__atm, temperature = T__liq);
Sgas:=Property(Smolar, water, pressure = P__atm, temperature = T__gas);
Sliq:=Property(Smolar, water, pressure = P__atm, temperature = T__liq);

48200.3815860304312

7549.42977094276921

132.491988478210232

23.5445083289082646

For gas -> liquid at the boiling point at 1 atm - delta G should be zero

dH:=Hliq-Hgas;
dS:=Sliq-Sgas;
dG:=dH-T__boil*dS;

-40650.95182

-108.9474802

0.1e-4

Work to compress 1 mol under constant 1 atm pressure until all liquid.

Dmolar is molar density (mol m^-3), so molar volume is the reciprocal of this

Vgas:=1/Property(Dmolar, water, pressure = P__atm, temperature = T__gas);
Vliq:=1/Property(Dmolar, water, pressure = P__atm, temperature = T__liq);

0.3014317605e-1

0.1879786899e-4

W:=-P__atm*(Vliq-Vgas);

3052.352619

Neglecting liquid volume and treating gas as ideal

Wideal:=Property(gasconstant,water)*T__boil;

3102.293958

 


 

Download Thermo.mw

The equation has only one solution:  x=1/e. Implicit plot expects an equation in two variables, such as x+y=3.

Edit: if you really wanted the whole vertical line you can get it, but I would usually use a parametric plot for this.
 

eq:=(1+ln(x))/x=0;

(1+ln(x))/x = 0

plots:-implicitplot(eq,x=0..5,y=0..5);

 


 

Download implicitplot.mw

You can use any font on your system. I don't really understand all the different Computer Modern fonts, but they seem to work. [Edit: Thanks to @acer the update. Image below is from export as .pdf ]

P1 := plot(x^2):
P2 := plot(x^2,
           axesfont=[cmr12,roman,16],
           labelfont=[cmr16,roman,24]):

plots:-display(Array([ P1, P2 ]));

 

 

 

 

Download Latexfonts.mw


 

restart;

with(plots):local D;

Choose four points. We want a family of conics tangent to lines passing through these four points. First generate the lines, using y=m*(x-x0)+y0

pts:=[[1,3/2],[-1/2,1],[-1,-1],[4/3,-3/4]]; #pts in quadrants 1,2,3,4
slopes:=[seq(((dx,dy)->dy/dx)((pts[i]-pts[(i mod 4)+1])[]),i=1..4)]:
lines:=zip((pt,slope)->y=slope*(x-pt[1])+pt[2],pts,slopes);
plotpts:=plot(pts,style=point,colour=red,symbol=solidcircle,symbolsize=15):
plotlines:=plot(rhs~(lines),style=line,colour=blue):
display(plotpts,plotlines,view=[-2..2,-2..2]);

[[1, 3/2], [-1/2, 1], [-1, -1], [4/3, -3/4]]

[y = (1/3)*x+7/6, y = 4*x+3, y = (3/28)*x-25/28, y = -(27/4)*x+33/4]

General conic

gen:=A*x^2+B*x*y+C*y^2+D*x+E*y+1=0;

A*x^2+B*x*y+C*y^2+D*x+E*y+1 = 0

Slope dy/dx at an arbitrary point x,y on the conic.

conslope:=implicitdiff(gen,y,x);

-(2*A*x+B*y+D)/(B*x+2*C*y+E)

So for a point (x[i],y[i]) on a conic to be tangent to line i we require the following three equations to hold for (x,y)=(x[i],y[i]): the eqn of lines[i], conic eqn, slope of tangent = slope of line

eqns:={seq(eval({lines[i],gen,slopes[i]=conslope},{x=x[i],y=y[i]})[],i=1..4)};

{4 = -(2*A*x[2]+B*y[2]+D)/(B*x[2]+2*C*y[2]+E), -27/4 = -(2*A*x[4]+B*y[4]+D)/(B*x[4]+2*C*y[4]+E), 1/3 = -(2*A*x[1]+B*y[1]+D)/(B*x[1]+2*C*y[1]+E), 3/28 = -(2*A*x[3]+B*y[3]+D)/(B*x[3]+2*C*y[3]+E), y[1] = (1/3)*x[1]+7/6, y[2] = 4*x[2]+3, y[3] = (3/28)*x[3]-25/28, y[4] = -(27/4)*x[4]+33/4, A*x[1]^2+B*x[1]*y[1]+C*y[1]^2+D*x[1]+E*y[1]+1 = 0, A*x[2]^2+B*x[2]*y[2]+C*y[2]^2+D*x[2]+E*y[2]+1 = 0, A*x[3]^2+B*x[3]*y[3]+C*y[3]^2+D*x[3]+E*y[3]+1 = 0, A*x[4]^2+B*x[4]*y[4]+C*y[4]^2+D*x[4]+E*y[4]+1 = 0}

So we have 12 equations and 13 variables: 8 for the coordinates of the four points and the 5 conic parameters. We choose x[1], the x coordinate of the tangent point on line 1 as the control point, and solve for the others in terms of it. Then substitute the parameters ino the general eqn to find the conic for this x[1]

params:=solve(eqns,{y[1],x[2],y[2],x[3],y[3],x[4],y[4],A,B,C,D,E}):
con:=eval(gen,params);

-(-105664*x[1]^2-710752*x[1]-809209)*x^2/(1487929*x[1]^2-796628*x[1]-626276)-(349744*x[1]^2+2229952*x[1]+21304)*x*y/(1487929*x[1]^2-796628*x[1]-626276)-(-98256*x[1]^2-293088*x[1]-649056)*y^2/(1487929*x[1]^2-796628*x[1]-626276)+2*(272584*x[1]^2+255787*x[1]-203246)*x/(1487929*x[1]^2-796628*x[1]-626276)-8*(80083*x[1]^2-42611*x[1]+27553)*y/(1487929*x[1]^2-796628*x[1]-626276)+1 = 0

display(seq(implicitplot(con,x=-4..4,y=-4..4,colour=black,gridrefine=2),x[1]=-2..2,0.3),plotpts,plotlines,axes=none,view=[-4..4,-4..4]);

 


 

Download Pencil3.mw

With some values of M and R and selected initial condition you can get a numeric solution with

dsolve(eval(sys,{M=2,R=1}) union {y(0)=2},y(r),numeric);

If you try the intial condition y(0)=1, you get the message that there is a singularity and it will work only with two initial values. This is probably why you can't get a series solution about r=0. But perhaps that's not what you want? it should be a start

You are assuming we know what field you are working in, but I don't really know what you want. A simple plot shows that the range of g is -infinity..infinity, so that is the answer to the direct question asked. But now you mention evalc, so perhaps you want the poles in the complex plane?
 

g:=1/(x+x^2+x^3+2)

1/(x^3+x^2+x+2)

plot(g,x=-10..10);

Poles of g in complex plane

fsolve(1/g,complex);
plots:-complexplot([%],style=point,symbolsize=15,symbol=solidcircle,color=red);

HFloat(-1.3532099641993245), HFloat(0.17660498209966224)-HFloat(1.202820819285479)*I, HFloat(0.17660498209966224)+HFloat(1.202820819285479)*I

 

 

Download gain.mw

Here is how I would do it - can be refined for nicer spacing etc.

restart;

with(plots):local D;

Four points. We want a family of conics passing through these four points

pts:=[[1,3/2],[-1/2,1],[4/3,-3/4],[-1,-1]];
p1:=plot(pts,style=point,colour=red,symbol=solidcircle,symbolsize=15):display(p1);

[[1, 3/2], [-1/2, 1], [4/3, -3/4], [-1, -1]]

General Conic, scaled so constant (F) = 1

gen:=A*x^2+B*x*y+C*y^2+D*x+E*y+1=0;

A*x^2+B*x*y+C*y^2+D*x+E*y+1 = 0

Equations to be satisfied at the four points and at a general 5th point (X,Y), which we will vary

eqns:=[eval(gen,[x=X,y=Y]),map(i->eval(gen,{x=i[1],y=i[2]}),pts)[]];
solve(eqns,[A,B,C,D,E]);
con:=eval(gen,%[]);

[A*X^2+B*X*Y+C*Y^2+D*X+E*Y+1 = 0, A+(3/2)*B+(9/4)*C+D+(3/2)*E+1 = 0, (1/4)*A-(1/2)*B+C-(1/2)*D+E+1 = 0, (16/9)*A-B+(9/16)*C+(4/3)*D-(3/4)*E+1 = 0, A+B+C-D-E+1 = 0]

[[A = -6*(1321*X*Y-3028*Y^2+471*X+873*Y+3051)/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y), B = (7926*X^2-2144*Y^2-3455*X+3836*Y-5401)/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y), C = -4*(4542*X^2-536*X*Y-2171*X+1844*Y-4333)/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y), D = (2826*X^2+3455*X*Y-8684*Y^2+3651*Y+6054)/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y), E = (5238*X^2-3836*X*Y+7376*Y^2-3651*X-12429)/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)]]

-6*(1321*X*Y-3028*Y^2+471*X+873*Y+3051)*x^2/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)+(7926*X^2-2144*Y^2-3455*X+3836*Y-5401)*x*y/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)-4*(4542*X^2-536*X*Y-2171*X+1844*Y-4333)*y^2/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)+(2826*X^2+3455*X*Y-8684*Y^2+3651*Y+6054)*x/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)+(5238*X^2-3836*X*Y+7376*Y^2-3651*X-12429)*y/(18306*X^2+5401*X*Y-17332*Y^2-6054*X+12429*Y)+1 = 0

Check it out. Conic to pass through (-1/2,-3/4).

con1:=eval(con,{X=-1/2,Y=-3/4});
c1:=implicitplot(con1,x=-2..2,y=-2..2,colour=black):display(c1,p1);

(66/109)*x^2+(200/327)*x*y-(512/327)*y^2-(5/109)*x+(76/109)*y+1 = 0

So we just need to systematically vary X,Y

controlpts:=[seq([X,0.7*X],X=-2.1..2,0.5)];
c:=map(i->eval(con,{X=i[1],Y=i[2]}),controlpts): #list of conics

[[-2.1, -1.47], [-1.6, -1.12], [-1.1, -.77], [-.6, -.42], [-.1, -0.7e-1], [.4, .28], [.9, .63], [1.4, .98], [1.9, 1.33]]

display(seq(implicitplot(c[i],x=-2..2,y=-2..2,colour=black),i=1..nops(c)),p1,axes=none);

 

 

Download Pencil.mw

I removed the with(orthopoly) since they aren't needed. I think you want to return the procedures themselves, so you need:

return psi,w; in each of functionA and functionB. Then it works.

Package.mw

packagecall.mw

 

As @acer pointed out in answer to your recent question here the way around this is to create the array outside the procedure and pass it as an argument to the procedure. I use compile quite a bit and usually end up passing many Arrays (or Vectors or Matrices); as @mmcdara says, there are lots of limitations.

convert(f,pwlist) puts the pieces in a list for easier manipulation.

Sounds like you are using worksheet mode rather than document mode. Try the view menu, choose show/hide contents and unclick input.

First 54 55 56 57 58 59 60 Last Page 56 of 83