5 years, 44 days

## @acer Thank you acer, you are helpi...

@acer Thank you acer, you are helping me not for a first time.

What is this command Optimization? Where can I read about it and its syntax, where is it used and what for?

## @Kitonum  Thank you! I thought thi...

Thank you! I thought this command is only for the y-coordinate, not x.

Also, I just clicked on Execute and it doesn't work! What am I doing wrong?
2_1.mw

## @tomleslie  So you're say...

So you're saying that the syntax is correct and if the output of the first system did not contain a singularity, the second system would solve normally? I'll try to think of something.
Thank you.

## @vv  Maple does not accept an inte...

Maple does not accept an integro-differential system of this kind

That answer is what I was waiting for.

I just wanted to "collect" as many ways of solving the problem as I could, I don't reject it, because I already did it this way.

I don't try to put another equation to the system (I asked about it in the previous thread), I want to solve the system without T(x) and then to calculate it as a function of x. Only then to put known in advance function T(x) into the system, so dsolve must not look for it.

I's like putting sin(x) to the system, the dsolve command won't try to find it, it's just given for the system. Like T(x) should be.

One more example:

Say we've got a system:

y'(t)=x(t)^2
x''(t)=y(t)+t

We found x(t), y(t) via dsolve.

Then say z(t)=int ( x(t1)*y(t1), t1=0 .. t ), so z is a function of t only.

We have another system:

y1'(t)=x1(t)^2+z(t)
x1''(t)=y1(t)+t

I try to find x1 and y1, but I can't, because Maple says there are 2 variables: t and t1.

## @Preben Alsholm  But you didn'...

But you didn't. I don't try to put another equation to the system, as I did in this thread, I want to solve the system without T(x) and then to calculate it as a function of x. Only then to put known in advance function T(x) into the system, so dsolve must not look for it.

I's like putting sin(x) to the system, the dsolve command won't try to find it, it's just given for the system. Like T(x) should be.

## @Preben Alsholm    The reaso...

The reason we need Aproc(0) = 0 is quite simply because
A(x) = int( r(y), y=0..x).
That's how it all started, remember? Thus A(0) = int( r(y), y=0..0) = 0.
Aproc is just my name for the numerical procedure computing A(x) for given x.

Yes, I understand now, I mixed up A(0) and A(x) and thought you built a plot in relation to A(Pi) for the second one, not the first.

You defined T (and I followed you in that) by
T:=exp(-2*m*Aproc(x));
Thus T is not a procedure, T is an expression in x. Compare the expression sin(x) with the function (in Maple procedure) sin.
So you cannot apply T to x and expect something sensible. Just as you should not do sin(x)(x).
Notice that I didn't do that. I wrote
plots:-odeplot(res,[x,T],1e-100..0.1,thickness=3);
without an x on T.

Thank you for that explanation. I don't know much about Maple's machine ways of keeping the data, about functions and procedures, and this is exactly why I write here.

I didn't ask you to give me full solutions, so yes, I believe I try to solve the system myself, as much as I can. I only write here for solving the problems with errors and syntax, and even after you gave me full solutions, I still try to solve the system myself: the professor gave me a little push saying the word "iterations", I thought of assuming T(x) as 0 etc, and now I try to perform this solution. I don't think about coping your code and showing it as if it was mine, so I don't understand why would you say something like that. Is it bad to ask questions about a program's syntax or what?

That said, I'm now not even allowed to start a thread and ask an unrelated question about an integral with variable upper limit and how to properly declare it, which answer I need to try to solve the system in a slightly different way than written here. Great.

## @acer  I understand and I won'...

I understand and I won't. It's just that there won't be anyone in this thread except for Preben Alsholm, and he may not know how to deal with this problem. If I created new thread, there would be a chance for someone else to find it and to answer.

And to be completely accurate, the question I asked in that thread has nothing to do with the question in this thread. Same task, same eqations - different errors and problems, different Maple functions even.

## @Preben Alsholm  the purpose no mo...

the purpose no more is to show that a singularity exists in the interior, but now we need to find a value for APi that makes Aproc(0) = 0

Why is it the purpose? I don't quite get it.

The parameters are not irrelevant, I just wanted to solve the system "myself" with random parameters, to "naturally" come to the correct answer, varying the parameters.

In this part:

Aproc:=subs(res,A(x));
T:=exp(-2*m*Aproc(x));
plots:-odeplot(res,[x,T],1e-100..0.1,thickness=3);

Why is it working for you, but here:

I had and issue with it though: I need a plot for original T(x), not A(x), and I get an error: 1.mw

in the similar situation there is an error?

Still need help with

I've tried to do something similar, but I'm stuck in defining T(x): when I solve the system with a new T(x), Maple doesn't seem to recognise it as a function of x. I think I again have a mistake in the syntax. That is a subject for another question, but maybe you know where I'm mistaken: 2.mw

I created a separate theme for that question, but it was deleted for some reason...

