Quantcast
Channel: PTC Community: Message List - PTC Mathcad
Viewing all 9237 articles
Browse latest View live

Re: Problem with recursive function when evaluated symbolically

$
0
0

> Does the fact that the program can have more than one answer if a = 1 have any bearing?

I don't think so.

 

I know that the sum is implemented in Mathcad in a (mathematical) wrong way. In Math a sum with an upper limit  lower than the lower limit should return zero. But thats implemented differently in Mathcad (in a way more related to programming).

 

But this should not be a problem here, because the sum is only evaluated, when a and b are greater than 1. Otherwise the "return 1" statement stops further evaluation.

Nevertheless I also tried using an otherwise statement, but to no avail.

 

WE


Re: Problem with recursive function when evaluated symbolically

$
0
0

I am sorry, but your "answer" (you just show a picture) does not relate to my question in any way as far as I can see.

It fear that you just looked at my first example and did not read my question and so you misunderstood what that question was all about. Its about the symbolic evaluation of a recursive function which calls itself in a summation expression. Nothing more and nothing less. Its not about recursion in general and sure not about Fibonacci. Fibo was just a quick example to show that recursive functions normally work pretty well with symbolic evaluation which implies that the problem is due to the summation symbol.

 

Thanks for taking time anyway

WE

Re: Problem with recursive function when evaluated symbolically

$
0
0

Indeed, mine is not a solution of your problem, it is only a joke ... a digression on the subject ... I have understood well your problem. You should turn to those who designed and wrote the software. My hidden message is that when I meet an impossible problem, or I fix it again, or try to avoid it by finding other ways to solve it.

However, all my respect for your prestige, but in much of the globe, currently, anyone can answer any question in its own way even if off topic. I'm sorry, but it is the free will ....

Regards.

F. M.

Re: Problem with recursive function when evaluated symbolically

$
0
0

> anyone can answer any question in its own way even if off topic. I'm sorry, but it is the free will ....

Sure, if somebody asks you the way to the railway station you are absolutely free to tell him the time instead. But I hope you understand that this kind of behavior is somewhat irritating and confusing and is therefore considered inappropriate by many people.

 

I also replied cause I was not sure if I overlooked any hidden message. And you clarified that there was indeed the hidden "if I have a problem, I fix it or work around" message. It seems it's probably my fault that I had not discovered this information on first sight, 'nough said, I guess.

 

Regards

WE

Re: Problem with recursive function when evaluated symbolically

$
0
0

Dear Werner,

it was not really my intention to irritate you, with my simple answer. Rather, your answer, I find it slightly irritating because it seems to come from the depths of the infinite universe ....

Bye

Re: Problem with recursive function when evaluated symbolically

$
0
0

I'm afraid it can't be solved the way you'd like, because I think the summation operator symbolically produces a row vector here. I've tried many ways to get around that. If you think of any other ways, just let me know and I'll try them.

Success!
Luc

Re: Problem with recursive function when evaluated symbolically

$
0
0

OK. I tried it one more time.

Now you get a symbolic result, but it's one less than the desired result. And if you evaluate it numerically, you get one more than the desired result.

Here goes:

Success!
Luc

Re: Problem with recursive function when evaluated symbolically

$
0
0

LucMeekes wrote:

 

OK. I tried it one more time.

Now you get a symbolic result, but it's one less than the desired result. And if you evaluate it numerically, you get one more than the desired result.

Thats strange, indeed and it does not work in Mathcad 15 the way you show (see screenshot below). The error always traces to "This function refers to itself inconsistently".

It looks to me like Richards answer ("it's a case that is not accounted for in the parser to the symbolic engine") is the correct one.

So we can see it as a bug or a limitation (which should not be there or at least should be documented).

 

It also seems that reprogramming the sum as I had done is the only workaround so far - apart from turning the whole recursion into an iteration or even in a closed formula, if possible at all.

 

Thank for all the replies!

 

Werner

 

EDIT: Here's the promised screenshot:


hi guys, i got a problem with my mathcad sheet here. Anyone able to solve it?

$
0
0

attached is my mathcad graph and equations. Why does my guess value change the maximize value?

Re: GridLines in a Graph

$
0
0

Why would I pay $2K+ for software that cannot even plot simple gridlines FREE software will do!?

Because if you buy Prime you get Mathcad 15 for free, and that has gridlines

Re: hi guys, i got a problem with my mathcad sheet here. Anyone able to solve it?

$
0
0

Your function f does not change with beta.  So when you define a guess beta that's what returns.

Re: hi guys, i got a problem with my mathcad sheet here. Anyone able to solve it?

$
0
0

Thanks for the swift reply fred. How do i go about doing this? I thought I already made f change with beta as I made beta a range variable?

Re: hi guys, i got a problem with my mathcad sheet here. Anyone able to solve it?

$
0
0

Using the range ß you created the vector FSL2, whose values correspond with the index, which is supposed to be an angle in degree.

You already got the maximum value of FSL2 and obviously you are searching for the appropriate index/angle. You could get it using match(FmaxSL2, FSL2)=... or  Match(FmaxSL2, FSL2,"near")=...

But the approach you have chosen is very limited and undesirable.

The function f you created simply looks up the appropriate value in the vector and returns it. That kind of discrete function is not suitable for a numerical algorithm used in maximize, which changes the argument in small increments to see which direction to go further.

 

You should get rid of your range ß and turn all your a,b,c, HLR, etc. into true functions of ß. Like a(ß):=cos(ß)*COG, etc. Don't use deg in the function definition - let Mathcad handle the units.

 

If you have troubles doing so, come back here and ask, but you should attach your worksheet rather than a picture, so we can help in a better way than just describing what you have to do.

 

WE

Re: hi guys, i got a problem with my mathcad sheet here. Anyone able to solve it?

$
0
0

As Werner said, functions, not vectors

Exporting a Prime 3.1 worksheet to MS Word?

$
0
0

I am trying to export my worksheet information into a MS Word document.  I am using Win7 OS, Prime 3.1, and MS Word 2013.  I only see options to work with MS Excel.

I did a Snipping Tool but the background is gray/green in color, not the same as the page format of Word.  This won't work for my customers who expect a clean report.

 

In older versions of MCAD I could copy and paste but this version doesn't seem to allow the paste feature.

 

r/


Re: Mathcad template to have vertical line in every page

$
0
0

You can also simply insert into your worksheet image of vertical line and then use this document as a template.

 

Pic_1.png

Re: Mathcad template to have vertical line in every page

$
0
0

Thanks Vladimir. However, this does not work for documents running into multiple pages, unless the picture is physically inserted in each page. The need is something like a watermark, which will continue on every page.

Re: Mathcad template to have vertical line in every page

Re: Mathcad Prime 3.0 does freeze after doing smth. like saving.

Re: How to plot a P-Q Capability Curve and R-X impedance diagram

$
0
0

Vladimir Yerokhin wrote:

 

... As you can tell, i'm on baby-steps. Does any one have any suggestions on how to get up to speed with MathCAD? ...

 

Perhaps the following will help you:

1. "Mathcad Prime Help Center" (you also can start this help center by using F1 key when the programm is running). It also contains a many of examples: http://www.ptc.com/cs/help/mathcad_hc/prime3_hc/

2. A book by Brent Maxfield "Engineering with Mathcad":

Essential Mathcad for Engineering, Science, and Math w/ CD, Second Edition

Essential PTC Mathcad Prime 3.0

3. Mathcad Prime video tutorials on PTC's "Learning Exchange" resource: All PTC Mathcad Prime Tutorials

Viewing all 9237 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>