<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: maximize function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/maximize-function/m-p/661835#M85061</link>
    <description>&lt;P&gt;When working interactively you might do this with the profiler.&amp;nbsp; Create a column with the formula you want to maximize, then open the profiler, set desirability functions, and then maximize desirability.&lt;/P&gt;
&lt;P&gt;Table with formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1690219205203.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55226i520BD59DB2CF4B3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1690219205203.png" alt="ih_0-1690219205203.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In profiler of y, show desirability functions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_1-1690219242442.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55227iF48D37CEA9BCA465/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_1-1690219242442.png" alt="ih_1-1690219242442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Control+click (in windows) on the desirability function, set it to maximize and give it a range to search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_2-1690219373121.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55228i70B77327C98FD781/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_2-1690219373121.png" alt="ih_2-1690219373121.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adjust the axis settings and then run maximize desirability:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_3-1690219443737.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55229iFEE4E4937B60A100/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_3-1690219443737.png" alt="ih_3-1690219443737.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which does identify the value of X that maximizes Y:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_4-1690219504243.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55230i19C8CB8AC528A05D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_4-1690219504243.png" alt="ih_4-1690219504243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code to recreate the chart:&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = New Table( "WithFormula",
	Add Rows( 1 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1] )
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( 15 - (:X-3) ^ 2 )
	)
);

// show the interaction
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 533, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ) ),
	Elements( Formula( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Format( "Best", 12 ), Min( -5.83914231679298 ), Max( 5.61125768320702 ),
			Inc( 2 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"Y",
			ScaleBox,
			{Format( "Best", 12 ), Min( -22.4207925102041 ), Max( 16.6726794897959 ),
			Inc( 10 ), Minor Ticks( 0 )}
		)
	)
);

// Use the profiler with a desirability function to indicate that the Y variable should
// be maximized and give a range in which to maximize it 
prof = dt &amp;lt;&amp;lt; Profiler(
	Y( :Y ),
	Profiler(
		1,
		Desirability Functions( 1 ),
		Y &amp;lt;&amp;lt; Response Limits(
			{Lower( -100, 0.066 ), Middle( 0, 0.5 ), Upper( 100, 0.9819 ),
			Goal( "Maximize" ), Importance( 1 )}
		),
		Term Value(
			X(
				0,
				Min( -10 ),
				Max( 10 ),
				Lock( 0 ),
				Show( 1 )
			)
		)
	)
);

prof &amp;lt;&amp;lt; Maximize Desirability;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
    <pubDate>Mon, 24 Jul 2023 17:25:26 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2023-07-24T17:25:26Z</dc:date>
    <item>
      <title>maximize function</title>
      <link>https://community.jmp.com/t5/Discussions/maximize-function/m-p/661751#M85055</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;is there any way to implement the maximize function to find or search for the max values of a linear fit or in a polynomial graph?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 15:06:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/maximize-function/m-p/661751#M85055</guid>
      <dc:creator>ParametricStudy</dc:creator>
      <dc:date>2023-07-24T15:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: maximize function</title>
      <link>https://community.jmp.com/t5/Discussions/maximize-function/m-p/661835#M85061</link>
      <description>&lt;P&gt;When working interactively you might do this with the profiler.&amp;nbsp; Create a column with the formula you want to maximize, then open the profiler, set desirability functions, and then maximize desirability.&lt;/P&gt;
&lt;P&gt;Table with formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1690219205203.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55226i520BD59DB2CF4B3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1690219205203.png" alt="ih_0-1690219205203.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In profiler of y, show desirability functions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_1-1690219242442.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55227iF48D37CEA9BCA465/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_1-1690219242442.png" alt="ih_1-1690219242442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Control+click (in windows) on the desirability function, set it to maximize and give it a range to search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_2-1690219373121.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55228i70B77327C98FD781/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_2-1690219373121.png" alt="ih_2-1690219373121.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adjust the axis settings and then run maximize desirability:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_3-1690219443737.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55229iFEE4E4937B60A100/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_3-1690219443737.png" alt="ih_3-1690219443737.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which does identify the value of X that maximizes Y:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_4-1690219504243.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55230i19C8CB8AC528A05D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_4-1690219504243.png" alt="ih_4-1690219504243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code to recreate the chart:&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = New Table( "WithFormula",
	Add Rows( 1 ),
	New Column( "X",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1] )
	),
	New Column( "Y",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( 15 - (:X-3) ^ 2 )
	)
);

// show the interaction
dt &amp;lt;&amp;lt; Graph Builder(
	Size( 533, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :X ), Y( :Y ) ),
	Elements( Formula( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Format( "Best", 12 ), Min( -5.83914231679298 ), Max( 5.61125768320702 ),
			Inc( 2 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"Y",
			ScaleBox,
			{Format( "Best", 12 ), Min( -22.4207925102041 ), Max( 16.6726794897959 ),
			Inc( 10 ), Minor Ticks( 0 )}
		)
	)
);

// Use the profiler with a desirability function to indicate that the Y variable should
// be maximized and give a range in which to maximize it 
prof = dt &amp;lt;&amp;lt; Profiler(
	Y( :Y ),
	Profiler(
		1,
		Desirability Functions( 1 ),
		Y &amp;lt;&amp;lt; Response Limits(
			{Lower( -100, 0.066 ), Middle( 0, 0.5 ), Upper( 100, 0.9819 ),
			Goal( "Maximize" ), Importance( 1 )}
		),
		Term Value(
			X(
				0,
				Min( -10 ),
				Max( 10 ),
				Lock( 0 ),
				Show( 1 )
			)
		)
	)
);

prof &amp;lt;&amp;lt; Maximize Desirability;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 24 Jul 2023 17:25:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/maximize-function/m-p/661835#M85061</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2023-07-24T17:25:26Z</dc:date>
    </item>
  </channel>
</rss>

