extract coefficients of lin equ

extract coefficients of lin equ - Messages

#1 Posted: 4/10/2020 7:37:52 PM
haweHofmann

haweHofmann

3 likes in 32 posts.

Group: User

Hi, I am new to SMath and doing some exercises

How, to write the coefficients of LGS in a matrix?

What I have:

Any way to extend to a flexible amount of equations?

Clipboard_2020-04-11_00-31-06.jpg
How to avoid No Result or is it OK to have no result?

I have some augment statements do not react to "Display Input Data" switch off...
LineZC:augment(mat(el(Z,1),el(el(L',3),1),2,1),mat(el(Z,2),el(el(L',3),2),2,1))
#2 Posted: 4/10/2020 10:57:34 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Are you asking for an algo style that would take
many sets of algebraic systems to solve.
This type of collection is more reserved for collecting
different sets of fitted parameters to various data sets
compatible with the solving model... purely Classroom.

Algebraic.PNG
#3 Posted: 4/11/2020 11:05:45 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

1. Solving Algebraic and NON-Algebraic are two different animals.
2. Be very careful from so much from so little
3. Collect/solve at will from algo.
Can't do more w/o work sheet ... does it help ?
Cheers ... Jean

Solve Algebraic, NON-Algebraic Read first.sm (60 KiB) downloaded 29 time(s).
#4 Posted: 4/11/2020 11:18:21 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Here you have a generic function; the second one uses Unknowns from Custom Functions plugin, while the first requires you input the unknowns as second argument. Anything above the "core function" comment is just input checking, not strictly needed.

coeffs.sm (30 KiB) downloaded 30 time(s).

As for the error message, don't put that line procedure in the system or change it to return a result (the result is taken from the last argument/placeholder in the line function, in your case there is a loop in that placeholder, that is why the program doesn't understand what should be the value to assign in the system).

Happy Easter and stay safe everyone.

2020-04-12 19_07_55-Window.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#5 Posted: 4/11/2020 2:00:14 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

How, to write the coefficients of LGS in a matrix ?


That should do ... do more at the end of *.sm attached

Collect-Solve.PNG

Solve Algebraic, NON-Algebraic Read first.sm (70 KiB) downloaded 31 time(s).

#6 Posted: 4/11/2020 3:16:58 PM
haweHofmann

haweHofmann

3 likes in 32 posts.

Group: User

@Davide Carpi
Many thanks to the input you gave to me. I was afraid that the problem would be dedicated to string handling. The code helps me a lot to understand SMath coding.
I tried some eval but without success. I have installed your plugin custom functions - thnaks 4 your work!

@Jean Giraud
I only playing around with some schooltopics to understand the use of SMath. Calculating the beam load does not realy help me to get familiar with SMath.
I don't really understand what you're trying to tell me.
My question was how to transform linear equations to a matrix form.
According to my knowledge solve works with numerical methods and I do not see the necessity to solve linear systems of equations with them.
what i have in mind
in my experience it is easier to write down the equations than to work with the matrix input - especially when revising, deleting or adding.
Thank you 4 helping - every code from experienced users helps me...

BTW.
Symbolic eval acos(1/sqrt(2)) = pi/4 but -asin(1/sqrt(2))=asin(1/sqrt(2))
ist this a bug?

#7 Posted: 4/11/2020 4:18:39 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

In my experience it is easier to write down the equations than to work with the matrix input - especially when revising, deleting or adding.


You have first shown solving, thus helped accordingly.
You can add/delete/collect shuffle unlimited from "list"
and not solve as you demand ... try it list:=[5,2,3,4,1]
No simpler method may exist than this algo style ... 1/1 Mathcad.
Cheers ... Jean

acos(x).PNG

Page2 Shuffle Solve.sm (14 KiB) downloaded 27 time(s).

  • New Posts New Posts
  • No New Posts No New Posts