## 6071 Reputation

15 years, 216 days

## maxsols...

```restart;
f := x -> 2*2^x-2;
g := x -> -1/2*x^2+3/2+5;
fsolve(f(x)=g(x), x=-10..10, maxsols=2);
-4.094614685, 1.787210719
```

## Placeholder for an answer...

This problem can be solved by hand with the method that I described in my yesterday's answer to another question.  The solution turns out to be

which you may verify by direct substitution.  I don't have the time this evening but I should be able to post the details that lead to that solution tomorrow.

=============

OK, it's tomorrow now, and here is the calculation that led to the result above.

## Solution through Fourier series...

This problem may be solved through Fourier series. Maple can help with some of the calculations but much of the infrastructure needs to be calculated by hand.  The document attached at the bottom of this reply explains the general strategy and then produces the specific solution of the problem that you have posed.

Taking only 8 terms in the Fourier series produces a symbolically exact solution to the PDE which satisfies the boundary condition approximately with a residual error of O(10−7), which is quite good.  Here is the graph of the solution.

Documentation: poisson-problem-with-robin-boundary-conditions.pdf

## Solution with adjusted parameters....

A boundary value problem does not necessarily have a solution. Yours appears to be in that category. If, however, you have some flexibility in choosing the parameter values, then solutions do exist.

Here, in addition to your parameters t3, R, and M, I have introduced two new parameters—the length of the interval, L, and the value of G(0), d.  For instance, setting L=1 and d=0.9 results in a solution as shown below.  Another possible pair is L=0.6, d=1.

```restart;
eq1 := diff(F(x), x\$4) +2*R*(F(x)*diff(F(x), x\$3) + G(x)*diff(F(x),x)) + 2*R*t3*(2*diff(F(x), x\$2)*diff(F(x), x\$3) + diff(F(x), x)*diff(F(x), x\$4) + 3*diff(G(x), x)*diff(G(x), x\$2)) = 0;
eq2 := diff(G(x),x\$2) - 2*R*(diff(F(x),x)*G(x)- F(x)*diff(G(x), x)) - 2*R*t3*(diff(F(x),x\$2)*diff(G(x),x) - F(x)*diff(G(x), x\$2) ) = 0;
ic := F(0)=0,  F(L)=0, G(0)=d, G(L)=0, D(F)(0)=0, D(F)(L)=M;
params := t3=2, R = 0.5, M =0.5, L=1.0, d=1.0;   # original (bad choices)
params := t3=2, R = 0.5, M =0.5, L=0.6, d=1.0;   # good choices
params := t3=2, R = 0.5, M =0.5, L=1.0, d=0.9;   # another set of good choices
sys := eval({eq1,eq2,ic}, {params}):
dsol := dsolve(sys, numeric, method=bvp[middefer]);
plots:-odeplot(dsol, [[x,F(x)],[x,G(x)]], color=[red,blue]);```

## Get the general solution first...

Maple produces the general solution with a little help.

```restart;
kernelopts(version);
Maple 2021.1, X86 64 LINUX, May 19 2021, Build ID 1539851

ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x));
dsolve(ode, implicit);      # solve
subs(_C1 = ln(C), %):       # replace _C1 by ln(C)
(exp@lhs = exp@rhs)(%):     # exponentiate both sides
simplify(%);
```

Then you can determine C by applying the initial condition.

## Composing procedures...

Since you are composing procedures, it would make life easier if each f[i] received a procedure and returned a procedure.  Here is how to do it.

```restart;
kernelopts(assertlevel=2):

f[1] := proc(x::procedure)::procedure;
piecewise(0 <= t and t <= 1/2, (1/2)*x(2*t), 1/2 < t and t <= 1, 1/2*x(2*t-1));
unapply(%, t);
end proc:

f[2] := proc(x::procedure)::procedure;
t*x(t);
unapply(%, t);
end proc:

# Illustration
L := [1,2,1]:
map(i->f[i], L):
`@`(%[]):
h := %(t->t^2);   # change t->t^2 to anything else, as needed

plot(h(t), t=0..1);```

## Jacobian...

```restart;
with(Physics):
alias(x=x(t),y=y(t)):
phi := [ x, phi__1(x,y) ]:
J := < diff(phi[1], x), diff(phi[1], y);
diff(phi[2], x), diff(phi[2], y) >;
```

## Same old.......

