dharr

Dr. David Harrington

5712 Reputation

21 Badges

20 years, 348 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

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.

MaplePrimes Activity


These are answers submitted by dharr

I suspect you want gcdex(x^9-a, b*x^6-c, x); but the answer is 1. You may need to specify the numerical value of more of the coefficients.

Try

T := unapply('fsolve'(m(t, c) = -1, t = 0 .. (1/2)*Pi), c, numeric);

In general use unapply to make functions from expressions earlier in the worksheet. The numeric option means that plot and other functions evaluated with a symbolic value will not throw an error.

So the constant _C3 means another condition is required. Presumably you want the solution to drop off at y=infinity.

pdetest suggests your solution does not solve the pde.
 

Download pde.mw

Use := to assign the right-hand side to the left. Some other issues also:

v:= <1 |1| 0>;
w:=<1,1,0>;
M:=<1, 2, 3; 5, 4, 3; 7, 9, 0>;
c:=v.M;
d:=M.w;

v := Vector[row](3, {(1) = 1, (2) = 1, (3) = 0})

w := Vector(3, {(1) = 1, (2) = 1, (3) = 0})

M := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 5, (2, 2) = 4, (2, 3) = 3, (3, 1) = 7, (3, 2) = 9, (3, 3) = 0})

c := Vector[row](3, {(1) = 6, (2) = 6, (3) = 6})

d := Vector(3, {(1) = 3, (2) = 9, (3) = 16})

 


 

Download vectors.mw

Try entering in 1D Maple input, e.g. at a > prompt use ctrl-M then `&le;`

You will see that `&le;` is rendered as less-than-or-equals, as it would be in HTML.

Changes in red.
 

 RK2skritt:=proc(FR::procedure,xo,yo,vxo,vyo,h)
 local x, y, vx, vy, r, kx1, kx2, kx3, kx4, ky1, ky2, ky3, ky4, lx1, lx2, lx3, lx4, ly1, ly2, ly3, ly4, tmp;
 r:=sqrt(xo*xo+yo*yo);
 tmp:=-(h*FR(r))/(r);
 lx1:=h*vxo;
 ly1:=h*vyo;
 kx1:=tmp*xo;
 ky1:=tmp*yo;
 lx2:=h*(vxo+0.5*kx1);
 ly2:=h*(vyo+0.5*ky1);
 r:=sqrt((xo+0.5*lx1)^(2)+(yo+0.5*ly1)^(2));
 tmp:=-(h*FR(r))/(r);
 kx2:=tmp*(xo+0.5*lx1);
 ky2:=tmp*(yo+0.5*ly1);
 lx3:=h*(vxo+0.5*kx2);
 ly3:=h*(vyo+0.5*ky2);
 r:=sqrt((xo+0.5*lx2)^(2)+(yo+0.5*ly2)^(2));
 tmp:=-(h*FR(r))/(r);
 kx3:=tmp*(xo+0.5*lx2);
 ky3:=tmp*(yo+0.5*ly2);
 lx4:=h*(vxo+kx3);
 ly4:=h*(vyo+ky3);
 r:=sqrt((xo+lx3)^(2)+(yo+ly3)^(2));
 tmp:=-(h*FR(r))/(r);
 kx4:=tmp*(xo+lx3);
 ky4:=tmp*(yo+ly3);  #edit - one more here
 x:=xo+(lx1+2*lx2+2*lx3+lx4)/(6);
 y:=yo+(ly1+2*ly2+2*ly3+ly4)/(6);
 vx:=vxo+(kx1+2*kx2+2*kx3+kx4)/(6);
 vy:=vyo+(ky1+2*ky2+2*ky3+ky4)/(6);
 [x,y,vx,vy]; end proc:

 

 

Download proc.mw

There is a missing *. The differentiation works in Maple 2017.
 

Download Diff.mw

 

 

restart

Case 1

de1:=diff(U(x),x,x)=0;
bc1:=U(0)=10,U(L)=20;
ans1:=dsolve({de1,bc1},U(x));

diff(diff(U(x), x), x) = 0

U(0) = 10, U(L) = 20

U(x) = 10*x/L+10

Case 2

de2:=diff(U(x),x,x)=-x^2;
bc2:=U(0)=T,D(U)(L)=0;
ans2:=dsolve({de2,bc2},U(x));

diff(diff(U(x), x), x) = -x^2