## @Preben Alsholm  In this part re...

In this part

```restart;
Digits:=15:
with(plots);
R0 := 10^(-5);
C := 1;
m := 1/100;
u1 := 1000;
sys := R(x) = 2*(-r(x)*diff(r(x), x)*cos(x)+r(x)^2*sin(x)+diff(r(x), x)^2*sin(x)-sin(x)*r(x)*diff(r(x),x,x))/(r(x)^4*sin(x)),
diff(R(x),x,x)+cot(x)*diff(R(x), x) = -(1/2)*r(x)^2*(R0^2-R(x)^2)-r(x)^2*C^2*m^2*exp(-2*m*A(x))/(2*u1),
diff(A(x), x) = r(x);
## I prefer this version:
SYS:=solve({sys},{diff(r(x),x,x),diff(R(x),x,x),diff(A(x),x)});
## I set the condition on A(x) at x = Pi, but of course we don't know its value.
## We let it be a parameter here called APi.
##
condA := R(Pi) = 1/500^2, r(Pi) = 500, D(R)(Pi) = 0, D(r)(Pi) = 0, A(Pi) = APi;
## Now use the parameters option in dsolve/numeric:
res:=dsolve(SYS union {condA},numeric,parameters=[APi],output=listprocedure);
## Extracting the procedure for finding A(x) for given x:
Aproc:=subs(res,A(x));
## Setting as an example the parameter APi to 10^4:
res(parameters=[10^4]);
## The plots:
plots:-odeplot(res,[x,r(x)],0..Pi);
plots:-odeplot(res,[x,R(x)],0..Pi);
plots:-odeplot(res,[x,A(x)],0..Pi);```

you actually find the solution, do you not? The only problem is that we don't know A(Pi) and we can assume it is 10^4, for example. Then we get the plots and solutions for wanted functions, even with a singularity.

I had and issue with it though: I need a plot for original T(x), not A(x), and I get an error: 1.mw

As for the second part, depending on the APi, i. e. A(Pi), there is a singularity at x near to 1. It's a pity that we can't put this singularity outside the interval x=0..Pi, varying A(Pi). Seems kinda strange, as if the system doesn't have a solution without a singularity if the boundary conditions are given at Pi, and yet my professor got it.

As I mentioned before, he used a method of iterations: at first solving the system with T(x)=0, then finding r(x) => T(x) and solving the system with this T(x), repeating 2-3 times. Surprisingly enough, he didn't get a singularity for r(x) from the system without T(x), as you did in

```SYS0:=remove(has,eval(SYS,exp=0),A(x));
res0:=dsolve(SYS0 union {R(Pi) = 1/500^2, r(Pi) = 500, D(R)(Pi) = 0, D(r)(Pi) = 0},numeric);
odeplot(res0,[x,r(x)],0..Pi); #Notice the value 0.99622186
odeplot(res0,[x,R(x)],0..Pi);```

Although I don't have his worksheet and can be mistaken. However, the final solution for r(x) and T(x) doesn't contain any singularities, that I know.

I've tried to do something similar, but I'm stuck in defining T(x): when I solve the system with a new T(x), Maple doesn't seem to recognise it as a function of x. I think I again have a mistake in the syntax. That is a subject for another question, but maybe you know where I'm mistaken: 2.mw

Thank you for your time and work anyway, you really helped me.

## @Preben Alsholm  So it's simil...

So it's similar to a method of iterations? You try to guess a function, then you substitute this function and get an approximate solution, then substitute this solution and get a more accurate solution?

I was said to try to solve a system with iterations of T(theta). To equate it to 0, then to find r(theta) => T(theta) and substitute it to a system. I guess it's a normal way to find a solution.

Still, it bugs me that the system has singularity in 0...

## @Preben Alsholm  Nah, the rb is th...

Nah, the rb is the same as r, my professor (the author of this paper) just wrote it to show something. I asked him the same questions as you did when I first saw it, and he said to ignore the b index and different notations for derivatives.

## @Preben Alsholm  Thank you for you...

I've tried creating a new function A(x), but it doesn't work with conditions at Pi, as you said, and even near Pi (which is quite strange, because it shouldn't produce overflow in a big vicinity of Pi), with adding method=bvp[midrich] I get another error message: Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging.

1_с_T(theta)_в_Pi.mw

However, it kinda worked with conditions at 0: 1_с_T(theta)_в_0.mw

I still would like to get a solution with conditions at Pi.

> You could try to avoid initial problems by using an approximate solution where the initial guess for r(x) has r(0)<>0, D(r)(0) = 0, and satisfies the boundary condition D(r)(Pi) = 0 as required

Sorry, I don't quite get this line (maybe I should blame my language). Did you mean I need to change the boundary conditions for r(x) to 0 from Pi? I must have 2 conditions: 1 for function and 1 for derivative, or not?

 1 2 Page 1 of 2
﻿