dharr

Dr. David Harrington

8235 Reputation

22 Badges

20 years, 341 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

Adding to @Carl Love's method, you can just plot a circle in a square, and then use the view option of plot to have different ranges for the vertical and horizontal axes.

Not sure I fully understand. But if you just want Dist to access Sqr then

Dist := proc (X) Sqr(X) end proc;

and then

Test:-Dist(b)

will return b^2. Is this what you want?

Your ode_y differential equation is second order in time, so can have only two initial conditions, but you supplied 12.

I'm using Maple 2017, but I don't think that matters. I could probably check my guess below by looking at the code, but that's a lot of work.
 

restart;

infolevel[dsolve]:=5;

5

(1)

ode:=diff(y(x),x)=x*ln(y(x));

dsolve(ode,y(x));

diff(y(x), x) = x*ln(y(x))

 

Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
<- separable successful

 

y(x) = exp(RootOf(x^2+2*Ei(1, -_Z)+2*_C1))

(2)

dsolve([ode,y(1)=1],y(x)); #no user information printed

y(x) = 1

(3)

dsolve([ode,y(1)=3],y(x)); #but there is here

 -> Computing symmetries using: way = 3

 -> Computing symmetries using: way = 2
 -> Computing symmetries using: way = patterns
   -> The symmetry found is [1/x 0]
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
<- separable successful

 

y(x) = 1/exp(RootOf(x^2+2*Ei(1, _Z)-2*Ei(1, -ln(3))-1))

(4)

So I'm guessing that it tries the special case y(x)=y(1) and never gets to a deeper analysis.


 

Download ode.mw

There can be some confusion about currentdir() as follows. If I open Maple from a shortcut/start menu etc and in a blank worksheet type currentdir() then it tells me some location where my Maple installation is; probably not a place I want to save a file. If I then save the worksheet somewhere useful, say on my desktop, close Maple and then open the worksheet I've just saved by double-clicking on it, now currentdir() shows my desktop location and files will be saved there.

I tend to type 1D math into 2D math input regions, and so something like Int(x^2,x=0..infinity) (where I typed right-arrow after the 2) produces the right output, but the Int and infinity don't change to their nice forms. If I want to change them as I go, then I use ^ (or @acer's escape is better), but if I want to change the whole thing to look better, I use the right-click menu 2-D math/convert to/2D math input, and then everything will be converted to the nice form. (Or I start with a 1D math execution group, do it all in 1D math, then convert it). So convert will work after you paste 1D math into a 2D region.

I don't know of any way to convert all instances in a worksheet.

If in 2D math you have "theta" and want it to display as a symbol, go to the end of the word and enter ^ as though you were to raise it to a power - it will change to the symbol. You can then get out of there (by a right-arrow)

If I copy the parameters list to a new line in 1D mode it looks like

parameters = [`A,l, m,n,mu,k ,q,r,u,v,sigma, iota, nu, phi,`*upsilon, w, x, delta, g];

The back quotes at the beginnning of the list and then before the * and the * itself are presumably not intended. Fixing this up removes the error. This is also the problem with the sse procedure and chack it is OK later.

Then your ICs should be separated by commas, not colons:

ic := B(0) = 700, C(0) = 16100, P(0) = 300, E(0) = 250, F(0) = 500:

 

Regarding Q2, I don't see a setting for that - my recollection is that once you make a choice (remember table is the right one IMO), Maple remembers it.

Your code uses f and f[i] for different purposes - if you are using f[i] then you should avoid using f as a variable (or here as a procedure since you are making a remember table)


 

eq:=(x+I*y)^2-4*exp(I*x*y);

(x+I*y)^2-4*exp(I*x*y)

evalc(eq);

x^2-y^2-4*cos(x*y)+I*(2*x*y-4*sin(x*y))

 


 

Download evalc.mw

Not entirely sure what you want to do. You could enter things with base SI units and then find their dimensions:

restart;

with(Units[Standard]):

c:=3e8*Unit(m/s);m:=5*Unit(kg);

0.3e9*Units:-Unit(m/s)

5*Units:-Unit(kg)

E:=m*c^2;

0.45e18*Units:-Unit(J)

convert(E,dimensions,base);

mass*length^2/time^2

 


 

Download units.mw

Of course {2*x-x*y=0,-y+3*x*y=0} are the equations to solve and {x,y} are the variables to solve for.  {x=0.1..5,y=0..4} are ranges of x and y in which to seek a solution. Usually, one real solution is returned. Many methods may be used, @radaar pointed out one of these. For some more common usuage:
 

ans1:=fsolve({2*x-x*y=0,-y+3*x*y=0},{x,y}); #solve for x and y; no clues given as to which solution to look for

{x = 0., y = 0.}

fsolve({2*x-x*y=0,-y+3*x*y=0},{x,y},avoid =ans1); #a solution but not the one we just found

{x = .3333333333, y = 2.000000000}

fsolve({2*x-x*y=0,-y+3*x*y=0},{x=0.1..5,y=0..4}); #ranges of x and y in which to seek a solution

{x = .3333333333, y = 2.000000000}

fsolve({2*x-x*y=0,-y+3*x*y=0},{x=1,y=1.5}); #initial guesses for a solution

{x = 0., y = 0.}

 


 

Download fsolve.mw

The Database package (see ?Database) connects to SQL databases via JDBC, which, according to wikipedia, Altibase supports. (I don't have any experience with this.)

You can give a range to RootOf:
 

p:=x^5+4*x-1;
 

x^5+4*x-1

RootOf(p,0..1);
evalf(%);

RootOf(_Z^5+4*_Z-1, 0 .. 1)

.2497570434

Or in terms of an answer from solve

ans:=solve(p,x);
ans[1];
op(1,ans[1]);
RootOf(%,0..1);
evalf(%);

RootOf(_Z^5+4*_Z-1, index = 1), RootOf(_Z^5+4*_Z-1, index = 2), RootOf(_Z^5+4*_Z-1, index = 3), RootOf(_Z^5+4*_Z-1, index = 4), RootOf(_Z^5+4*_Z-1, index = 5)

RootOf(_Z^5+4*_Z-1, index = 1)

_Z^5+4*_Z-1

RootOf(_Z^5+4*_Z-1, 0 .. 1)

.2497570434

 


 

Download RootOf.mw

multiplying both sides by the denominator gives (numerator)=0, so x__1 no longer appears. So it is not possible to isolate x__1.

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