tomleslie

13876 Reputation

20 Badges

15 years, 176 days

MaplePrimes Activity


These are answers submitted by tomleslie

  1. Well the file is 583KB. Unfoirtunately it is 583KB of NULL characters. So there is nothing in this file which can be meaningfully retrieved:-(
  2. Interesting to speculate on how you might have created such a file. Interesting, but probably unproductive. However it is extremely unlikely that Maple created such a file without some indication of a problem. As in, did Maple "crash" or "hang", or absolutely anything which would indicate a non-normal exit?
  3. Only sensible suggestion I can think of is to use Maple's backup restore  - available at  File->Recent Documents->Restore Backup. Depending on how often you have restarted Maple in the interim this may retun some useful data
  4. The backup facility works as follows. Assuming that you have not changed the Maple default, then Maple will write out all of your currently open worksheets to a backup file every ten minutes. If Maple "hangs", "crashes", or you have some kind of "unusual event" when you shut Maple down, then you should restart Maple, check your data, and if there is a problem, execute the backup/restore process described at (2) above.. Note that (AFAIK) you have about 10mins to do this, becuase at that point Maple will start to overwrite the back-ups from your previous Maple session with the back-ups from your current session.

The statement

This is the second time this problem happens to me, and both times have i lost hours of work. I have red multiple chats of people with the exsact same problem trying to get support from MaplePrime, but unfortunately, you have never been able to repair the files or find the source of the problem. 

whilst undestandable in your situation, is unreasonable. Sometimes files have been repaired, depends on what is in the file. Your case, - a file full of NULL characters, cannot be repaired - it simply contains a lot of "nothing" .

AKAIK there are no recorded instances where Maple performed a normal "exit" and ended up with a "trashed" file. If Maple ever performs a non-normal exit, then by using the backup/recover strategy described above, you shouild never lose more than 10mins of "work"

Even better if you can reproduce the non-normal exit - because that gives everyone somehing to work on, which can possobly be fixed
 

I'm not exactly sure what your difficulty is, and I don't speak/read Norwegian.

Making some "guesses", I think you want something close to the code given in the attached worksheet

cacCd.mw

  1. Have to agree with Acer
  2. If you have actually been "a Maple user for about 30 years" (which I doubt) then you probably ought to have worked out by now that using an "add()" command is *much* more efficient than using a "do" loop and adding the results
  3. Post code

Mapleprimes provides you with a way of uploading code - use it: the big green up-arrow in the toolbar

Or maybe you think I have nothing better to do than retype everything you put in a screendump.

The question in any case is nonsensical; illustrated output cannot be achieved without some weird, unspecified, stuff being done. Just check the following (loaded using the big green up-arrow)

restart;
f:=x->x^2;
f(1);
restart;
with(RealDomain):
f:=x->x^2;
f(1);

proc (x) options operator, arrow; x^2 end proc

 

1

 

proc (x) options operator, arrow; RealDomain:-`^`(x, 2) end proc

 

1

(1)

 


Download RD.mw

but check the attached anyway - it *may* do what you want


 

R := Vector(3, [x, y, z]); V := Vector(3, [u, v, w]); '`&x`(R, V)'; `&x`(R, V)

Typesetting:-delayCrossProduct(R, V)

 

Vector[column](%id = 18446744074795254598)

(1)

 


 

Download xProd.mw

 

When I originally read this I *thought* that the requirement was

  1. draw a sphere
  2. draw a "great circle" on the sphere in such a way that the "great circle" could be moved around the sphere

This is actually pretty trivial, and can be achieved with

restart;
with(plots):
with(plottools):
p1:=sphere([0,0,0], 1):
p2:= animate( spacecurve,
                         [  [ cos(theta)*sin(phi),
                              sin(theta)*sin(phi),
                              cos(phi)
                            ],
                            phi=0..2*Pi,
                            thickness=5,
                            scaling=constrained,
                            color=red
                        ],
                        theta=0..Pi
                    ):
display([p1,p2]);

However, looking at the OP's worksheet, the sphere is randomly located in space (well OK centred at [1,1,1], anyhow),  and the "circle" is centred at the origin. The circle could still be defined as a spacecurve, but the OP's request to " how can circle be moved independently around sphere " becomes a lot more vague. For example (and this is not a complete list of possibilities)

  1. Does the circle maintain the same orientation, with the centre moving around the sphere? Within this possibility
    1. Does the distance between the circle centre and the sphere centre remain constant?
    2. Moving around the sphere at fixed distance,  any combination of two angles is possible, without changing the orientation of the cicle. Do we know what these angular combinations are?
  2. Does the orientation of the circle change (two angles possible), as the circle centre moves around the sphere?

All of the above can be achieved - it would just be a lot easier if the exact requiemet wa specofied

 

It is generally(?) true that Maple's Optimisation/CurveFitting routines - only work for real-valued functions. However, your objective function seems to be

|f(x,a,b,c)-g(x)|^2

and, if I interpret this as abs( f(x,a,b,c)-g(x))^2, then this function is real-valued, even if the constituent functions f(x,a,b,c) and g(x) are complex-valued. So optimization/fitting routines ought to work for this function

However, my fundamental problem with ths question is that you claim you want to "fit" an expression, which is an inequality. I don't even understand the concept. One *might* be able to come up with a 3D spatial region, determining limiting values on a, b, c for which the inequality is true - but this is a long way from the conventional definition of a "fit"

So exactly what do you want to do with your real-valued function???

is first order, hence you can only have one  IC/BC.

See the attached for details

odeProb.mw

rather than a numeric one. Then check the help page at ?How Do I Solve an Ordinary Differential Equation.

About a quarter of the way down this page, there is en example entitled "Solving a Linear Two-Point BVP for a Second-Order ODE". This will show the general approach for analytically solving BVPs, with dsolve()

If you are looking for a numeric solution, then dsolve() with the "numeric" option will accept pretty much any combination of ICs/BCs

 

The worksheet you supplied works perfectly for, me.

Adding a 1-D execution group at the appropriate point and using copy-paste to populate it, I get what I would expect. (executed help sheet is attached).

Might be a Maple version issue I suppose? Which version are you running?


 

int or Int

definite and indefinite integration

 

 

Calling Sequence

Parameters

Options

Basic Information

Description

Notes

Examples

 

 

 

Calling Sequence

 

 

int(expression, x)

int(expression, x)

Int(expression, x)

Int(expression, x)

int(expression, x=a..b)

int(expression, x = a .. b)

Int(expression, x=a..b)

Int(expression, x = a .. b)

int(expression, [x, y])

 

int(expression, x=a..b, opt)

 

int(expression, [x=a..b, y=c..d, ...], opt)

 

Int(expression, x=a..b, opt)

 

int(f, a..b, opt)

 

int(f, [a..b, c..d, ...], opt)

 

Int(f, a..b, opt)

 

 

 

Parameters

 

 

expression

-

algebraic expression; integrand

x,y

-

name; variable of integration

a, b, c, d

-

endpoints of interval on which integral is taken

f

-

operator; integrand

opt

-

(optional) a sequence of one or more of the options listed below

 

 

Options

 
• 

The following options, which are described in more detail in the sections below, apply to definite integrals  only. Where indicated, some options take their default value from environment variables . An option has a default value of false if its corresponding environment variable is not set.

• 

AllSolutions=truefalse

Specifies whether int considers all possible real values for any symbols in the limits of integration. The default value is taken from _EnvAllSolutions.

• 

continuous=truefalse

Specifies whether int looks for discontinuities. The default value is taken from _EnvContinuous.

• 

CauchyPrincipalValue=truefalse

Specifies whether a principal value integral is computed, that is, whether infinities are allowed to cancel in some cases. The default value is taken from _EnvCauchyPrincipalValue.

• 

method=value 

Specifies which internal integration routine(s) to use.  See int/methods  for more details.

• 

numeric=truefalse

Specifies whether numeric integration methods are used instead of symbolic methods.  If numeric=true is specified, other numeric integration options can be specified.  See evalf/Int  for more details.

Basic Information

 
• 

This help page contains complete information about the int and Int commands. For basic information, see the int  help page.

Description

 
• 

The int command computes an indefinite  or definite integral  of the expression expression with respect to the variable x. The name integrate is a synonym for int.

• 

You can enter the command int using either the 1-D or 2-D calling sequence.  For instance, int(f,x) is equivalent to int(f, x).

• 

Indefinite integration  is performed if the second argument x is a name. Note that no constant of integration appears in the result. Definite integration is performed if the second argument is of the form x=a..b where a and b are the endpoints of the interval of integration.

  

If a and b are finite complex numbers, the int routine computes the definite integral over the straight line from a to b.

• 

If the integrand is specified as a Maple operator f, then the second argument must be a range a..b and not an equation, that is, a variable of integration must not be specified.

• 

If Maple cannot find a closed form expression for the integral, the function call itself is returned.

• 

The capitalized function name Int is the inert version of the int function, which simply returns unevaluated. It appears gray so that it is easily distinguished from a returned int calling sequence. In this form, expression can be a procedure, which can be integrated numerically.

• 

For numerical integration, use the option numeric.  For more information on numerical integration, see evalf/Int .

• 

If the second argument is a list, an iterated integration is performed on the variables or ranges in the order given. For definite integration, the list can be omitted and the ranges can be given as a sequence. For indefinite integration, the variables can be given as a sequence instead of a list if all variables appear in the expression being integrated. Otherwise, there may be confusion between variables and option names.

Handling Discontinuities

 
• 

Note that the indefinite integral in Maple is defined up to a piecewise constant. Hence, the results returned by int may be discontinuous at some points. In many cases, you can ensure continuity by replacing an indefinite integration problem by the corresponding definite integral.

int( floor(x), x );

floor(x)*x

(1)

int( floor(t), t = 0..x ) assuming x > 0;

floor(x)*x+piecewise(1 <= floor(x), -(1/2)*floor(x)^2-(1/2)*floor(x), 0)

(2)
• 

For symbolic definite integration, two options control how discontinuities are handled.  By default, int checks for discontinuities, and computes the integral as a sum of independent definite integrals, each of which involves an integrand which has no discontinuities in the interior of the interval of integration.

• 

The 'continuous' option instructs int not to look for discontinuities.

• 

The 'CauchyPrincipalValue' option instructs int to consider the limits from the left and right at each interior discontinuity as a single limit (so that the independent variable approaches the discontinuity at the same rate from the right and the left).  This allows for positive and negative infinite limits to cancel .

Returning the Entire Set of Solutions

 
• 

The 'AllSolutions' option, if set, forces int to return the entire set of solutions for the specified definite integral. This applies only to parameters in the endpoints of the interval, not to parameters in the integrand.

  

Note: The results returned with the 'AllSolutions' option may not be valid for some non-real parameter values. The results are always valid for all real parameter values.

Notes

 
• 

The Maple series function may be invoked on an unevaluated integral to compute a series expansion of the integral (when possible).

• 

When int is applied to a series structure, the internal function `int/series` is invoked to compute the integral efficiently.

Examples

 

int(sin(x), x)

-cos(x)

(3)

int(sin(x), x = 0 .. Pi)

2

(4)

int(sin, a .. b)

cos(a)-cos(b)

(5)

int(x/(x^3-1), x)

-(1/6)*ln(x^2+x+1)+(1/3)*3^(1/2)*arctan((1/3)*(2*x+1)*3^(1/2))+(1/3)*ln(x-1)

(6)

int(exp(-x^2), x)

(1/2)*Pi^(1/2)*erf(x)

(7)

int(exp(-x^2)*ln(x), x = 0 .. infinity)

-(1/4)*Pi^(1/2)*gamma-(1/2)*Pi^(1/2)*ln(2)

(8)

int(exp(-x^2)*ln(x), x)

int(exp(-x^2)*ln(x), x)

(9)

series(int(exp(-x^2)*ln(x), x), x = 0, 4)

series((ln(x)-1)*x+(-(1/3)*ln(x)+1/9)*x^3+O(x^5),x,5)

(10)

int(series((ln(x)-1)*x+(-(1/3)*ln(x)+1/9)*x^3+O(x^5),x,5), x)

(1/2)*ln(x)*x^2-(3/4)*x^2-(1/12)*x^4*ln(x)+(7/144)*x^4+O(x^6)

(11)

int(series((ln(x)-1)*x+(-(1/3)*ln(x)+1/9)*x^3+O(x^5),x,5), x)

(1/2)*ln(x)*x^2-(3/4)*x^2-(1/12)*x^4*ln(x)+(7/144)*x^4+O(x^6)

(12)

int(exp(-x^2)*ln(x)^2, x = 0 .. infinity)

(1/16)*Pi^(5/2)+(1/8)*gamma^2*Pi^(1/2)+(1/2)*gamma*ln(2)*Pi^(1/2)+(1/2)*ln(2)^2*Pi^(1/2)

(13)

The inert version of the int function simply returns unevaluated.

f := 7*x^3+3*x^2+5*x

Int(f, x)

Int(7*x^3+3*x^2+5*x, x)

(14)

Inert objects can be evaluated with the value  command.

value(Int(7*x^3+3*x^2+5*x, x))

(7/4)*x^4+x^3+(5/2)*x^2

(15)

A double integral

Int(Int(x*y^2, x = 0 .. 1), y = 0 .. 1)

Int(x*y^2, [x = 0 .. 1, y = 0 .. 1])

(16)

int(x*y^2, x, y)

(1/6)*x^2*y^3

(17)

int(int(x*y^2, x = 0 .. y), y = -2 .. 2)

32/5

(18)

int(1/(x+a)^2, x = 0 .. 2, 'continuous')

2/(a*(2+a))

(19)

int(1/x^3, x = -1 .. 2, 'CauchyPrincipalValue')

3/8

(20)

int(F(x)*Heaviside(x-1), x = -1 .. 3)

int(F(x), x = 1 .. 3)

(21)

An Elliptic integral

int(1/sqrt(2*t^4-3*t^2-2), t = 2 .. 3)

(1/5)*5^(1/2)*EllipticF((1/3)*7^(1/2), (1/5)*5^(1/2))-(1/5)*5^(1/2)*EllipticF((1/2)*2^(1/2), (1/5)*5^(1/2))

(22)

Integrating algebraic functions (only for RootOf notation)

f := (x^2-1+3*(x^2+1)^(1/3))*x/((x^2+1)^(2/3)*(x^2+2)^2)

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

(23)

f := convert(f, RootOf)

g := int(f, x)

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

(24)

evala(diff(g, x)-f)

0

(25)

Define a Maple operator using the unapply  command.

f := unapply(x+y, x)

proc (x) options operator, arrow; x+y end proc

(26)

int(f, 4 .. 5)

9/2+y

(27)

Specify the 'AllSolutions' option.

int(1/x, x = a .. 2)

Warning, unable to determine if 0 is between a and 2; try to use assumptions or use the AllSolutions option

 

int(1/x, x = a .. 2)

(28)

r := int(1/x, x = a .. 2, 'AllSolutions')

piecewise(a < 0, undefined, a = 0, infinity, 0 < a, -ln(a)+ln(2))

(29)

`assuming`([r], [0 < a])

-ln(a)+ln(2)

(30)

`assuming`([r], [a < 0])

undefined

(31)

`assuming`([int(abs(sin(x)), x = 0 .. 2*Pi*m)], [m::integer])

Warning, unable to determine if Pi*_Z14 is between 0 and 2*Pi*m3; try to use assumptions or use the AllSolutions option

 

int(abs(sin(x)), x = 0 .. 2*Pi*m)

(32)

`assuming`([int(abs(sin(x)), x = 0 .. 2*Pi*m, 'AllSolutions')], [m::integer])

4*m

(33)

``

 

See Also

DEtools[integrate_sols]

diff

elliptic_int

evalf

evalf/Int

int

IntegrationTools

inttrans[fourier]

inttrans[laplace]

inttrans[mellin]

iscont

limit

series

symbolic order integration

unapply

VectorCalculus

VectorCalculus[int]

 

 

 

 

 


 

Download helpProb.mw

My brief investigation suggest that Maple will not return a "symbolic" solution for the PDE system.

It may be possible to obain a numeric solution, but this would require numeric values for all of the unknown constants in the system, ie  each of `D__r`,M,Omega,`P__r`,`S__c`,lambda,m,t,x,varkappa, l2

If you plannon "evaluating" the matrix for a variety of different  supplied values, then it may be worth defining a function, whihc returns the appropriate matrix for any supplied (indexable) arguments - vectors, lists, whatever. As in


 

  restart;
#
# Define the Matrix using 'indexable' entries
#
  hf:= v -> Matrix( [ [ 1/(1-v[1]-v[2])^2+1/v[1]^2, 1/(1-v[1]-v[2])^2],
                      [ 1/(1-v[1]-v[2])^2, 1/(1-v[1]-v[2])^2+1/v[2]^2]
                    ]
                  );

proc (v) options operator, arrow; Matrix([[1/(1-v[1]-v[2])^2+1/v[1]^2, 1/(1-v[1]-v[2])^2], [1/(1-v[1]-v[2])^2, 1/(1-v[1]-v[2])^2+1/v[2]^2]]) end proc

(1)

#
# Now try a few random vectors/lists,  and
# pass these to the function hf
#
  x1:=Vector[column]( [10,20]):
  x2:=Vector[column]( [5,12]):
  x3:=Vector[row]( [8,3]):
  l1:=[2,3]:
  l2:=[7,4]:
  hf(x1);
  hf(x2);
  hf(x3);
  hf(l1);
  hf(l2);

_rtable[18446744074331512094]

 

_rtable[18446744074331512950]

 

_rtable[18446744074331513790]

 

_rtable[18446744074331514630]

 

Matrix(%id = 18446744074331515470)

(2)

 


 

Download getMat.mw

I went back to my original suggestion of inculding an extra equation in the PDE system, explicitly defining the variable diff(C(x,t),x) as an independent variable. With a little bit of massaging, I managed to make this work. There is still a "small" discrepancy between the value returned for the quantity diff(C(x,t),x), evaluated at x=L. by Maple's PDE solution process, and the same quantity as genertaed by your supplied boundary condition. The discrepancy is restricted to relatively small values of 't'.

Further detials are incuded in the comments in the attached worksheet


pdeProb2.mw

unless you post some code exhibiting the problem (using the big green up-arrow in the toolbar).

Unitll then I can only suggest that you avoid using constants as variables!

if you were more explicit in your requirements. Or even better, post a worksheet using the big green up-arrow, which illustrates the problem. Having said that

You appear to have a random number of equations/expressions, in a random number of variables, and a random parameter for which you want some random plot.. Well something like

eval([expr1, expr2, ..], param=paramVal);

ought to substitute a value for 'param' in all of your equations/expressions. Assiming that some numerical solution is possible, then

fsolve( eval([expr1, expr2, ..], param=paramVal) );

ought to return  a list of solutions in lexicographic order for the remaining variables. If I make the (totally unjustified) assumption that your variables are 'x' and 'y', then

fsolve( eval([expr1, expr2, ..], param=paramVal) )[1];

ought to return an equation x=numeric. So if I were to use

rhs( fsolve( eval([expr1, expr2, ..], param=paramVal) )[1]);

I ought to get only the numeric value of 'x' when the value of 'param' (your 'D' maybe) is equal to paramVal.

This now becomes a plottable entity because I can return a value for 'x' for any given value 'paramVal' and hence plot, using something like

plot(rhs( fsolve( eval([expr1, expr2, ..], param=paramVal) )[1]), paramVal=l1..l2)

Now the above may not work because I have made several assumptions about your paramters, which variables you want to plot against what etc. But from your desciption, the problem is trivial. You just have to provide sufficient code for me to make it work for real

First 153 154 155 156 157 158 159 Last Page 155 of 207