iterative procedure programming

iterative procedure programming - help with cycles - Сообщения

#1 Опубликовано: 24.12.2023 23:51:42
Alessandro

Alessandro

0 сообщений из 2 понравились пользователям.

Группа: User

Hi everyone,
I'm new to this forum, and somehow to Smath as well. I'm no mathematician, so I do apologize from the beginning for all the mistakes and errors and ignorance.
I'm trying to set up an iterative procedure for solving an integral equation, but I cannot see any solution. I've tried to use a FOR cycle as well as a WHILE cycle. With both I can only see the end of the cycle if everything is set up for at most 4 iterations. Anything that involves more than 4 will result in the cycle to take an unreasonable amount of time (not proportional to the time it took for the first 4 iterations). For 4 iterations in takes less than a second, if a set up 6 iterations it takes 40 seconds (10 iterations, is 7 minutes and still counting). Please consider that I need to iterate the cycle for at least 10.000 steps.
The same thing happens if I set a control variable for a WHILE cycle.
Please let me know what is that I'm doing wrong.
Thanks,

Documento2.sm (7 КиБ) скачан 33 раз(а).
#2 Опубликовано: 25.12.2023 21:36:20
overlord

overlord

548 сообщений из 1332 понравились пользователям.

Группа: Moderator

Right click to for loop.
Change Optimization to Numeric.
This had speed it to 0.017s on my pc.

Regards

2023-12-25_16-37.png
#3 Опубликовано: 25.12.2023 21:48:31
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I'm trying to set up an iterative procedure for solving an integral equation,



Integration comes from integration techniques.
What you call cycle loop is generally a while loop.
It does not need pre-assigned steps.
It auto-stop on the demanded accuracy of result.
Click on Samples, visit Golden Ratio.
Jean
#4 Опубликовано: 25.12.2023 21:53:27
overlord

overlord

548 сообщений из 1332 понравились пользователям.

Группа: Moderator

PS: You can disregard what Jeans says, anything on any topic.
You is the jester of this forum, the notorious buffoon.
Answers he will give or already gave won't be related to what is asked.
I don't know the real reason of his motivation under.
But he always promotes his "nobody cares" samples.

As you can see, you asked to speed up your iteration.
He gave you a lecture about integrations, what a loser.
#5 Опубликовано: 25.12.2023 23:25:27
Alessandro

Alessandro

0 сообщений из 2 понравились пользователям.

Группа: User

I do apologize as I should have checked previous posts. I see the optimization solution in a recent post. This is definitely solving the point. Please don't fight to each other, maybe even in a non-related answer there is something to learn. Thanks to everyone for your time.
#6 Опубликовано: 26.12.2023 00:00:38
overlord

overlord

548 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

I do apologize as I should have checked previous posts. I see the optimization solution in a recent post. This is definitely solving the point. Please don't fight to each other, maybe even in a non-related answer there is something to learn. Thanks to everyone for your time.


You don't know him.
All he mean is to show off.
He has no intention to help, teach or learn.
He also has been kicked from mathcad forums.
We have been dealing with him even longer.
#7 Опубликовано: 26.12.2023 21:09:16
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I do apologize as I should have checked previous posts.
I see the optimization solution in a recent post.
This is definitely solving the point.


Thanks for confirming it solved.
Your project looks strangely an Isentropic Discharge.
I have such a project for air.
Jean

#8 Опубликовано: 26.12.2023 21:57:32
overlord

overlord

548 сообщений из 1332 понравились пользователям.

Группа: Moderator

There is also eval() option.
It stores numerical value of calculation.
Without changing optimization to numeric;
sometimes it makes loops faster too.

Regards

2023-12-26_16-56.png
1 пользователям понравился этот пост
sergio 27.12.2023 17:56:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений