88 views (last 30 days)

Mahdi Khalili Hezarjaribi
on 31 Jul 2020 at 10:47

Commented: Mahdi Khalili Hezarjaribi
on 3 Aug 2020 at 17:16

Hello every one

I have this equation of ray evolution that I want to solve in matlab using ode45

where dn2 / dx equals to n * (dn / dx) and n is a function of x as n(x). n is the refractive index in Optics and this equation shows how the ray evolves in a medium of height x and range z.

β is a constant and existing, but here is my problem: I do not have the explicit form of n(x), instead, I have a data set of n for x = (0,30). How can I solve this equation using ode45, or any other method compatible for this problem, in a way that the dependent variable x is considered between 0 to 30, because my n varibales are bound only to this interval, so that I would only substitute the n variables and rest assured that x is changing according to n. n is a 1 * 300 matrix by the way

Opportunities for recent engineering grads.

Apply Today
## 19 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956185

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956185

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956209

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956209

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956242

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956242

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956719

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956719

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956851

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956851

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956974

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_956974

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957058

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957058

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957151

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957151

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957364

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957364

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957427

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957427

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957451

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957451

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957463

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957463

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957475

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957475

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957844

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957844

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957892

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_957892

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958117

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958117

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958162

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958162

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958864

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_958864

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_959206

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/573340-how-to-restrict-the-domain-of-dependent-variable-in-ode45#comment_959206

Sign in to comment.