<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; User Favorites: cgenes</title>
		<link><a href='http://www.k-wave.org/forum/profile/cgenes'>cgenes</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 07:35:46 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Time Varying Source in Thermal Simulation, Possible?"</title>
			<link>http://www.k-wave.org/forum/topic/time-varying-source-in-thermal-simulation-possible#post-7800</link>
			<pubDate>Fri, 11 Sep 2020 09:46:29 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7800@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Charlie,&#60;/p&#62;
&#60;p&#62;A few points. First, the inputs to &#60;code&#62;takeTimeStep&#60;/code&#62; are the number of time steps, and the size of the time step. So your code will take 1 time step of 60 seconds (your comments suggest you want to turn on and off for 1 second with 60 steps). &#60;/p&#62;
&#60;p&#62;Second, if your grid size is 201 x 201 x 201 as the comments suggest, the FFT calculations will be slow because of the large prime factors. Try switching to a grid size with small prime factors.&#60;/p&#62;
&#60;p&#62;Finally, with the current code, there is a reasonable overhead to calling the code for just one time step. So an alternative would be to hack &#60;code&#62;kWaveDiffusion&#60;/code&#62; to put your checks inside the internal time loop.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cgenes on "Time Varying Source in Thermal Simulation, Possible?"</title>
			<link>http://www.k-wave.org/forum/topic/time-varying-source-in-thermal-simulation-possible#post-7773</link>
			<pubDate>Wed, 26 Aug 2020 09:18:28 +0000</pubDate>
			<dc:creator>cgenes</dc:creator>
			<guid isPermaLink="false">7773@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;HI I have a related question to this &#60;/p&#62;
&#60;p&#62;I'm using the below code to cycle the beam on and off  - monitoring the heat in the middle of the 'tumour' - and then stopping the cycle when a cem&#38;gt;240 is reached at the back of the tumour - but it takes ages! have you got any advice on a better way to achieve this &#60;/p&#62;
&#60;p&#62;thanks!&#60;/p&#62;
&#60;p&#62;Charlie &#60;/p&#62;
&#60;p&#62;        back_of_tumour = 100; % in pixels on a 201x201x201 matrix&#60;br /&#62;
        middle_of_tumour = 120; % in pixels on a 201x201x201 matrix&#60;/p&#62;
&#60;p&#62;        % set source on time and off time steps&#60;br /&#62;
        on_time = 1; % [s]&#60;br /&#62;
        off_time = 1; % [s]&#60;/p&#62;
&#60;p&#62;        % calculate over this many steps&#60;br /&#62;
        dt = 60;&#60;/p&#62;
&#60;p&#62;        kdiff.takeTimeStep(on_time, dt);&#60;br /&#62;
        disp('cem43 after 1 step'); kdiff.cem43(back_of_tumour, 100, 100)&#60;/p&#62;
&#60;p&#62;        cem43_cycle_count = 0;  % except the first round which has had an extra round to initiate k.diff heating cycle&#60;br /&#62;
        on_count = 0;&#60;br /&#62;
        off_count = 0;&#60;/p&#62;
&#60;p&#62;        while kdiff.cem43(back_of_tumour, 100, 100) &#38;lt; 241&#60;/p&#62;
&#60;p&#62;            disp('cem43'); kdiff.cem43(back_of_tumour, 100, 100)&#60;/p&#62;
&#60;p&#62;            while kdiff.T(middle_of_tumour, 100, 100) &#38;lt; 65&#60;br /&#62;
                if kdiff.cem43(back_of_tumour, 100, 100) &#38;gt; 241&#60;br /&#62;
                    break&#60;br /&#62;
                end&#60;br /&#62;
                kdiff.Q = datacube;  % this is my input source in W/m^3&#60;br /&#62;
                kdiff.takeTimeStep(on_time, dt);&#60;br /&#62;
                kdiff.T(middle_of_tumour, 100, 100)&#60;br /&#62;
                on_count = on_count + 1&#60;br /&#62;
                disp('cem43'); kdiff.cem43(back_of_tumour, 100, 100)&#60;br /&#62;
            end&#60;/p&#62;
&#60;p&#62;            while kdiff.T(middle_of_tumour, 100, 100) &#38;gt; 45&#60;br /&#62;
                if kdiff.cem43(back_of_tumour, 100, 100) &#38;gt; 241&#60;br /&#62;
                    break&#60;br /&#62;
                end&#60;br /&#62;
                kdiff.Q = 0;&#60;br /&#62;
                kdiff.takeTimeStep(off_time, dt);&#60;br /&#62;
                kdiff.T(middle_of_tumour, 100, 100)&#60;br /&#62;
                off_count = off_count + 1&#60;br /&#62;
            end&#60;/p&#62;
&#60;p&#62;        cem43_cycle_count = cem43_cycle_count + 1 &#60;/p&#62;
&#60;p&#62;        end
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Time Varying Source in Thermal Simulation, Possible?"</title>
			<link>http://www.k-wave.org/forum/topic/time-varying-source-in-thermal-simulation-possible#post-7410</link>
			<pubDate>Fri, 17 Apr 2020 16:40:17 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7410@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi XCHENG,&#60;/p&#62;
&#60;p&#62;There is currently no way to directly specify a time varying source. The approach you mention is the best one for now. However, if you're switching your source on and off much faster than the thermal diffusion time, you can likely just multiply your heat source amplitude by the duty cycle, and you will get the same result.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>XCHENG on "Time Varying Source in Thermal Simulation, Possible?"</title>
			<link>http://www.k-wave.org/forum/topic/time-varying-source-in-thermal-simulation-possible#post-7383</link>
			<pubDate>Fri, 10 Apr 2020 18:07:11 +0000</pubDate>
			<dc:creator>XCHENG</dc:creator>
			<guid isPermaLink="false">7383@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Bradley,&#60;/p&#62;
&#60;p&#62;I noticed that function 'kWaveDiffusion' only accepts 'source.Q' or 'source.T0' as source input (matrix same size as [Nx, Ny, Nz]).&#60;/p&#62;
&#60;p&#62;Is there a nice way to implement a time varying heat source?&#60;/p&#62;
&#60;p&#62;Since there's not something like source.Q_mask (an equivalence for source.p_mask) I'm not sure how to achieve it. (I can't just do a 2D matrix with each row containing the time signal for each source point and then positions specified by source.p_mask anymore)&#60;/p&#62;
&#60;p&#62;My current idea is as horrible as keep turning on and off the source as that shown in examples (but way faster and way more times) to achieve this.&#60;/p&#62;
&#60;p&#62;Please enlight me and save me from my horrible idea!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
