cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

ode with unknown initial conditions

sdidam
1-Visitor

ode with unknown initial conditions

Hi everyone,

I have a problem solving an ODE. I want to calculate the deflection of a beam, but at the beginning I don't know the force and the force application Point. So I make a guess of it. With a good guess or with iterations (very much work) I can solve it. But because I have many situations like this, I want to do it automatically.

In the attached file I have simplified the problem  and explained it more detailly.

Thank you,

Stephan

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:sdidam)

One way of doing it would be like the following:

You may want to compare accuracy against the values you had found:

At first sight it looks like you can find an a-value for any given F.2-value within a given range and vice versa (I have chosen the values you found in the following examples)

but as soon as you lower the value of CTOL, no solutions are found

Regards, Werner

PS: Instead of "find" you could use "minerr" (especially when you think that there is no perfect exact solution and so it will find a solution with lower values of CTOL, too) but your choice of using "minimize" was wrong.

View solution in original post

11 REPLIES 11
Fred_Kohlhepp
23-Emerald I
(To:sdidam)

You're using 3.1, so I can't open your sheet (stuck in 3.0.)

I solve beam deflection by solving the differential equation [EI d^2y/dx^2 = M(x)].  You can develop the equation for moment along the beam for whatever force arrangement you have.  Two additional constraints are required--if it's a cantilever these would be displacement and slope at the origin.

That's right, this point I already have.

I have a cantilever beam, length l, fixed at x=0 [boundary conditions: w(0)=0; w'(0)=0].

The Problem is, that I don't know at the beginning of the calculation where the force application point a is and also the Force F is unknown.

So the equation for the Moment is:

M(x)=F*(a-x) from x=0 to x=a and

M(x)=0 from x=a to x=l

But I know the following:

w'(a)=0

w(a):= is a function of x.

Another point is, that the Moment of inertia is not constant. In my example I simplified it to a linear relationship of x. In my more complicated case there are multible integrals in it, so that there is no easy solution.

I can solve the Problem with iterations manually or with a good guess, but I want to do this automatically, because that costs a lot of time and I have many problems like this.

Fred_Kohlhepp
23-Emerald I
(To:sdidam)

You can make I a function of x as well as moment. If I(x) requires integrals it will slow down computation; one way to speed that is to create a vector of I at points along the length and fit a polynomial (function "regress") to the curve.

I have problems with tension and compression along with lateral loading, so I need terms of M(x) + Faxial y(x) was well as variable I(x).  They all can solve.

RichardJ
19-Tanzanite
(To:sdidam)

Like Fred I can't read your Prime 3.1 file, but perhaps this will help

Turn odesolve into a function. Here's an example that was written in Mathcad 15:

The syntax in Prime is a little different, but not much. Theta is now a function of the two parameters i and j (in your case, it would be a and F, your unknowns). Remember that odesolve returns a function, so theta(i,j) is a function that returns a function. We now need to convert this function to a simple function that returns values, rather than another function. This is such a function for a single value of i, j, and t:

If you want to pass it a vector of values for t use this form of the function though:

You don't want to use the first version for many values of t, because it will call the odesolve block for every value. The second version will call it only once. Now if I don't know what i and j are, but I can write two equations where everything other than i and j are known, for example

Theta(i,j,0)=0

Theta(i,j,1)=1

I can use a solve block to find i and j (in other words, use a solve block to do the iterative process that you are doing by hand)

AlvaroDíaz
12-Amethyst
(To:sdidam)

Hi Stephan. First, rewrite M2 as M2(x,a,F2). a & F2 are unknowns, so M2(x) is useless for odesolve. Now you have 4 conditions, two as boundary or initial conditions for the odesolve, and other two for some solve block or minimize function. For a 2nd degree ode, don't use more than 2 border or IC. But, just because a and F2 are unknowns, write the odesolver as w2(a,F2) = odesolve(w2(x),l). This is what Richard and Fred tell you to do. Now, your ode solution w2 is a function of two parameters (variables, but with some degree of ... of  ... ok, variables at least. Actually parameters is an argot in math and technically doesn't exists). Now make a good guess for a and F2, and call minimize (or maybe a solve block) for w2(a,F2).

Hope this helps.

Best regards.

Ok, I think I am close to the right solution. Is the minimize-function used correctly? The program tells me it needs a scalar or a matrix for F2. As it can be seen in the figure, F2 is a scalar, but I also defined it as a matrix, both does not work.

I found the right parameters manually by try and error (index cor) and the corresponding function sol, that fulfills the boundary conditions. But finding them by the solve block does not work.

I am sorry, but I am very new to Mathcad.

beam-deflection.JPG

Fred_Kohlhepp
23-Emerald I
(To:sdidam)

What am I missing?

You have set the problem up correctly, and it works as it should.  You have

 

Now you can solve the beam deflections for any load and position  sol1 :=w3(a1,F1),  sol2:=w3(a2,F2).

You want to solve for the load and position that give you a specific deflection and slope at wherever this position is?

I'm not sure that's a solvable problem. 

Werner_E
25-Diamond I
(To:sdidam)

One way of doing it would be like the following:

You may want to compare accuracy against the values you had found:

At first sight it looks like you can find an a-value for any given F.2-value within a given range and vice versa (I have chosen the values you found in the following examples)

but as soon as you lower the value of CTOL, no solutions are found

Regards, Werner

PS: Instead of "find" you could use "minerr" (especially when you think that there is no perfect exact solution and so it will find a solution with lower values of CTOL, too) but your choice of using "minimize" was wrong.

sdidam
1-Visitor
(To:Werner_E)

Thank you very much to everyone, you helped me a lot.

I also used the find-function, but I did not define the functions S and S1. I directly used the function w3 and its derivation in the solve-block. Then there was always a mistake. Doesn't matter, now I know how to do it.

VladimirN
24-Ruby II
(To:sdidam)

Hi Stephan,

For the future - don't forget to save your worksheet in PDF or XPS file formats for preview (and its contents).

VladimirN. wrote:

Hi Stephan,

For the future - don't forget to save your worksheet in PDF or XPS file formats for preview (and its contents).

For the future - don't forget to save your worksheet in png formats for  direct view on screen without downloading files.

Announcements

Top Tags