U(0) = T, (D(U))(L) = 0

U(x) = -(1/12)*x^4+(1/3)*L^3*x+T

 

 


 

Download rod.mw

Like this?

NULL

restart

n := 4; C := proc (K) options operator, arrow; Vector([seq(cos(2*Pi*K*l/n), l = 0 .. n-1)]) end proc; S := proc (K) options operator, arrow; Vector([seq(sin(2*Pi*K*l/n), l = 0 .. n-1)]) end proc

4

proc (K) options operator, arrow; Vector([seq(cos(2*Pi*K*l/n), l = 0 .. n-1)]) end proc

proc (K) options operator, arrow; Vector([seq(sin(2*Pi*K*l/n), l = 0 .. n-1)]) end proc

C(2); S(3)

Vector[column]([[1], [-1], [1], [-1]])

Vector[column]([[0], [-1], [0], [1]])

These two are orthogonal

C(2).S(3)

0

C(2).C(2)

4

 

NULL


 

Download orthogonal.mw

I did G11; the others are similar

Transfer_function.mw

In the File Menu under Document Properties, you should have an attribute named Active which is false for a regular help page and true for an active worksheet.

in 1D input:

ode:=diff(y(x),x,x)=2*y(x)+1;
dsolve(ode);
 

does work, so this is probably incorrect entry of the derivative in 2-D math. [Edit: actually the error message confirms this.] Use the right-click menu 2-D math/convert to 1D math input and see if it looks like the above. If not, use 1-D input (ctrl-M) before the input, or use the expression palette for the derivative and use "^" to raise the powers of 2.

I don't understand exactly what you mean - if you want real-only frequency domain, you need the time domain array to have the real part  symmetric about the centre and the imaginary part antisymmetric about the centre.

Edit: And here is a complex example that works pretty much as I would expect:

restart;

with(DiscreteTransforms):

N:=2^10;df:=.2;dt:=1/df;T1:=500.;

1024

.2

5.000000000

500.

tvec:=Vector(N,i->i*dt):
fvec:=Vector(N,i->i*df):

fidr:=Vector(N,i->cos(2*Pi*df*i)*exp(-dt*i/T1)):
fidi:=Vector(N,i->sin(2*Pi*df*i)*exp(-dt*i/T1)):
fid:=fidr+I*fidi:

plot(tvec,fidr);

spec:=FourierTransform(fid):

plot(fvec,map(abs,spec)); #magnitude

plot(fvec,map(Im,spec));  #imaginary part

plot(fvec,map(Re,spec));  #real part

 


 

Download fid.mw


 

restart;
with(ThermophysicalData);
with(ThermophysicalData[CoolProp]);
fluid := "R717"; T__in := 310; p__in := 11*10^5; v__in := 10;  A := 0.005;
h__in := Property(massspecificenthalpy, T = T__in, P = p__in, fluid);
rho__in := Property(density, T = T__in, P = p__in, fluid);
m := A*v__in*rho__in;
p__out := 2*10^5;
eq1 := h__out = Property("massspecificenthalpy", "temperature" = T__out, "P" = p__out, fluid);
eq2 := rho__out = Property("D", "temperature" = T__out, "P" = p__out, fluid);
eq3 := h__in + v__in^2/2 = h__out + v__out^2/2;
eq4 := m = A*v__out*rho__out;

res := fsolve({eq1, eq2, eq3, eq4});

[CoolProp, PHTChart, Property, PsychrometricChart, TemperatureEntropyChart]

[HAPropsSI, PhaseSI, Props1SI, PropsSI]

"R717"

310

1100000

10

0.5e-2

1655590.94731116970

8.15132757401520891

.4075663787

200000

h__out = ThermophysicalData:-Property("massspecificenthalpy", "temperature" = T__out, "P" = 200000, "R717")

rho__out = ThermophysicalData:-Property("D", "temperature" = T__out, "P" = 200000, "R717")

1655640.947 = h__out+(1/2)*v__out^2

.4075663787 = 0.5e-2*v__out*rho__out

{T__out = 285.0179004, h__out = 1654113.289, v__out = 55.27490598, rho__out = 1.474688637}

 


 

Download CoolProp.mw

Under the file/open menu, you can open a Mathematica notebook. I haven't tried this, but presumably it automates what can be done by the commands that @tomleslie pointed out.

First 40 41 42 43 44 45 46 Last Page 42 of 61