### Faraz Vossoughian (view profile)

on 7 Feb 2018 at 23:57
Latest activity Edited by per isakson

### per isakson (view profile)

on 8 Feb 2018 at 10:21
```clc
clear all
EA0=1e7;
L=20;
syms px0 a x b c L
EA=EA0*(1-(x/(2*L)));
uapp=a*(x/L)+b*(x/L)^2+c*(x/L)^3;
du2=diff(uapp,x,2);
du2=du2^2;
u=(EA/2)*du2;
u=int(u,x,0,L)
px=px0*(1-(x/2*L));
px=px*uapp;
V=-int(px,x,0,L);
TPE=u+V;
eqna=diff(TPE,a)==0;
eqnb=diff(TPE,b)==0;
eqnc=diff(TPE,c)==0;
```
```sol=solve([eqna,eqnb,eqnc],[a,b,c])
```
```asol=sol.a;
bsol=sol.b;
csol=sol.c;
```

John D'Errico

### John D'Errico (view profile)

on 8 Feb 2018 at 0:37

What do you think is the right answer?

Faraz Vossoughian

### Faraz Vossoughian (view profile)

on 8 Feb 2018 at 0:51

Couple of numeric answers but what I get are empty matrices

John D'Errico

### John D'Errico (view profile)

on 8 Feb 2018 at 1:36

As I indicate, there is no solution. TPE is linear in a. You can make it as large or small as you like.

### John D'Errico (view profile)

on 8 Feb 2018 at 0:53
Edited by John D'Errico

### John D'Errico (view profile)

on 8 Feb 2018 at 10:17

What do you think is the correct answer? And why do you think that these equations should give you that?

Looking at eqna, we see that it has nothing to do with any of a,b,c.

```eqna
eqna =
(L*px0*(20*L^2 - 60))/120 == 0
```

The other two equations involve b and c. But nothing in this system of equations will yield the value of a. So there is no solution.

If you look carefully at how you derive eqna, you will see that indeed, there will be no terms at all that involve any of a, b, or c.

I assume the way you are trying to formulate these equations indicates you are trying to maximize (or minimize) something. Whatever TPE refers to, that is. As it turns out, TPE is:

```TPE
TPE =
(2500000*(6*b^2 + 16*b*c + 15*c^2))/L^3 - (L*px0*(60*a + 40*b + 30*c - 20*L^2*a - 15*L^2*b - 12*L^2*c))/120
```

You can choose values of those parameters that will make TPE as large or as negative as you wish, mainly by varying a. Since the coefficients of the quadratic terms in B and C are positive, I assume that means you want to minimize TPE (which is probably an acronym for some Total Potential Energy). But since TPE is LINEAR in a, there is NO minimum. It can be made as negative as you wish, simply by adjusting a.

Remember that eqna is just the partial derivative of TPE with respect to a. You tried to set that to zero.

```eqna
eqna =
(L*px0*(20*L^2 - 60))/120 == 0
```

But in fact, the left hand side is just the linear term in a. If

```(L*px0*(20*L^2 - 60))/120 > 0
```

then you make TPE approach -inf by making A approach -inf. If

```(L*px0*(20*L^2 - 60))/120 < 0
```

then you make TPE approach -inf by making A approach +inf.

Whichever case is true, that tells you how to make TPE as negative as you wish.

You need to understand what the mathematics tells you here. It may be telling you that you have formulated the problem incorrectly. I won't get into the derivation of how you created TPE, since I have been given no clue what it claims to solve.

Does it tell you that a minimum of this system exists ONLY for the specific case where

```(L*px0*(20*L^2 - 60))/120 == 0
```

? that may be. In that case, a is a free parameter. Nothing in what you have done will ever allow you to derive a value for a however that minimizes TPE.

I think you need to spend some time reworking your problem.