Borrar filtros
Borrar filtros

Can anbody solve this simple equation?

2 visualizaciones (últimos 30 días)
Haseeb Hassan
Haseeb Hassan el 10 de Sept. de 2018
Comentada: Haseeb Hassan el 7 de Oct. de 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)
  1 comentario
Walter Roberson
Walter Roberson el 10 de Sept. de 2018
How can they be obtained given what inputs?

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 10 de Sept. de 2018
Editada: Stephan el 13 de Sept. de 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 comentarios
Stephan
Stephan el 13 de Sept. de 2018
See my edited answer and the new attachment.
Haseeb Hassan
Haseeb Hassan el 7 de Oct. de 2018
Sir Stephan Jung...You won the show.Thumbs up for such a nice and clear answer.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by