Can anbody solve this simple equation?

1 Ansicht (letzte 30 Tage)
Haseeb Hassan
Haseeb Hassan am 10 Sep. 2018
Kommentiert: Haseeb Hassan am 7 Okt. 2018
Hello everybody.I have attached the equation 1 and equation 2 in picture,How the values on right hand side are obtained, can anybody write it step by step.I will be very thankful.Please ignore the the X and 0 in Rg(0) anf Rg(X)

Akzeptierte Antwort

Stephan
Stephan am 10 Sep. 2018
Bearbeitet: Stephan am 13 Sep. 2018
Hi,
to obtain values from your function use this:
fun_rg = @(R_g0,sigma_1,sigma_2,x)exp((x.^2.*(R_g0.^2-1.0).^2.*(1.0./2.0))./(R_g0.^2.*sigma_1.^2-R_g0.^2.*sigma_2.^2)).*sqrt(R_g0.^2)
This function handle takes values for: Rg(0), σ1, σ2 and x and gives back the value for Rg(x). For example with:
Rg(0) = 1.25
σ1 = 10
σ2 = 25
x = 3
>> fun_rg(1.25,10,25,3)
ans =
1.2478
The code to get this function is:
syms sigma_b sigma_1 sigma_2 R_g(x) R_g0
a = sqrt((sigma_b^2 + sigma_2^2) / (sigma_b^2 + sigma_1^2))
b = (sigma_2^2 - sigma_1^2) * x^2
c = 2 * (sigma_b^2 + sigma_2^2) * (sigma_b^2 + sigma_1^2)
fun_sigma_b = sqrt((sigma_2^2 - R_g0^2 * sigma_1^2) / (R_g0^2 -1))
fun_Rg_x = R_g(x) == a * exp(-b/c)
fun_Rg_x = simplifyFraction(subs(fun_Rg_x,sigma_b, fun_sigma_b))
fun_rg = matlabFunction(rhs(fun_Rg_x))
where a,b,c are stepwise written parts of the equation for Rg(x), so that Rg(x) can be written in the form:
R_g(x) = a * exp(-b/c)
This step is not neede but helps seeing what happens. To see the results in a more mathematical notation have a look at the file attached.
EDIT :
To get the result from equation 2 starting from equation 1 use:
syms sigma_b sigma_1 sigma_2 R_g(x) R_g0
a = sqrt((sigma_b^2 + sigma_2^2) / (sigma_b^2 + sigma_1^2))
b = (sigma_2^2 - sigma_1^2) * x^2
c = 2 * (sigma_b^2 + sigma_2^2) * (sigma_b^2 + sigma_1^2)
fun_Rg_x = R_g(x) == a * exp(-b/c)
fun_Rg_x = subs(fun_Rg_x,x,0)
fun_Rg_x = simplify(expand(isolate(fun_Rg_x,sigma_b)))
This will give the equation as you wanted. The mathematical notation is attached as a .pdf-file.
Best regards
Stephan
  3 Kommentare
Stephan
Stephan am 13 Sep. 2018
See my edited answer and the new attachment.
Haseeb Hassan
Haseeb Hassan am 7 Okt. 2018
Sir Stephan Jung...You won the show.Thumbs up for such a nice and clear answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by