Solving a set of equations with function implemented in another

Solving a set of equations with function implemented in another - Сообщения

#1 Опубликовано: 24.02.2017 16:13:17
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Hello,

I have an equation, which depends on two other function, which depends on one variable. How can I solve it?

Look at the attached file. smath forum.sm (96 КиБ) скачан 51 раз(а).

In general, I have set of two equations:
Fs=Nc(x)
and Fs*(d-x_compression)+Nc(x)*x_b*x_compression=M_Ed

Now, I implemented all funcitons as function of x (x stays for Ec - strain in concrete), but I can easily manipulate compression zone (x_compression) if necessary, as it is also not given as "constant".

At the beginning I define dimensions (b,h,a1) and material (fck, gamma_c, alfa_cc). I also assume compression zone and strain in concrete and I have bending moment M_Ed. Rest (and also x_compression and E_c) are editable/may change and depend on each other.

Could you please tell me what's the easiest way to solve those two equations?
Unfortunatelly, when I am trying to solve(Nc(x)=Fs,x)=0, SMath respond is that x has not been defined.

Any ideas?

BR.
#2 Опубликовано: 24.02.2017 16:20:44
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

For the needs of solving, you may assume that:
  • x_compression is given and constant (probably best for now)
  • x_compression is variable (but I should probably do it another way)


BR
#3 Опубликовано: 24.02.2017 18:22:36
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

As it looks, units is the problem .
Some remarks at the end.

Jean

smath forum.sm (104 КиБ) скачан 48 раз(а).
#4 Опубликовано: 24.02.2017 18:54:14
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Jean,

thanks for your effort.

You have written:
"nothing to solve as you have two numbers" - not exactly, once you will look into the sum of steel and concrete you may see there Nc(Ec) - Ec is variable.

"f(x) must be a function" - isn't f(x)=123 a function? Still, I don't have any results. I would like to know at what argument Nc(x) is equal to Fs (Nc(x)=16.37, as then I may estimate strains in concrete. I don't know maybe you see a result? I have attached photo. Przechwytywanie.JPG

In the meantime I have prepared another set of equation for which I would need to have similiar solution as for that one above.

Could you take one more look at it?

BR.
#5 Опубликовано: 25.02.2017 11:19:08
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

I have simplified the function definitions and the integrals and fixed the units.

Don't know if the result is correct/matches the expectation.

smath%20forum_Kr.png
smath%20forum_Kr.sm (97 КиБ) скачан 50 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Опубликовано: 25.02.2017 13:16:48
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Could you take one more look at it?



Yes, and the answer is that there is no automatic solution.
Why ? Because the base "concrete(x)" is not a function,
only a discontinuous function, incompatible to the solver(s).
Done manually at the end of the work sheet.
Maybe "Dichotomy" is suitable ?

Jean

smath forum.sm (112 КиБ) скачан 34 раз(а).

#7 Опубликовано: 25.02.2017 13:55:08
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... "Dichotomy" solves nicely !
Solves for 'x' in "concrete(x)" for any value(s) in MEd(x)

Is it done as expected ? Your stuff is not my cup of tea !

Jean

smath forum.sm (116 КиБ) скачан 54 раз(а).

#8 Опубликовано: 02.03.2017 03:25:13
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Jean, mkraska,

many thanks for your effort.

I was pretty busy last few days and this is something I am working on aside of main job, let's say.

I will look at it by the end of the week and let you know if your solution is working.

BR.
#9 Опубликовано: 03.03.2017 11:44:49
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Can we use Newton-Raphson method instead of Dichotomy for example?
#10 Опубликовано: 04.03.2017 09:25:31
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Can we use Newton-Raphson method instead of Dichotomy for example?



Answer is : NO

MED(x) is a constant , Newton-Raphson supports only functions
Dichotomy supports MED(x) defined as a constant, i.e: it
supports "fake function" as well as the 'solve block'
In your document, 'solve' fails because of the unit system.

Jean

#11 Опубликовано: 04.03.2017 09:40:00
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... rootsecant fails as well.
#12 Опубликовано: 04.03.2017 19:06:57
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Wrote

Wrote


MED(x) is a constant , Newton-Raphson supports only function



Med(x) in future may be function, not only constant. Will dichtomy be enough then to solve it?
From what I understand N-R may be applicable then, also?

Could you give me mathematical definition of dichotomy (it would be best if you can demonstrate it on that particular example)?
Then, you have stated something in pink background at the end of document. Was it check? You have defined values Epsilon, a and b - and I would like to know why.
#13 Опубликовано: 04.03.2017 22:28:44
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

The RootSecant & NewtonRaphson both need true functions.
Differently, "Dichotomy" takes a constant defined as a fake function.
In dichotomy: epsilon is the test for the convergence towards the solution,
solution desired at "epsilon accuracy". The while loop keeps refining the
solution at each step... more in green.

Jean

smath forum.sm (132 КиБ) скачан 48 раз(а).
#14 Опубликовано: 06.03.2017 15:15:58
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

Jean,

thanks again.

I have worked with this tool a bit today and yesterday and I made some changes. Right now I cannot get any results. I have added some picture and comments inside document. Also I have added values which shall be results for given data. Can you look at them?

I am looking for: strains at both edges, value of x_compression.

I have changed strain-stress function to be easier to verify results (once it will be ok, I will just change it into previous one).

BR.

Zadanie - dane sily - oblicz odksztalcenia.sm (766 КиБ) скачан 44 раз(а). - problematic Smath document (given forces, and looking for strains and compression area)
Zadanie - dane odksztalcenia - oblicz x M i N.sm (52 КиБ) скачан 44 раз(а). - the same problem, however solved with given strains (from them I've got compression area) and I was looking for forces.

Let me know in case of any questions to the idea itself.
#15 Опубликовано: 07.03.2017 03:40:42
mdominiak

mdominiak

0 сообщений из 23 понравились пользователям.

Группа: User

I have just one quick amendment, namely I am able to get proper strains in steel (εs(x)), as I know first value of force in bars N_s(x).

Then:
• σs(x)= εs(x)*E
• N_s(x)/As1= εs(x)*E
• εs(x)= N_s(x)/(As1*E)

Therefore value “y” from SMath document is known (however it depends on x). Still, I am looking for εc(x) (once I’ll have that value I will be able to get proper x_compression form Tales) or x_compression (once I’ll have that value I will be able to get proper εc(x)).
Note: values of strains (ε) and x_compression may vary, however for given set of N/M and geometric characteristics shall be equal to εs(x) = 0.3% and εc(x) = 0.15%.

Edit: See attached SMath file: I have added example.


Once I’ll finish it (with your help ) I will be interested in having all possible solutions, plotted on graph Moments/Normal forces in 2D.
Zadanie - dane sily - oblicz odksztalcenia.sm (770 КиБ) скачан 49 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений