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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

odesolve: found a number with a magnitude greater than 10^307

Cornel
18-Opal

odesolve: found a number with a magnitude greater than 10^307

Hi,

Cornel_0-1718110510086.png

Cornel_1-1718109967905.png

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:Cornel)

Hmmm, lets see:

Werner_E_2-1718112256580.png

 

For example

Werner_E_1-1718111926684.png

 

Primes numeric uses IEEE numbers, so any calculation which yields a result of more than about 1.7*10^308 throws an error - Primes numerics can't handle numbers that large. Thats something you have to accept and live with.

 

 

View solution in original post

6 REPLIES 6
Werner_E
24-Ruby V
(To:Cornel)

Hmmm, lets see:

Werner_E_2-1718112256580.png

 

For example

Werner_E_1-1718111926684.png

 

Primes numeric uses IEEE numbers, so any calculation which yields a result of more than about 1.7*10^308 throws an error - Primes numerics can't handle numbers that large. Thats something you have to accept and live with.

 

 

But Is normally is small/very small..so, its not good to put such value like 3A for Is...

Cornel_0-1718113240096.png

Werner_E
24-Ruby V
(To:Cornel)


@Cornel wrote:

But Is normally is small/very small..so, its not good to put such value like 3A for Is...

 


Sure! Chnging the value does not solve your initial problem, its just avoids the error thrown by the tool you use. It may mean that you either have to use a different tool or find a different approach to set up your problem which avoids numbers that large. You can't handle Dirac impulses in Prime either, don't you?

You may give it a try but I don't think that Primes new symbolic way to solve ODEs would be capable enough to solve your system, though. If you want to give it a try, your first attempt should be without units.

Werner_E
24-Ruby V
(To:Cornel)

Additional comment:

Your solve block (using the Is=1nA) works OK up to about 8.8 microseconds.

Its now up to you to find out which expression would throws a result too large for Prime to handle. Maybe(!?) then you would be able to rewrite/reformulate the expression so it avoids values too large. Good luck!

Werner_E_1-1718115824437.png

 

But there is a way to limit values which are calculated inside the odesolve block to not exceed 10^307?
Or the only way is as you said to try to find out which expression would throws a result too large for Prime to handle and then to rewrite/reformulate the expression so it avoids values too large? (this can be not so easy)

Werner_E
24-Ruby V
(To:Cornel)


@Cornel wrote:

But there is a way to limit values which are calculated inside the odesolve block to not exceed 10^307?


Maybe - if you can find out which calculation throws the error it may be possible to rewrite it in a way so that the numbers calculated remain within the allowed limits.  This can turn into quite tedious detective work.
A simple push-button solution like you always keep wishing for, where the software takes care of everything, is unlikely to exist. But then I'd be happy to be proven wrong.

 

A very simple and most obvious example:

Written that way the function f throws an error for larger arguments:

Werner_E_0-1718116492478.png

 

Rewriting the function, this equivalent function has no problems

Werner_E_1-1718116550639.png

 

Of course its not always that easy to spot the root of the problem and cure it 😞

 

Top Tags