cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Translate the entire conversation x

Lens

AlanStevens
19-Tanzanite

Lens

From Val Ochkov:

 

How to solve the lens problem in Prime?

 

Lens.pngLens-MP-1.pngLens-MP-2.png

2 REPLIES 2
Werner_E
25-Diamond I
(To:AlanStevens)

According to the error message Prime expects initial conditions for alpha and beta, even though there is no ODE for these functions

Werner_E_1-1734084972009.png

 

According the second approach and the m^2.

I am not sure if this is as it should be (a bug?) but we get the correct result if the initial value is just 0 or Zero (capital Z. no lower case).
I tend to call it a bug. As the derivative (D, tan) is dimensionless, the solution must be of the same dimension as x and the same applies to the initial value.

Werner_E_1-1734086602007.png

Limiting the vector x to values between 0m and 1m was necessary because its last value was very slightly (about 10^-16) larger than 1m and so the function y would fail.

 

 

 

StuartBruff
23-Emerald IV
(To:Werner_E)


@Werner_E wrote:

I am not sure if this is as it should be (a bug?) but we get the correct result if the initial value is just 0 or Zero (capital Z. no lower case).
I tend to call it a bug. As the derivative (D, tan) is dimensionless, the solution must be of the same dimension as x and the same applies to the initial value.


@ValeryOchkov @AlanStevens 

It is informative to try different numerical integrators.

 

2024 12 15 A.png

 

Of course, one could always roll one's own integrator.  Here's one I prepared earlier that runs (ran) under Mathcad Prime Express 7. 

 

(I've got a programmed version somewhere of the Runge-Kutta and Adams-Moulton predictor-corrector families that I wrote for M11, but I can't find it at the moment)

 

2024 12 15 B.png

Announcements

Top Tags