Solving fourth-degree equations app

An application for solving fourth-degree equations.
eq

I applied the solution values of x ​​as in the picture and took them from the following reference,


https://www.researchgate.net/figure/Roots-of-fourth-order-polynomial-equation_fig13_47715135

but the application gives wrong results and I do not know why. I compared the results on the wolframalpha website.

I don't know if the error is in the application or in the equations in the reference

this site give true results

aia attached
solve_a_quadrilateral_4thdegree_x.aia (109.6 KB)

Due to the amount of calculation involved, it is likely that the error observed is due to floating point error.

...or you've made a mistake making the formula. We won't know that unless you share your blocks with us.

1 Like

aia attached
solve_a_quadrilateral_4thdegree_x.aia (109.6 KB)

Where's the button to get the numerical result for x?

All I see is simplification of the coefficients, and removal of the +-+ abuse.


= BUTTON

1 Like

In addition to what @ABG has already said, please keep in mind the the TextBox component does not give-out the input value until it loses its focus.
In other words, in your input boxes for the constants a,b,c,d if you leave the cursor in d (for example) and you press the button to "Solve for x", in effect the d value is still 0 (not entered). So, to be sure that all the inputs are truly set, once you've set the last one, move the cursor into another TextBox, already entered.
This operation will unfocus the last TextBox, and therefore also its value will be set.
(I fought this type of "error" in the past .... :fearful:so probably it could help you).
Then, I suggest you a slight modification, as below:


Give it a try.... :+1:

1 Like

It does not do any favors for any one trying to read your blocks if you leave them nested like an onion.

Can you switch them all to external form, to make the nesting easier to read?

I tried to download your blocks image, but it was too big.

I had to settle for this sea of blue.

Here's a more readable version of your onion, cauliflower style.

I notice repetition of this constant sub expression
blocks (1)

You could simplify the code by doing the constant calculation in a new variable. Think of a name for it, ThreeCubeRootsOfTwo.

I ran out of time expanding your blocks.

Maybe tomorrow I might have the energy to match them against your formulae.

1 Like

Could this be worked around by using the TextChanged block ?

1 Like

I've tried and the results don't change.

image

Try resubmitting sub-formulas to Wolfram and match its results against Do It runs against your block subformulas.

1 Like

I have been using chat gpt to apply a solved example to these equations but it also gave different and wrong results. Could all these laws and equations be wrong!!!



I leave that for you to discuss with ChatGPT.

Did I mention that you can validate a value of x by running it through the original formula and examining the results to see if they are zero.

I have tried all the equations and attempts and they all give wrong values Does anyone have proven equations that give correct values?

The AI2 Charts component has a Click detector.

You could code a generalized polynomial plotter (coefficient list, lower and upper bounds, step size) and have it zoom in a step each time the user clicks on a likely spot on the graph.

This makes the user the solver, at least numerically.

I would code one for you, but I am supposed to be asleep now.

Is there a way to integrate Python code into App Inventor to solve the equation?

Lotsa luck with that.

I whipped up a polynomial editor and plotter today, but it needs a little cleanup on the editting side for the coefficient stack. (I made it general purpose, so it could accept any polynomial and represent it internally as a list of the coefficients for exponents 0,1,2,...

The coefficient entry is a bit awkward, and I could touch it up next week.

Here it is, if you would like to play with it.
polynomial_plotter.aia (7.5 KB)

image

Next week I may have time to clean it up.

2 Likes

Last minute cleanup, for missing coefficients:
polynomial_plotter (1).aia (7.7 KB)

1 Like