This problem is hardly different from the one that you posted a few hours ago. Here is the same answer with minor modifications.

 > restart;
 > f := x-> (x^2 - 4*x)/(x^2 - 4*x+3);

 > p1 := plot(f(x), x=-2..6, discont, scaling=constrained, view=-3..7, color=blue);

f is symmetric about the line

 > is( f(x+2) = f(-x+2) );

Therefore, the center of the circle lies on the line . The circle touches

the graph at , and consequently, the y coordinate of its center is ,
where R is the radius. We conclude that the circle's equation is

 > C := (x-2)^2 + (y-4+R)^2 = R^2;

We calculate the points of intersection of the circle and the graph of f:

 > xy := solve({C, y=f(x)}, [x,y]);

Let us isolate the argument of the RootOf:

 > select(has, xy, RootOf): eval(x, %[]): P := op(1, %);

The quartic polynomial P has 4 roots in general, but when the

circle is tangent to the graph of f,  those 4 roots to collapse

into 2 roots.  That happens when the discriminant of the quartic

is zero.

 > discrim(P, _Z) = 0; solve(%);

We conclude that the radius is 5/2 and y coordinate of its center is 4 - 5/2 = 3/2.

Here is its graph

 > plots:-display(p1, plottools:-circle([2,3/2], 5/2, color=red));

## Another approach...

vv has already provided a solution. Here is an alternative approach.

 > restart;
 > f:=x->1/(x^2-2*x);

 > p1 := plot(f(x), x=-3..5, discont, view=-3..3, scaling=constrained, color=blue);

f is symmetric about the line

 > is( f(x+1) = f(-x+1) );

Therefore, the center of the circle lies on the line . The circle touches

the graph at , and consequently, the y coordinate of its center is ,
where R is the radius. We conclude that the circle's equation is

 > C := (x-1)^2 + (y-R+1)^2 = R^2;

We calculate the points of intersection of the circle and the graph of f:

 > xy := solve({C, y=f(x)}, [x,y]);

Let us isolate the argument of the RootOf:

 > select(has, xy, RootOf): eval(x, %[]): P := op(1, %);

The quartic polynomial P has 4 roots in general, but when the

circle is tangent to the graph of f,  those 4 roots collapse

into 2 roots.  That happens when the discriminant of the quartic

is zero.

 > discrim(P, _Z) = 0; solve(%);

We conclude that the radius is 3/2 and therefore the y coordinate of its center is 1/2.

Here is its graph

 > plots:-display(p1, plottools:-circle([1,1/2], 3/2, color=red));

## Makei it :=...

In your worksheet you have
motioneq  = (3.2)

That "=" should be ":=".

## Use tilde...

Unless you have a very ancient version of maple, this should do what you want:

int~(<sin(x), cos(x)>, x=0..2);

## May this?...

I can think of a dozen or two different answers to your extremely vague question and it's likely that they will be unsatisfactory as long as you refuse to show your code. Anyway, here is one possibility:

 > restart;
 > E := phi -> 1 / (1+phi^2);

 > E(0.4);

 > plot(E(phi), phi=0..1);

## Will this do?...

Based on the information that you have provided, this is all that we can do:

 > restart;
 > de := diff(x(t),t) = A(t)*x(t) + B(t)*u(t);

 > dsol := dsolve(de, x(t));

 > y(t) = eval( C(t)*x(t) + E(t)*u(t), dsol);

If that's not what you want, then you will have to be more specific about what you are looking for.

## Here it is...

 > restart;
 > x := [x__1,y__1,theta__1,x__2,y__2,theta__2];

 > f := [cos(theta__1),sin(theta__1),0,0,0,0];

 > J := Matrix(6, 6, (i,j) -> diff(f[i], x[j]));

## Two different ways...

Here are two different ways to achieve that.

Method 1: Use the EulerLagrange function in the VariationalCalculus package:

```VariationalCalculus:-EulerLagrange(L, t, [ x(t), y(t), alpha(t), phi1(t), phi2(t) ] );
remove(type, %, equation);```

Method 2: Load the Physics package:

`with(Physics):`

That redefines diff so that your code should work unless you have other errors in it.

There are other ways as well but the two that I have shown here are the quickest.

In the future, when you ask a question, include your actual Maple worksheet.  Showing just a picture, as you have done, is not very helpful since I cannot execute that code to test my suggestions before replying.

 1 2 3 4 5 6 7 Last Page 3 of 44
﻿