TSE: About creating plots and showing these plots in TSE: Math: Newton: Raphson method to find a root of a function [image v1]

3 views
Skip to first unread message

knud van eeden

unread,
Jul 7, 2025, 1:07:49 PM7/7/25
to SemWare TSE Pro Text Editor
TSE: About creating plots and showing these plots in TSE: Math: Newton: Raphson method to find a root of a function [image v1]

Hello,

> One application I can immediately think of:
>
> 1. Run a mathematics program in TSE
>
> 2. E.g. that mathematics program and or an external program like PowerShell or similar creates dynamically at that point in time a plot / graph / curve image file.
>
> 3. You then load the plot / graph / curve image file in TSE to see the graphical end result.

===

   where you see an explanation of this Newton-Raphson method to find a root.

    1. -It takes your x guess, calculates y(x), calculates its derivative y'(x) which gives its tangent.

    2. -Then the x location where that tangent cuts the x-axis is calculated.

    3. -Then that x location becomes the new x guess and the steps repeat.

    4. -Until close enough to y close to zero or otherwise max iterations is exceeded.

2. This TSE program inputs a

    1. a function (it must be PowerShell compatible)

    2. the derivative of that function (it must be PowerShell compatible)

    3. an initial guess from you for an x location of a root

    4. maximum iterations

then uses PowerShell to calculate possibly a root
and then uses .NET to plot a curve
saved as plot.png in the same directory as where you run your TSE program.

3. -Important: Only when already 'image v1' (or a later version) is installed successfully it
               will then load the file plot.png and show it on the left
               side of TSE.

4. Tested successfully in TSE for Microsoft Windows version 4.50.24

5. See attached TSE getstrnf.s file.

6. See 3 inline screenshots.

7. Source of the PowerShell program: Artificial Intelligence: Claude (tried also ChatGPT, Google Gemini, DeepSeek, but they failed all within a reasonable amount of new attempts to create a working PowerShell program + plot)

with friendly greetings
Knud van Eeden



Inline image


Inline image
Inline image


getstrnf.s
Reply all
Reply to author
Forward
0 new messages