`nsolve(eqs,list(ordered(eqs.free_symbols)),(.4,3,10))` (with eqs defined 
with  x1= 0,y1=10, x2=10, y2=10, length = 20) gives  
`Matrix([[0.326920231236118], 
[-3.26920231236118], [10.0000000000000]])` 

I doubt there is a closed form solution. You can easily solve the first two 
equations for `a` and `c` and then you only have the last equation in `b`.

/c

On Saturday, May 25, 2024 at 11:47:00 PM UTC-5 [email protected] wrote:

> I'm sorry , I meant to write x1=0, x2=10. It gives 
>
> Eq(Piecewise(((5 + b/(4*a))*sqrt(400*a**2 + 40*a*b + b**2 + 1) - log(4*a*b 
> + 4*sqrt(b**2 + 1)*sqrt(a**2))/(4*sqrt(a**2)) + log(80*a**2 + 4*a*b + 
> 4*sqrt(400*a**2 + 40*a*b + b**2 + 1)*sqrt(a**2))/(4*sqrt(a**2)) - 
> b*sqrt(b**2 + 1)/(4*a), ((a > -oo) & (a < oo) & Ne(a, 0)) | (Ne(a**2, 0) & 
> Ne(a*b, 0))), (-(b**2 + 1)**(3/2)/(6*a*b) + (40*a*b + b**2 + 
> 1)**(3/2)/(6*a*b), Ne(a*b, 0)), (10*sqrt(b**2 + 1), True)), 20)  
>
> but the solution I got is empty i.e. [ ]
>
> Thanks
> Shishir Kushwaha
>
> On Sunday 26 May 2024 at 06:58:37 UTC+5:30 [email protected] wrote:
>
>> With x1 = x2 = 0, arc_length_expr is equal to 0, meaning your eq3 is 
>> invalid. You can see this if you print eq3. It gets set to False, 
>> because it is 0 = 10. 
>>
>> Aaron Meurer 
>>
>> On Sat, May 25, 2024 at 5:26 PM Shishir Kushwaha 
>> <[email protected]> wrote: 
>> > 
>> > In the following piece of code I am unable to get the values of a,b and 
>> c after solving them. 
>> > Is there a different way to solve it and what am i doing wrong. Take x1 
>> = 0 , y1=10, x2=0, y2=10, length = 20. 
>> > 
>> > def get_lowest_point(self): 
>> > a, b, c, x = symbols('a b c x') 
>> > 
>> > x1, y1 = self._left_support 
>> > x2, y2 = self._right_support 
>> > length = self._length 
>> > 
>> > eq1 = Eq(a * x1**2 + b * x1 + c, y1) 
>> > eq2 = Eq(a * x2**2 + b * x2 + c, y2) 
>> > arc_length_expr = integrate(sqrt(1 + (2 * a * x + b)**2), 
>> > (x, x1, x2)) 
>> > eq3 = Eq(arc_length_expr, length) 
>> > solution = solve((eq1, eq2, eq3), (a, b, c)) 
>> > 
>> > # Print the solution to debug 
>> > print("Solution:", solution) 
>> > 
>> > return solution 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "sympy" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to [email protected]. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/6f9f85cf-e010-443a-9a5c-b03a359e1132n%40googlegroups.com.
>>  
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8af88812-28a8-4841-87f3-ccb3877a9927n%40googlegroups.com.

Reply via email to