Robert Israel

6582 Reputation

21 Badges

19 years, 51 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

It doesn't crash for me, it just doesn't return a value.  The main problem here is that If R and V are Vectors, R . V will use the complex conjugate of R.  In your case this shouldn't make a difference, because you want t > 2, but Maple doesn't know that when it computes r(t) . v(t).  One way to avoid that is to use the transpose of the first vector, so that "." will be just ordinary vector multiplication: thus r(t)^%T . v(t).

> solve({r(t)^%T . v(t), t > 2, t <= 27}, t);

{t = 13.58622459}, {t = 17.71237270}

Actually, we can simplify it somewhat.

> normal(fnormal(%));

{v[ds](t) = .4958026528*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+9.149694069*exp((30764029.75+1577330139.*I)*t)-(.766755745*I)*exp((30764029.75+1577330139.*I)*t)-(0.3290893603e-1*I)*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.3002643e-3*exp(-10002901.82*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-42.51993430*exp(-10002901.82*t)+0.1702286306e-1*exp(-0.1544864054e11*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+.43114634*exp(-0.1544864054e11*t)+24., v[gs](t) = -0.3674479877e-3*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.8037470713e-2*exp((30764029.75+1577330139.*I)*t)-(0.7193539082e-1*I)*exp((30764029.75+1577330139.*I)*t)-(0.3899911367e-2*I)*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.6005358003e-4*exp(-10002901.82*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-8.504088823*exp(-10002901.82*t)+0.1556340602e-2*exp(-0.1544864054e11*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+0.3941819611e-1*exp(-0.1544864054e11*t)+12.}

The <maple> tag doesn't recognize the typesetting codes for V_in: make that

{v[ds](t) = .4958026528*exp((30764029.75+1577330139.*I)*t)*V[`in`]+9.149694069*exp((30764029.75+1577330139.*I)*t)-(.766755745*I)*exp((30764029.75+1577330139.*I)*t)-(0.3290893603e-1*I)*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.3002643e-3*exp(-10002901.82*t)*V[`in`]-42.51993430*exp(-10002901.82*t)+0.1702286306e-1*exp(-0.1544864054e11*t)*V[`in`]+.43114634*exp(-0.1544864054e11*t)+24., v[gs](t) = -0.3674479877e-3*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.8037470713e-2*exp((30764029.75+1577330139.*I)*t)-(0.7193539082e-1*I)*exp((30764029.75+1577330139.*I)*t)-(0.3899911367e-2*I)*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.6005358003e-4*exp(-10002901.82*t)*V[`in`]-8.504088823*exp(-10002901.82*t)+0.1556340602e-2*exp(-0.1544864054e11*t)*V[`in`]+0.3941819611e-1*exp(-0.1544864054e11*t)+12.}

You could also use evalc to express the complex exponentials in terms of real exponentials times sines and cosines.

Actually, we can simplify it somewhat.

> normal(fnormal(%));

{v[ds](t) = .4958026528*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+9.149694069*exp((30764029.75+1577330139.*I)*t)-(.766755745*I)*exp((30764029.75+1577330139.*I)*t)-(0.3290893603e-1*I)*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.3002643e-3*exp(-10002901.82*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-42.51993430*exp(-10002901.82*t)+0.1702286306e-1*exp(-0.1544864054e11*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+.43114634*exp(-0.1544864054e11*t)+24., v[gs](t) = -0.3674479877e-3*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.8037470713e-2*exp((30764029.75+1577330139.*I)*t)-(0.7193539082e-1*I)*exp((30764029.75+1577330139.*I)*t)-(0.3899911367e-2*I)*exp((30764029.75+1577330139.*I)*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-0.6005358003e-4*exp(-10002901.82*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`-8.504088823*exp(-10002901.82*t)+0.1556340602e-2*exp(-0.1544864054e11*t)*`#msub(mi("V"),mo("in",fontweight = "bold"))`+0.3941819611e-1*exp(-0.1544864054e11*t)+12.}

The <maple> tag doesn't recognize the typesetting codes for V_in: make that

{v[ds](t) = .4958026528*exp((30764029.75+1577330139.*I)*t)*V[`in`]+9.149694069*exp((30764029.75+1577330139.*I)*t)-(.766755745*I)*exp((30764029.75+1577330139.*I)*t)-(0.3290893603e-1*I)*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.3002643e-3*exp(-10002901.82*t)*V[`in`]-42.51993430*exp(-10002901.82*t)+0.1702286306e-1*exp(-0.1544864054e11*t)*V[`in`]+.43114634*exp(-0.1544864054e11*t)+24., v[gs](t) = -0.3674479877e-3*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.8037470713e-2*exp((30764029.75+1577330139.*I)*t)-(0.7193539082e-1*I)*exp((30764029.75+1577330139.*I)*t)-(0.3899911367e-2*I)*exp((30764029.75+1577330139.*I)*t)*V[`in`]-0.6005358003e-4*exp(-10002901.82*t)*V[`in`]-8.504088823*exp(-10002901.82*t)+0.1556340602e-2*exp(-0.1544864054e11*t)*V[`in`]+0.3941819611e-1*exp(-0.1544864054e11*t)+12.}

You could also use evalc to express the complex exponentials in terms of real exponentials times sines and cosines.

Note that squaring a complex quantity doesn't make it real.  Perhaps you mean to square the absolute value.  Again, you probably want to use implicitplot3d to plot a surface abs(u(r,theta,z)) = c for some suitable value of the constant c.

 

Note that squaring a complex quantity doesn't make it real.  Perhaps you mean to square the absolute value.  Again, you probably want to use implicitplot3d to plot a surface abs(u(r,theta,z)) = c for some suitable value of the constant c.

 

You might try using Classic rather than Standard GUI, and exporting programmatically using plotsetup rather than from the menu.  Thus:

> P:= plot3d(whatever):
  plotsetup(eps, plotoutput="c:/mypath/myplot.eps",plotoptions=
   "portrait,noborder,height=3in,width=3in,leftmargin=0in,bottommargin=0in");
  P;
  plotsetup(default);

You might try using Classic rather than Standard GUI, and exporting programmatically using plotsetup rather than from the menu.  Thus:

> P:= plot3d(whatever):
  plotsetup(eps, plotoutput="c:/mypath/myplot.eps",plotoptions=
   "portrait,noborder,height=3in,width=3in,leftmargin=0in,bottommargin=0in");
  P;
  plotsetup(default);

First of all, make sure the function you're trying to plot will give numerical values when given numbers for r, theta, z.  If you gave us the actual Maple input, we might be able to help with that.

Second, what sort of a plot are you looking for?  You have a function of three variables.  It should give you a value at each point of three-dimensional space. 
It's impossible to plot that directly (the graph would have to be a four-dimensional object).  You might, for example, plot the surface f(r, theta, z) = c for some constant c.  This could be done using implicitplot3d in the plots package.  For example:

> plots[implicitplot3d](r^2*sin(theta)^2*exp(-r^2-z^2) = 1/10,
   r = 0 .. 2, theta = -Pi .. Pi, z = -2 .. 2,  
   coords=cylindrical,  view=[-2..2,-2..2,-2..2],  
   axes=box, labels=[x,y,z], style=patchcontour,
   grid=[40,40,40],orientation=[30,60]);

Note: because of a bug, this doesn't work properly without the view option.

First of all, make sure the function you're trying to plot will give numerical values when given numbers for r, theta, z.  If you gave us the actual Maple input, we might be able to help with that.

Second, what sort of a plot are you looking for?  You have a function of three variables.  It should give you a value at each point of three-dimensional space. 
It's impossible to plot that directly (the graph would have to be a four-dimensional object).  You might, for example, plot the surface f(r, theta, z) = c for some constant c.  This could be done using implicitplot3d in the plots package.  For example:

> plots[implicitplot3d](r^2*sin(theta)^2*exp(-r^2-z^2) = 1/10,
   r = 0 .. 2, theta = -Pi .. Pi, z = -2 .. 2,  
   coords=cylindrical,  view=[-2..2,-2..2,-2..2],  
   axes=box, labels=[x,y,z], style=patchcontour,
   grid=[40,40,40],orientation=[30,60]);

Note: because of a bug, this doesn't work properly without the view option.

It works perfectly for me: I get

  0., 0., 0., 0., 0., 0.

which is correct: cos(0)*cosh(0) - 1 = 0.

Perhaps you want different solutions.  You could specify intervals for beta.  For
example:

> seq(fsolve(cos(beta*L)*cosh(beta*L)-1=0, beta = Pi/L .. 2*Pi/L),
   L = 1 .. 6);
 

4.730040745, 2.365020372, 1.576680248, 1.182510186, .9460081490, .7883401241


It works perfectly for me: I get

  0., 0., 0., 0., 0., 0.

which is correct: cos(0)*cosh(0) - 1 = 0.

Perhaps you want different solutions.  You could specify intervals for beta.  For
example:

> seq(fsolve(cos(beta*L)*cosh(beta*L)-1=0, beta = Pi/L .. 2*Pi/L),
   L = 1 .. 6);
 

4.730040745, 2.365020372, 1.576680248, 1.182510186, .9460081490, .7883401241


1) Check your spelling. 

2) Now you have n, m and q as input parameters, but you're not using them as such. 
Instead you're using them as loop indices.  Never do that. Loop indices should be local variables.

3) Your finalmatrix[n,m]; does nothing.

4) You need to assign an entry of finalmatrix after finishing the loop on q, not inside it.

5) You should check whether c1 = r2 before starting your loops, not within them. 
c1 <> r2 should result in an error. not just printing "not calculatable".  You can use an error statement to do this.

6)  Your return statement makes no sense, and shouldn't be inside the loops.  You want to return finalmatrix at the end of the procedure, not in the middle.

1) Check your spelling. 

2) Now you have n, m and q as input parameters, but you're not using them as such. 
Instead you're using them as loop indices.  Never do that. Loop indices should be local variables.

3) Your finalmatrix[n,m]; does nothing.

4) You need to assign an entry of finalmatrix after finishing the loop on q, not inside it.

5) You should check whether c1 = r2 before starting your loops, not within them. 
c1 <> r2 should result in an error. not just printing "not calculatable".  You can use an error statement to do this.

6)  Your return statement makes no sense, and shouldn't be inside the loops.  You want to return finalmatrix at the end of the procedure, not in the middle.

Like this:
 

> subs(RGB=HSV,plot3d(0, x=-3..3,y=-3..3,colour=[argument(-ln(x+I*y)),-abs(ln(x+I*y)),1],
    axes=box,orientation=[-90,0],grid=[101,101],style=patchnogrid));

 

Like this:
 

> subs(RGB=HSV,plot3d(0, x=-3..3,y=-3..3,colour=[argument(-ln(x+I*y)),-abs(ln(x+I*y)),1],
    axes=box,orientation=[-90,0],grid=[101,101],style=patchnogrid));

 

First 42 43 44 45 46 47 48 Last Page 44 of 187