Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

@Preben Alsholm The error message that you have shown does not complain about "global".  It complains about "protected".  It may be a global variable, but that's beside the point.

In fact _Z is not unique in that respect.  Try any of:

_a := 12;
_b := 12;
_c := 12;

In general it's good to work under the assumption that all identifiers beginning with underscore are reserved for Maple's internal use, and avoid messing around with them.  Even if some of such identifiers are unprotected now, they may become unavailable in future releases.

This is exactly parallel to the C programming language where identifiers beginning with underscore are reserved for the compiler's internal use.  One may assign to them at one's own risk.

 

I haven't checked all of the calculations in that manuscript, however just

spot-checking it reveals some errors which weakens my trust in the rest

of its statements.

 

First, I have already noted the F(t, x, y) versus F(t, x, y, z) confusion,

but perhaps that can be attributed to a careless copy-paste error.  It is

clear that all F(t, x, y, z) and G(t, x, y, z) are supposed to be F(t, x, y)

and "G(t,x,y)."

 

Second, each of the two phase portraits in Figure 1 on page 161 show

an equilibrium near x = .5, y = 0.6e-1.  That is inconsistent with the

given data as we see in the calculations below. Again, that may be due

to typographical errors in the article but there is no way for us to tell.

 

Of course, it is possible that I am mistaken, in which case I would like

to be corrected.

 

restart;

The system of differential equations is defined in equation (1.2) in terms

of the functions F and G:

F := r*x*(1-x/k) - beta*x*y/(a+x^2);
G := mu*beta*x*y/(a+x^2) - d*x - eta*x*y;

r*x*(1-x/k)-beta*x*y/(x^2+a)

 

mu*beta*x*y/(x^2+a)-d*x-eta*x*y

(1)

The numerical values of the coefficients are specified on page 159:

params := r=0.05, a=0.8, mu=0.8, d=0.24,
          eta=0.01, beta=0.6, k=1.6;

r = 0.5e-1, a = .8, mu = .8, d = .24, eta = 0.1e-1, beta = .6, k = 1.6

(2)

The equilibria are the roots of the system F = 0, G = 0:

sys := eval({F=0, G=0}, {params});

{0.5e-1*x*(1-.6250000000*x)-.6*x*y/(x^2+.8) = 0, .48*x*y/(x^2+.8)-.24*x-0.1e-1*x*y = 0}

(3)

Figure 1 on page 161 indicates that there is an equilibrium at around "(x=0. 5, y=0.06)".

However we may verify in a number of ways that there are no equilibria near

that point at all.  One (but not the only) way is through Maple's fsolve() which fails to

find a root in the specified region:

fsolve(sys, {x=0.1..1.0,y=0.01..0.10});

fsolve({0.5e-1*x*(1-.6250000000*x)-.6*x*y/(x^2+.8) = 0, .48*x*y/(x^2+.8)-.24*x-0.1e-1*x*y = 0}, {x, y}, {x = .1 .. 1.0, y = 0.1e-1 .. .10})

(4)
 

 

Download mw2.mw

@torabi In your differential equations we have F(t,x,y) but in the discretized equations we have F(t,x,y,z).  What is z? Something isn't quite right there.

Additionally, in order to do actual computations, we need to know the functions F and G. What are they?

 

@kainmuth Let w := s -> 1/abs(s), and then try:

int(w(x-y), x=0..1, y=0..1);

The result is infinity.  Consequently, your E is always infinity, regardless of the choice of f.  There is no hope of minimizing E.

@torabi

Here is the general solution of your problem:

restart;

de := (diff(r*(diff(u(r), r)), r))/r = 0:

dsolve(de);

u(r) = _C2*ln(r)+_C1

You see that the graph of the solution, regardless of any boundary conditions, would

be a scaled and translated copy of the graph of the logarithm function.  But the graph

of the logarithm function is monotonically increasing, that is, it does not go up

and down.  Therefore it is impossible for the solution to start at a zero value at

some r, become nonzero, and then return to zero again.

Maple can solve the wave equation in one-dimensional space, but as far as I know it cannot handle the two-dimensional case, so you are out of luck here.

If you have the knowledge and ambition, you may set yourself the goal of solving the problem numerically with your own implementation of a finite element algorithm in Maple.  That will take some time and effort.

The commercial software Comsol Multiphysics provides ready-to-use finite element solvers for all sorts of PDEs.  If you have access to it, you may want to give it a try although it will take a few days just to learn the interface.  If you don't have Comsol, probably you cannot afford it since it is quite expensive.

I have no idea whether Matlab or Mathematica can solve your problem.  Ask someone who knows about them.  Good luck!

 

