Please i want to help with single degree linear eq how to solve(solce(eq, x) ) it with sympy.. I tried but it takes laege time
@mccpytutorials79553 жыл бұрын
Thanks for the question - this thread might be helpful to you: stackoverflow.com/questions/37954278/poor-sympy-linsolve-solve-performance
@fidaulmustafa2904 Жыл бұрын
If I am solving an equation for x and I want to save the final answer (e.g., after running the solve(eqn, x) line), as simple float into a different variable name then how can I do that? I just need the value of x. Can you guide me?
@christian12332110003 жыл бұрын
Is it not possible to write code with sympy functions in a program instead of the console?
@mccpytutorials79553 жыл бұрын
Good question - you can! Just take what I did in the console and apply to your file, the syntax is the same. You can also use a Jupyter Notebook. Thanks
@au._.793 жыл бұрын
Thank you very much sir! ❤️❤️❤️
@mccpytutorials79553 жыл бұрын
Thanks for watching!
@JoaoVictor-og2fd2 жыл бұрын
Thank you so muuch
@dorasmuris2 жыл бұрын
For those that need a 'forced solved', it is N(your_equation)
@FernandoRamirez-ch4io3 жыл бұрын
is it possible to evaluate the [x-1] from minute 14:07? I mean convert that answer into a function
@mccpytutorials79553 жыл бұрын
This article might be helpful to you: pythonforundergradengineers.com/sympy-two-equations-for-two-unknows-and-statics-problem.html
@FernandoRamirez-ch4io3 жыл бұрын
@@mccpytutorials7955 Thank you, ir. Btw, I used the function replace and it also worked
@hasibulislamsourav93333 жыл бұрын
can I use letters instead of number?
@mccpytutorials79553 жыл бұрын
Yep, definitely - I go into different ways to define symbols in the intro tutorial here: kzbin.info/www/bejne/g3ivd3RtjM9-ba8
@sifsif27253 жыл бұрын
Can the equations be taken as user inputs, so solving an equation from the user?
@mccpytutorials79553 жыл бұрын
Hi, good question. Yes, you can use "sympify" to convert the user input into something useable here. Here's a short example for you, if you were to do this on CoCalc where a user types in Eq(3+x, 23). In: from sympy.solvers import solve from sympy import Symbol x = Symbol('x') In: eqn = sympify(input("Type in your equation using Eq() formatting, please: ")) solve(eqn) Out: Type in your equation using Eq() formatting, please: Eq(3+x, 23) [20] You can do fancier things if you don't think your user will be familiar with that formatting, or you can lay out more instructions in your prompt inside the parentheses of your input() function, but the above should cover the general principle. Hope this is helpful, thanks for watching.
@sifsif27253 жыл бұрын
@@mccpytutorials7955 Oh I see, thank you very much