solve an equation by iterration

1 Ansicht (letzte 30 Tage)
Brice Thomas
Brice Thomas am 8 Okt. 2016
Kommentiert: Torsten am 11 Okt. 2016
Hello everyone!
I haven't been using matlab for a while and I struggle on a simple equation.
I need to obtain this result: Sigma = solve( Sigma== Sigma0*(1+k*(Epsilon-Sigma/E))^n; ) All parameters sigma0, k, Epsilon, E and n=0.2; are known. The only reason for witch I need matlab is the fact that sigma (the unknown), is on both side of the equation, and I need a iterative solver.
I though about the ode45 function but I can not find a example that fit's what I want to obtain. if I am not mistaken, I can find the derivative of the function.
dSigma= -n*Sigma0*(1+k*(Epsilon-Sigma/E))^(n-1)*(k/E)
Can someone tell me the few lines required to solve this? Thank you!

Antworten (2)

Massimo Zanetti
Massimo Zanetti am 8 Okt. 2016
Put Sigma in the other side of the equation by changing it sign, and then use fsolve. https://it.mathworks.com/help/optim/ug/fsolve.html
  1 Kommentar
Brice Thomas
Brice Thomas am 11 Okt. 2016
I still strugle, could you give a example of code? As I detailled in the answer.
Thank you!

Melden Sie sich an, um zu kommentieren.


Brice Thomas
Brice Thomas am 8 Okt. 2016
Sorry, I struggled one hour one this simple problem without seeing the program works at the end of the day...
I decided to make a simple example to test the fsolve, but even here, it does not compile and give me my root.
Here is a screen-shot of the example and the code.
function [r] = H(X) % a general function that take imput: [0:0.01:4] and must give me the % roots of sine (X) on the interval.
function [ Y ] = Test1( X )
Y=(log(X)-2); plot(X,Y); end
function [Z]=Myroot(X) X0=0.3; Z=fsolve(Test1(X),X0) end
r=Myroot(X) end
My real problem requires only for me to find the root of the expression. For this I wanted to make a function and solve it. But as I said, I strugle. Maybe helping pointing what is wrong here will help me on the other problem.
Thank you!
  2 Kommentare
John D'Errico
John D'Errico am 8 Okt. 2016
Please stop adding answers every time you make a comment. This is not an answer. There is a button to make a comment. Use it.
Torsten
Torsten am 11 Okt. 2016
Use
Z=fsolve(@Test1,X0)
instead of
Z=fsolve(Test1(X),X0)
Best wishes
Torsten.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by