In the definition of E you have f(y).  What is y?  Perhaps you need a double integral that integrates on both x and y?

Additionally, what is w?

 

@deniscr OK, that's good.  Almost.  I see that you are entering your code in Maple's 2D input mode.  That's very much error-prone.  As is, you have two different "r" symbols in your worksheet.  They look the same but they are not the same.  Because of that if you try
simplify(U^+ . C . U - M) assuming positive;
you don't get zero.

To see where the problem lies, convert your worksheet to 1D input.  One way of doing this is through the Maple menus:
Edit -> Select All
Format -> Convert To -> 1-D Math Input

After you do that, look at your definition of the matrix M to see the problem.

To avoid such problems, consider making 1-D input the default for your worksheets.  Look at how acer and vv do it.

That said, I am puzzled why vv's calculations do not capture your solution U.  This requires a closer look at how Maple solves systems.

@deniscr Instead of posting an image of your code, please post the code itself.  One cannot execute an image.

@amcmaple I have already said that plotting a phase portrait for a function is not a meaningful concept.  One plots a phase portrait for a differential equation, not a function.

What you have shown appears to be the solution of a differential equation.  What you need to show is the differential equation itself.

Additionally, it will help if you would explain why you are interesterd in this question since, as you say, you don't know what a phase portrait is.

A  "phase portrait for a function" is not a meaningful concept.  Perhaps you mean a phase portrait for a differential equation?  If so, then tell us what differential equation you have in mind because the details of the answer will depend on that.

Your references to the plot of dX/dt versus X indicate that the differential equation must be of the second order.  But because of the missing information, the discussion has been diverted to plotting solution curves (not phase portraits) of first order equations. Be more specific if you want good answers.

 

@spalinowy

restart;

with(Student[MultivariateCalculus]):

Let's say you want to linearize a function F(x, y) about the point a, b.
Here is the equivalent of what you do in your worksheet:

TaylorApproximation(F(x,y), [x,y]=[a,b], 0);

F(a, b)

But that only gives you the value of the function F at the point a, b.

That's not what you mean by linearization, do you?

What you should be doing is:

TaylorApproximation(F(x,y), [x,y]=[a,b], 1);

F(a, b)+(-a+x)*(D[1](F))(a, b)+(-b+y)*(D[2](F))(a, b)

In this expression a, "b," F(a, b), (D__1(F))(a, b), and (D__2(F))(a, b) are

constants, while x and y are variables.  We may express the result equivalently,

but more neatly, as

A + B*(x-a) + C*(y-b);

A+B*(-a+x)+C*(-b+y)

or better yet, letting u = x-a and v = y-b, that takes the form

A + B*u + C*v;

B*u+C*v+A

There you have it.  This is what you may call the linearization of F.

 

You write: "For me linear equation is when I don't have sin(x)

or cos(x) in all equation".

 

That's not true.  The coefficients A, B, and C may have sine or cosine,

or all sorts of other things in them, as long as they don't involve the

linearization variables u and "v.  "For example, B may be cos(ln(a)).

There is nothing wrong with that.

 

Now look at the result shown at the end of my calculations, that is:
"sin(phi2) lk m1 ((ⅆ)^2)/(ⅆt^2) (sin(`psi__0`(t)) u(t))."

Note that this is linear in the linearization variable "u(t)."  The coefficient
sin(`ψ__0`(t)) has no u(t) in it, so it doesn't hurt.

 

That said, you need to know that Maple's TaylorApproximation

is meant to calculate the Taylor series of a function of several variables, such

as F(a, b).  Your expression, however, is not of the form F(a, b).  Rather,

due to the presence of terms involving the derivatives of psi1(t), it is a

differential operator.  Linearization of differential operators is studied in courses

beyond calculus.  Maple's TaylorApproximation is not the right tool for it.

I have already shown how to do that calculation properly, and vv has presented

a compact summary.

 

 

@spalinowy Where do you see a nonlinearity?  The expression
               sin(phi2)*lk*m1*(Diff(sin(psi__0(t))*u(t), t, t))
is linear in u(t).
That is what is meant by linearization.

As Edgardo has pointed out, your initial value problem is ill-posed in

that it has no unique solutions.  As a matter of fact, it has infinitely

many solutions given by

y(x) = piecewise(x < c, 0, 16.1*(x-c)^2);

y(x) = piecewise(x < c, 0, 16.1*(x-c)^2)

where c >= 0 is an arbitrary constant.  I'd be surprised if a computer

algebra system could discover that fact.

First 62 63 64 65 66 67 68 Last Page 64 of 99