Systems equation with a loop

1 visualización (últimos 30 días)
Ivana Vujkovic Bukvin
Ivana Vujkovic Bukvin el 2 de Dic. de 2019
Respondida: Dhananjay Kumar el 5 de Dic. de 2019
Hi,
I'm quite new to MATLAB, doing research in biophysics and trying to solve a system of two complex equations for some NMR work. I simplified them in the screenshots. M and D have a range of values, t, K, a, b are constants and x and r are the variables. I need to solve the equations for r, that's my end point.
I want to import M and D values as matrices and I started working on writting the script for the loops. I'm having a bigger problem with solving the equatings and I would appreciate any help to get me started, I don't expect anyone to write me a script, I just need a bit of help. Thank you!Picture 1.png

Respuestas (1)

Dhananjay Kumar
Dhananjay Kumar el 5 de Dic. de 2019
Hey,
See these two examples:
  1. Solve System of Equations with vpasolve
  2. Root of Function with fzero
If the value of a parameter is unavailable, then you can use solve function with syms variables, which will give you solution in terms of the parameters. See this example: in.mathworks.com/help/symbolic/examples/solve-equations-in-returnconditions-mode.html#responsive_offcanvas . This method is really cool but might not work with complex equations. In that case MATLAB gives you solutions using the above mentioned vpasolve function.
This example uses Symbolic Math Toolbox, which solves equations symbolicaly (the same way we differentiate/integrate functions on our notebooks to get derivative/integral function in terms of variables).

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by