extract coefficients of lin equ

extract coefficients of lin equ - Сообщения

#1 Опубликовано: 10.04.2020 19:37:52
haweHofmann

haweHofmann

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

Группа: 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 Опубликовано: 10.04.2020 22:57:34
Jean Giraud

Jean Giraud

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

Группа: 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 Опубликовано: 11.04.2020 11:05:45
Jean Giraud

Jean Giraud

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

Группа: 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 КиБ) скачан 29 раз(а).
#4 Опубликовано: 11.04.2020 11:18:21
Davide Carpi

Davide Carpi

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

Группа: 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 КиБ) скачан 30 раз(а).

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 Опубликовано: 11.04.2020 14:00:14
Jean Giraud

Jean Giraud

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

Группа: 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 КиБ) скачан 31 раз(а).

#6 Опубликовано: 11.04.2020 15:16:58
haweHofmann

haweHofmann

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

Группа: 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 Опубликовано: 11.04.2020 16:18:39
Jean Giraud

Jean Giraud

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

Группа: 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 КиБ) скачан 27 раз(а).

  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений